diff --git a/x-pack/legacy/plugins/ml/public/jobs/jobs_list/components/job_actions/management.js b/x-pack/legacy/plugins/ml/public/jobs/jobs_list/components/job_actions/management.js index ba13b06821a1f..7d97c8589e7d1 100644 --- a/x-pack/legacy/plugins/ml/public/jobs/jobs_list/components/job_actions/management.js +++ b/x-pack/legacy/plugins/ml/public/jobs/jobs_list/components/job_actions/management.js @@ -40,7 +40,8 @@ export function actionsMenuContent(showEditJobFlyout, showDeleteJobModal, showSt onClick: (item) => { showStartDatafeedModal([item]); closeMenu(); - } + }, + 'data-test-subj': 'mlActionButtonStartDatafeed' }, { name: i18n.translate('xpack.ml.jobsList.managementActions.stopDatafeedLabel', { defaultMessage: 'Stop datafeed' @@ -54,7 +55,8 @@ export function actionsMenuContent(showEditJobFlyout, showDeleteJobModal, showSt onClick: (item) => { stopDatafeeds([item], refreshJobs); closeMenu(true); - } + }, + 'data-test-subj': 'mlActionButtonStopDatafeed' }, { name: i18n.translate('xpack.ml.jobsList.managementActions.closeJobLabel', { defaultMessage: 'Close job' @@ -68,7 +70,8 @@ export function actionsMenuContent(showEditJobFlyout, showDeleteJobModal, showSt onClick: (item) => { closeJobs([item], refreshJobs); closeMenu(true); - } + }, + 'data-test-subj': 'mlActionButtonCloseJob' }, { name: i18n.translate('xpack.ml.jobsList.managementActions.cloneJobLabel', { defaultMessage: 'Clone job' @@ -92,7 +95,8 @@ export function actionsMenuContent(showEditJobFlyout, showDeleteJobModal, showSt onClick: (item) => { cloneJob(item.id); closeMenu(true); - } + }, + 'data-test-subj': 'mlActionButtonCloneJob' }, { name: i18n.translate('xpack.ml.jobsList.managementActions.editJobLabel', { defaultMessage: 'Edit job' @@ -105,7 +109,8 @@ export function actionsMenuContent(showEditJobFlyout, showDeleteJobModal, showSt onClick: (item) => { showEditJobFlyout(item); closeMenu(); - } + }, + 'data-test-subj': 'mlActionButtonEditJob' }, { name: i18n.translate('xpack.ml.jobsList.managementActions.deleteJobLabel', { defaultMessage: 'Delete job' @@ -119,7 +124,8 @@ export function actionsMenuContent(showEditJobFlyout, showDeleteJobModal, showSt onClick: (item) => { showDeleteJobModal([item]); closeMenu(); - } + }, + 'data-test-subj': 'mlActionButtonDeleteJob' } ]; } diff --git a/x-pack/legacy/plugins/ml/public/jobs/jobs_list/components/job_details/job_details.js b/x-pack/legacy/plugins/ml/public/jobs/jobs_list/components/job_details/job_details.js index 97e7c1b72e565..192310937c0e9 100644 --- a/x-pack/legacy/plugins/ml/public/jobs/jobs_list/components/job_details/job_details.js +++ b/x-pack/legacy/plugins/ml/public/jobs/jobs_list/components/job_details/job_details.js @@ -51,7 +51,7 @@ class JobDetailsUI extends Component { const { job } = this.state; if (job === undefined) { return ( -
+
); @@ -77,35 +77,35 @@ class JobDetailsUI extends Component { const tabs = [{ id: 'job-settings', - 'data-test-subj': 'tab-job-settings', + 'data-test-subj': 'mlJobListTab-job-settings', name: intl.formatMessage({ id: 'xpack.ml.jobsList.jobDetails.tabs.jobSettingsLabel', defaultMessage: 'Job settings' }), - content: , + content: , time: job.open_time }, { id: 'job-config', - 'data-test-subj': 'tab-job-config', + 'data-test-subj': 'mlJobListTab-job-config', name: intl.formatMessage({ id: 'xpack.ml.jobsList.jobDetails.tabs.jobConfigLabel', defaultMessage: 'Job config' }), content: , }, { id: 'counts', - 'data-test-subj': 'tab-counts', + 'data-test-subj': 'mlJobListTab-counts', name: intl.formatMessage({ id: 'xpack.ml.jobsList.jobDetails.tabs.countsLabel', defaultMessage: 'Counts' }), - content: , + content: , }, { id: 'json', - 'data-test-subj': 'tab-json', + 'data-test-subj': 'mlJobListTab-json', name: intl.formatMessage({ id: 'xpack.ml.jobsList.jobDetails.tabs.jsonLabel', defaultMessage: 'JSON' @@ -113,7 +113,7 @@ class JobDetailsUI extends Component { content: , }, { id: 'job-messages', - 'data-test-subj': 'tab-job-messages', + 'data-test-subj': 'mlJobListTab-job-messages', name: intl.formatMessage({ id: 'xpack.ml.jobsList.jobDetails.tabs.jobMessagesLabel', defaultMessage: 'Job messages' @@ -126,17 +126,17 @@ class JobDetailsUI extends Component { // Datafeed should be at index 2 in tabs array for full details tabs.splice(2, 0, { id: 'datafeed', - 'data-test-subj': 'tab-datafeed', + 'data-test-subj': 'mlJobListTab-datafeed', name: intl.formatMessage({ id: 'xpack.ml.jobsList.jobDetails.tabs.datafeedLabel', defaultMessage: 'Datafeed' }), - content: , + content: , }); tabs.push({ id: 'datafeed-preview', - 'data-test-subj': 'tab-datafeed-preview', + 'data-test-subj': 'mlJobListTab-datafeed-preview', name: intl.formatMessage({ id: 'xpack.ml.jobsList.jobDetails.tabs.datafeedPreviewLabel', defaultMessage: 'Datafeed preview' @@ -144,7 +144,7 @@ class JobDetailsUI extends Component { content: , }, { id: 'forecasts', - 'data-test-subj': 'tab-forecasts', + 'data-test-subj': 'mlJobListTab-forecasts', name: intl.formatMessage({ id: 'xpack.ml.jobsList.jobDetails.tabs.forecastsLabel', defaultMessage: 'Forecasts' @@ -156,7 +156,7 @@ class JobDetailsUI extends Component { if (mlAnnotationsEnabled && showFullDetails) { tabs.push({ id: 'annotations', - 'data-test-subj': 'tab-annotations', + 'data-test-subj': 'mlJobListTab-annotations', name: intl.formatMessage({ id: 'xpack.ml.jobsList.jobDetails.tabs.annotationsLabel', defaultMessage: 'Annotations' @@ -171,7 +171,7 @@ class JobDetailsUI extends Component { } return ( -
+

{section.title}

-
+
{ section.items.map((item, i) => ()) } diff --git a/x-pack/legacy/plugins/ml/public/jobs/jobs_list/components/job_group/job_group.js b/x-pack/legacy/plugins/ml/public/jobs/jobs_list/components/job_group/job_group.js index 9ba7aba9dc876..b0e10a975b863 100644 --- a/x-pack/legacy/plugins/ml/public/jobs/jobs_list/components/job_group/job_group.js +++ b/x-pack/legacy/plugins/ml/public/jobs/jobs_list/components/job_group/job_group.js @@ -16,7 +16,7 @@ export function JobGroup({ name }) { return (
), width: '3%' }, { field: 'id', - 'data-test-subj': 'id', + 'data-test-subj': 'mlJobListColumnId', name: intl.formatMessage({ id: 'xpack.ml.jobsList.idLabel', defaultMessage: 'ID' @@ -195,7 +195,7 @@ class JobsListUI extends Component { }), sortable: true, field: 'description', - 'data-test-subj': 'description', + 'data-test-subj': 'mlJobListColumnDescription', render: (description, item) => ( // eslint-disable-line no-unused-vars ), @@ -203,7 +203,7 @@ class JobsListUI extends Component { width: '20%' }, { field: 'processed_record_count', - 'data-test-subj': 'recordCount', + 'data-test-subj': 'mlJobListColumnRecordCount', name: intl.formatMessage({ id: 'xpack.ml.jobsList.processedRecordsLabel', defaultMessage: 'Processed records' @@ -215,7 +215,7 @@ class JobsListUI extends Component { width: '10%' }, { field: 'memory_status', - 'data-test-subj': 'memoryStatus', + 'data-test-subj': 'mlJobListColumnMemoryStatus', name: intl.formatMessage({ id: 'xpack.ml.jobsList.memoryStatusLabel', defaultMessage: 'Memory status' @@ -225,7 +225,7 @@ class JobsListUI extends Component { width: '5%' }, { field: 'jobState', - 'data-test-subj': 'jobState', + 'data-test-subj': 'mlJobListColumnJobState', name: intl.formatMessage({ id: 'xpack.ml.jobsList.jobStateLabel', defaultMessage: 'Job state' @@ -235,7 +235,7 @@ class JobsListUI extends Component { width: '8%' }, { field: 'datafeedState', - 'data-test-subj': 'datafeedState', + 'data-test-subj': 'mlJobListColumnDatafeedState', name: intl.formatMessage({ id: 'xpack.ml.jobsList.datafeedStateLabel', defaultMessage: 'Datafeed state' @@ -278,7 +278,7 @@ class JobsListUI extends Component { }), truncateText: false, field: 'latestTimestampSortValue', - 'data-test-subj': 'latestTimestamp', + 'data-test-subj': 'mlJobListColumnLatestTimestamp', sortable: true, render: (time, item) => ( // eslint-disable-line no-unused-vars @@ -355,7 +355,7 @@ class JobsListUI extends Component { sorting={sorting} hasActions={true} rowProps={item => ({ - 'data-test-subj': `row row-${item.id}` + 'data-test-subj': `mlJobListRow row-${item.id}` })} /> ); diff --git a/x-pack/legacy/plugins/ml/public/jobs/new_job_new/pages/components/pick_fields_step/components/detector_title/detector_title.tsx b/x-pack/legacy/plugins/ml/public/jobs/new_job_new/pages/components/pick_fields_step/components/detector_title/detector_title.tsx index 040d980cefab7..feac3b30dfa3b 100644 --- a/x-pack/legacy/plugins/ml/public/jobs/new_job_new/pages/components/pick_fields_step/components/detector_title/detector_title.tsx +++ b/x-pack/legacy/plugins/ml/public/jobs/new_job_new/pages/components/pick_fields_step/components/detector_title/detector_title.tsx @@ -33,7 +33,7 @@ export const DetectorTitle: FC = ({ return ( - + {getTitle(agg, field, splitField)} diff --git a/x-pack/legacy/plugins/ml/public/jobs/new_job_new/pages/components/pick_fields_step/components/influencers/influencers_select.tsx b/x-pack/legacy/plugins/ml/public/jobs/new_job_new/pages/components/pick_fields_step/components/influencers/influencers_select.tsx index 63f1936dd5f3e..f03565fd3a033 100644 --- a/x-pack/legacy/plugins/ml/public/jobs/new_job_new/pages/components/pick_fields_step/components/influencers/influencers_select.tsx +++ b/x-pack/legacy/plugins/ml/public/jobs/new_job_new/pages/components/pick_fields_step/components/influencers/influencers_select.tsx @@ -35,7 +35,7 @@ export const InfluencersSelect: FC = ({ fields, changeHandler, selectedIn selectedOptions={selection} onChange={onChange} isClearable={false} - data-test-subj="influencerSelect" + data-test-subj="mlInfluencerSelect" /> ); }; diff --git a/x-pack/legacy/plugins/ml/public/jobs/new_job_new/pages/components/pick_fields_step/components/multi_metric_view/chart_grid.tsx b/x-pack/legacy/plugins/ml/public/jobs/new_job_new/pages/components/pick_fields_step/components/multi_metric_view/chart_grid.tsx index cb2ca459da4fe..e4dd46b159a6c 100644 --- a/x-pack/legacy/plugins/ml/public/jobs/new_job_new/pages/components/pick_fields_step/components/multi_metric_view/chart_grid.tsx +++ b/x-pack/legacy/plugins/ml/public/jobs/new_job_new/pages/components/pick_fields_step/components/multi_metric_view/chart_grid.tsx @@ -54,7 +54,7 @@ export const ChartGrid: FC = ({ > {aggFieldPairList.map((af, i) => ( - + = ({ return ( {aggFieldPairList.map((af, i) => ( - + diff --git a/x-pack/legacy/plugins/ml/public/jobs/new_job_new/pages/components/pick_fields_step/components/split_cards/split_cards.tsx b/x-pack/legacy/plugins/ml/public/jobs/new_job_new/pages/components/pick_fields_step/components/split_cards/split_cards.tsx index a3c13fce53a9b..1b3eac2626e47 100644 --- a/x-pack/legacy/plugins/ml/public/jobs/new_job_new/pages/components/pick_fields_step/components/split_cards/split_cards.tsx +++ b/x-pack/legacy/plugins/ml/public/jobs/new_job_new/pages/components/pick_fields_step/components/split_cards/split_cards.tsx @@ -70,10 +70,14 @@ export const SplitCards: FC = memo( }; return (
storePanels(ref, marginBottom)} style={style}> - +
{fieldName}
@@ -85,7 +89,7 @@ export const SplitCards: FC = memo( return ( - + {(fieldValues.length === 0 || numberOfDetectors === 0) && {children}} {fieldValues.length > 0 && numberOfDetectors > 0 && splitField !== null && ( @@ -93,7 +97,7 @@ export const SplitCards: FC = memo(
= memo(
{fieldValues[0]}
diff --git a/x-pack/legacy/plugins/ml/public/jobs/new_job_new/pages/components/pick_fields_step/components/split_field/by_field.tsx b/x-pack/legacy/plugins/ml/public/jobs/new_job_new/pages/components/pick_fields_step/components/split_field/by_field.tsx index 0acabe60b0049..63576bb23f242 100644 --- a/x-pack/legacy/plugins/ml/public/jobs/new_job_new/pages/components/pick_fields_step/components/split_field/by_field.tsx +++ b/x-pack/legacy/plugins/ml/public/jobs/new_job_new/pages/components/pick_fields_step/components/split_field/by_field.tsx @@ -58,7 +58,7 @@ export const ByFieldSelector: FC = ({ detectorIndex }) => { changeHandler={setByField} selectedField={byField} isClearable={true} - testSubject="byFieldSelect" + testSubject="mlByFieldSelect" placeholder={i18n.translate( 'xpack.ml.newJob.wizard.pickFieldsStep.populationField.placeholder', { diff --git a/x-pack/legacy/plugins/ml/public/jobs/new_job_new/pages/components/pick_fields_step/components/split_field/split_field.tsx b/x-pack/legacy/plugins/ml/public/jobs/new_job_new/pages/components/pick_fields_step/components/split_field/split_field.tsx index 229072c314cc5..37ffa25e0eabf 100644 --- a/x-pack/legacy/plugins/ml/public/jobs/new_job_new/pages/components/pick_fields_step/components/split_field/split_field.tsx +++ b/x-pack/legacy/plugins/ml/public/jobs/new_job_new/pages/components/pick_fields_step/components/split_field/split_field.tsx @@ -50,9 +50,9 @@ export const SplitFieldSelector: FC = () => { isClearable={canClearSelection} testSubject={ isMultiMetricJobCreator(jc) - ? 'multiMetricSplitFieldSelect' + ? 'mlMultiMetricSplitFieldSelect' : isPopulationJobCreator(jc) - ? 'populationSplitFieldSelect' + ? 'mlPopulationSplitFieldSelect' : undefined } /> diff --git a/x-pack/legacy/plugins/ml/public/jobs/new_job_new/pages/components/time_range_step/time_range_picker.tsx b/x-pack/legacy/plugins/ml/public/jobs/new_job_new/pages/components/time_range_step/time_range_picker.tsx index b17b47308643c..26140b9557e90 100644 --- a/x-pack/legacy/plugins/ml/public/jobs/new_job_new/pages/components/time_range_step/time_range_picker.tsx +++ b/x-pack/legacy/plugins/ml/public/jobs/new_job_new/pages/components/time_range_step/time_range_picker.tsx @@ -56,7 +56,7 @@ export const TimeRangePicker: FC = ({ setTimeRange, timeRange }) => { return ( -
+
{ // click counts tab - await testSubjects.click(this.detailsSelector(jobId, 'tab-counts')); + await testSubjects.click(this.detailsSelector(jobId, 'mlJobListTab-counts')); const countsTable = await testSubjects.find( - this.detailsSelector(jobId, 'details-counts > counts') + this.detailsSelector(jobId, 'mlJobDetails-counts > mlJobRowDetailsSection-counts') ); const modelSizeStatsTable = await testSubjects.find( - this.detailsSelector(jobId, 'details-counts > modelSizeStats') + this.detailsSelector(jobId, 'mlJobDetails-counts > mlJobRowDetailsSection-modelSizeStats') ); // parse a table by reading each row @@ -142,7 +143,7 @@ export function MachineLearningJobTableProvider({ getService }: FtrProviderConte public async ensureDetailsOpen(jobId: string) { await retry.try(async () => { if (!(await testSubjects.exists(this.detailsSelector(jobId)))) { - await testSubjects.click(this.rowSelector(jobId, 'detailsToggle')); + await testSubjects.click(this.rowSelector(jobId, 'mlJobListRowDetailsToggle')); } await testSubjects.existOrFail(this.detailsSelector(jobId)); @@ -152,7 +153,7 @@ export function MachineLearningJobTableProvider({ getService }: FtrProviderConte public async ensureDetailsClosed(jobId: string) { await retry.try(async () => { if (await testSubjects.exists(this.detailsSelector(jobId))) { - await testSubjects.click(this.rowSelector(jobId, 'detailsToggle')); + await testSubjects.click(this.rowSelector(jobId, 'mlJobListRowDetailsToggle')); await testSubjects.missingOrFail(this.detailsSelector(jobId)); } }); @@ -214,40 +215,16 @@ export function MachineLearningJobTableProvider({ getService }: FtrProviderConte } public async clickActionsMenu(jobId: string) { - const jobRow = await testSubjects.find(this.rowSelector(jobId)); - const actionsCell = await jobRow.findByCssSelector(`[id=${jobId}-actions]`); - const actionsMenuButton = await actionsCell.findByTagName('button'); - - log.debug(`Clicking actions menu button for job id ${jobId}`); - await actionsMenuButton.click(); + await testSubjects.click(this.rowSelector(jobId, 'euiCollapsedItemActionsButton')); if (!(await find.existsByDisplayedByCssSelector('[class~=euiContextMenuPanel]'))) { throw new Error(`expected euiContextMenuPanel to exist`); } } - public async clickActionsMenuEntry(jobId: string, entryText: string) { - await this.clickActionsMenu(jobId); - const actionsMenuPanel = await find.byCssSelector('[class~=euiContextMenuPanel]'); - const actionButtons = await actionsMenuPanel.findAllByTagName('button'); - - const filteredButtons = []; - for (const button of actionButtons) { - if ((await button.getVisibleText()) === entryText) { - filteredButtons.push(button); - } - } - - if (!(filteredButtons.length === 1)) { - throw new Error( - `expected action button ${entryText} to exist exactly once, but found ${filteredButtons.length} matching buttons` - ); - } - log.debug(`Clicking action button ${entryText} for job id ${jobId}`); - await filteredButtons[0].click(); - } - public async clickCloneJobAction(jobId: string) { - await this.clickActionsMenuEntry(jobId, 'Clone job'); + await this.clickActionsMenu(jobId); + await testSubjects.click('mlActionButtonCloneJob'); + await testSubjects.existOrFail('~mlPageJobWizard'); } })(); } diff --git a/x-pack/test/functional/services/machine_learning/job_wizard_common.ts b/x-pack/test/functional/services/machine_learning/job_wizard_common.ts index f0ecb1289c9c8..7c85115a42aa0 100644 --- a/x-pack/test/functional/services/machine_learning/job_wizard_common.ts +++ b/x-pack/test/functional/services/machine_learning/job_wizard_common.ts @@ -230,11 +230,11 @@ export function MachineLearningJobWizardCommonProvider({ getService }: FtrProvid }, async assertInfluencerInputExists() { - await testSubjects.existOrFail('influencerSelect > comboBoxInput'); + await testSubjects.existOrFail('mlInfluencerSelect > comboBoxInput'); }, async getSelectedInfluencers(): Promise { - return await comboBox.getComboBoxSelectedOptions('influencerSelect > comboBoxInput'); + return await comboBox.getComboBoxSelectedOptions('mlInfluencerSelect > comboBoxInput'); }, async assertInfluencerSelection(influencers: string[]) { @@ -242,7 +242,7 @@ export function MachineLearningJobWizardCommonProvider({ getService }: FtrProvid }, async addInfluencer(influencer: string) { - await comboBox.setCustom('influencerSelect > comboBoxInput', influencer); + await comboBox.setCustom('mlInfluencerSelect > comboBoxInput', influencer); expect(await this.getSelectedInfluencers()).to.contain(influencer); }, @@ -256,31 +256,13 @@ export function MachineLearningJobWizardCommonProvider({ getService }: FtrProvid detectorPosition: number, chartType: string ) { - await testSubjects.existOrFail(`detector ${detectorPosition}`); - await testSubjects.existOrFail(`detector ${detectorPosition} > detectorTitle`); + await testSubjects.existOrFail(`mlDetector ${detectorPosition}`); + await testSubjects.existOrFail(`mlDetector ${detectorPosition} > mlDetectorTitle`); expect( - await testSubjects.getVisibleText(`detector ${detectorPosition} > detectorTitle`) + await testSubjects.getVisibleText(`mlDetector ${detectorPosition} > mlDetectorTitle`) ).to.eql(aggAndFieldIdentifier); - await this.assertAnomalyChartExists(chartType, `detector ${detectorPosition}`); - }, - - async assertDetectorSplitExists(splitField: string) { - await testSubjects.existOrFail(`dataSplit > dataSplitTitle ${splitField}`); - await testSubjects.existOrFail(`dataSplit > splitCard front`); - await testSubjects.existOrFail(`dataSplit > splitCard back`); - }, - - async assertDetectorSplitFrontCardTitle(frontCardTitle: string) { - expect( - await testSubjects.getVisibleText(`dataSplit > splitCard front > splitCardTitle`) - ).to.eql(frontCardTitle); - }, - - async assertDetectorSplitNumberOfBackCards(numberOfBackCards: number) { - expect(await testSubjects.findAll(`dataSplit > splitCard back`)).to.have.length( - numberOfBackCards - ); + await this.assertAnomalyChartExists(chartType, `mlDetector ${detectorPosition}`); }, async assertCreateJobButtonExists() { @@ -288,11 +270,11 @@ export function MachineLearningJobWizardCommonProvider({ getService }: FtrProvid }, async assertDateRangeSelectionExists() { - await testSubjects.existOrFail('jobWizardDateRange'); + await testSubjects.existOrFail('mlJobWizardDateRange'); }, async getSelectedDateRange() { - const dateRange = await testSubjects.find('jobWizardDateRange'); + const dateRange = await testSubjects.find('mlJobWizardDateRange'); const [startPicker, endPicker] = await dateRange.findAllByClassName('euiFieldText'); return { startDate: await startPicker.getAttribute('value'), diff --git a/x-pack/test/functional/services/machine_learning/job_wizard_multi_metric.ts b/x-pack/test/functional/services/machine_learning/job_wizard_multi_metric.ts index d57e92aaa3468..d9df6a9d682a7 100644 --- a/x-pack/test/functional/services/machine_learning/job_wizard_multi_metric.ts +++ b/x-pack/test/functional/services/machine_learning/job_wizard_multi_metric.ts @@ -13,35 +13,35 @@ export function MachineLearningJobWizardMultiMetricProvider({ getService }: FtrP return { async assertSplitFieldInputExists() { - await testSubjects.existOrFail('multiMetricSplitFieldSelect > comboBoxInput'); + await testSubjects.existOrFail('mlMultiMetricSplitFieldSelect > comboBoxInput'); }, async assertSplitFieldSelection(identifier: string) { const comboBoxSelectedOptions = await comboBox.getComboBoxSelectedOptions( - 'multiMetricSplitFieldSelect > comboBoxInput' + 'mlMultiMetricSplitFieldSelect > comboBoxInput' ); expect(comboBoxSelectedOptions.length).to.eql(1); expect(comboBoxSelectedOptions[0]).to.eql(identifier); }, async selectSplitField(identifier: string) { - await comboBox.set('multiMetricSplitFieldSelect > comboBoxInput', identifier); + await comboBox.set('mlMultiMetricSplitFieldSelect > comboBoxInput', identifier); await this.assertSplitFieldSelection(identifier); }, async assertDetectorSplitExists(splitField: string) { - await testSubjects.existOrFail(`dataSplit > dataSplitTitle ${splitField}`); - await testSubjects.existOrFail(`dataSplit > splitCard front`); + await testSubjects.existOrFail(`mlDataSplit > mlDataSplitTitle ${splitField}`); + await testSubjects.existOrFail(`mlDataSplit > mlSplitCard front`); }, async assertDetectorSplitFrontCardTitle(frontCardTitle: string) { expect( - await testSubjects.getVisibleText(`dataSplit > splitCard front > splitCardTitle`) + await testSubjects.getVisibleText(`mlDataSplit > mlSplitCard front > mlSplitCardTitle`) ).to.eql(frontCardTitle); }, async assertDetectorSplitNumberOfBackCards(numberOfBackCards: number) { - expect(await testSubjects.findAll(`dataSplit > splitCard back`)).to.have.length( + expect(await testSubjects.findAll(`mlDataSplit > mlSplitCard back`)).to.have.length( numberOfBackCards ); }, diff --git a/x-pack/test/functional/services/machine_learning/job_wizard_population.ts b/x-pack/test/functional/services/machine_learning/job_wizard_population.ts index 2b0a8c6521bd1..892bdaf394936 100644 --- a/x-pack/test/functional/services/machine_learning/job_wizard_population.ts +++ b/x-pack/test/functional/services/machine_learning/job_wizard_population.ts @@ -13,31 +13,31 @@ export function MachineLearningJobWizardPopulationProvider({ getService }: FtrPr return { async assertPopulationFieldInputExists() { - await testSubjects.existOrFail('populationSplitFieldSelect > comboBoxInput'); + await testSubjects.existOrFail('mlPopulationSplitFieldSelect > comboBoxInput'); }, async assertPopulationFieldSelection(identifier: string) { const comboBoxSelectedOptions = await comboBox.getComboBoxSelectedOptions( - 'populationSplitFieldSelect > comboBoxInput' + 'mlPopulationSplitFieldSelect > comboBoxInput' ); expect(comboBoxSelectedOptions.length).to.eql(1); expect(comboBoxSelectedOptions[0]).to.eql(identifier); }, async selectPopulationField(identifier: string) { - await comboBox.set('populationSplitFieldSelect > comboBoxInput', identifier); + await comboBox.set('mlPopulationSplitFieldSelect > comboBoxInput', identifier); await this.assertPopulationFieldSelection(identifier); }, async assertDetectorSplitFieldInputExists(detectorPosition: number) { await testSubjects.existOrFail( - `detector ${detectorPosition} > byFieldSelect > comboBoxInput` + `mlDetector ${detectorPosition} > mlByFieldSelect > comboBoxInput` ); }, async assertDetectorSplitFieldSelection(detectorPosition: number, identifier: string) { const comboBoxSelectedOptions = await comboBox.getComboBoxSelectedOptions( - `detector ${detectorPosition} > byFieldSelect > comboBoxInput` + `mlDetector ${detectorPosition} > mlByFieldSelect > comboBoxInput` ); expect(comboBoxSelectedOptions.length).to.eql(1); expect(comboBoxSelectedOptions[0]).to.eql(identifier); @@ -45,21 +45,23 @@ export function MachineLearningJobWizardPopulationProvider({ getService }: FtrPr async selectDetectorSplitField(detectorPosition: number, identifier: string) { await comboBox.set( - `detector ${detectorPosition} > byFieldSelect > comboBoxInput`, + `mlDetector ${detectorPosition} > mlByFieldSelect > comboBoxInput`, identifier ); await this.assertDetectorSplitFieldSelection(detectorPosition, identifier); }, async assertDetectorSplitExists(detectorPosition: number) { - await testSubjects.existOrFail(`detector ${detectorPosition} > dataSplit`); - await testSubjects.existOrFail(`detector ${detectorPosition} > dataSplit > splitCard front`); + await testSubjects.existOrFail(`mlDetector ${detectorPosition} > mlDataSplit`); + await testSubjects.existOrFail( + `mlDetector ${detectorPosition} > mlDataSplit > mlSplitCard front` + ); }, async assertDetectorSplitFrontCardTitle(detectorPosition: number, frontCardTitle: string) { expect( await testSubjects.getVisibleText( - `detector ${detectorPosition} > dataSplit > splitCard front > splitCardTitle` + `mlDetector ${detectorPosition} > mlDataSplit > mlSplitCard front > mlSplitCardTitle` ) ).to.eql(frontCardTitle); }, @@ -69,7 +71,9 @@ export function MachineLearningJobWizardPopulationProvider({ getService }: FtrPr numberOfBackCards: number ) { expect( - await testSubjects.findAll(`detector ${detectorPosition} > dataSplit > splitCard back`) + await testSubjects.findAll( + `mlDetector ${detectorPosition} > mlDataSplit > mlSplitCard back` + ) ).to.have.length(numberOfBackCards); }, };