kibana/x-pack/test/functional/services/ml/job_type_selection.ts
Brandon Kobel 4584a8b570
Elastic License 2.0 (#90099)
* Updating everything except the license headers themselves

* Applying ESLint rules

* Manually replacing the stragglers
2021-02-03 18:12:39 -08:00

59 lines
1.9 KiB
TypeScript

/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/
import { FtrProviderContext } from '../../ftr_provider_context';
export function MachineLearningJobTypeSelectionProvider({ getService }: FtrProviderContext) {
const testSubjects = getService('testSubjects');
return {
async selectSingleMetricJob() {
await testSubjects.clickWhenNotDisabled('mlJobTypeLinkSingleMetricJob');
await this.assertSingleMetricJobWizardOpen();
},
async assertSingleMetricJobWizardOpen() {
await testSubjects.existOrFail('mlPageJobWizard single_metric');
},
async selectMultiMetricJob() {
await testSubjects.clickWhenNotDisabled('mlJobTypeLinkMultiMetricJob');
await this.assertMultiMetricJobWizardOpen();
},
async assertMultiMetricJobWizardOpen() {
await testSubjects.existOrFail('mlPageJobWizard multi_metric');
},
async selectPopulationJob() {
await testSubjects.clickWhenNotDisabled('mlJobTypeLinkPopulationJob');
await this.assertPopulationJobWizardOpen();
},
async assertPopulationJobWizardOpen() {
await testSubjects.existOrFail('mlPageJobWizard population');
},
async selectAdvancedJob() {
await testSubjects.clickWhenNotDisabled('mlJobTypeLinkAdvancedJob');
await this.assertAdvancedJobWizardOpen();
},
async assertAdvancedJobWizardOpen() {
await testSubjects.existOrFail('mlPageJobWizard advanced');
},
async selectCategorizationJob() {
await testSubjects.clickWhenNotDisabled('mlJobTypeLinkCategorizationJob');
await this.assertCategorizationJobWizardOpen();
},
async assertCategorizationJobWizardOpen() {
await testSubjects.existOrFail('mlPageJobWizard categorization');
},
};
}