diff --git a/x-pack/test/functional/apps/machine_learning/anomaly_detection/advanced_job.ts b/x-pack/test/functional/apps/machine_learning/anomaly_detection/advanced_job.ts index 29fd026026efe..9f4506ecccf7c 100644 --- a/x-pack/test/functional/apps/machine_learning/anomaly_detection/advanced_job.ts +++ b/x-pack/test/functional/apps/machine_learning/anomaly_detection/advanced_job.ts @@ -297,7 +297,7 @@ export default function({ getService }: FtrProviderContext) { }); it('job creation loads the job type selection page', async () => { - await ml.jobSourceSelection.selectSource(testData.jobSource); + await ml.jobSourceSelection.selectSourceForAnomalyDetectionJob(testData.jobSource); }); it('job creation loads the advanced job wizard page', async () => { diff --git a/x-pack/test/functional/apps/machine_learning/anomaly_detection/multi_metric_job.ts b/x-pack/test/functional/apps/machine_learning/anomaly_detection/multi_metric_job.ts index 11cb48de260f1..935fbc0102149 100644 --- a/x-pack/test/functional/apps/machine_learning/anomaly_detection/multi_metric_job.ts +++ b/x-pack/test/functional/apps/machine_learning/anomaly_detection/multi_metric_job.ts @@ -92,7 +92,7 @@ export default function({ getService }: FtrProviderContext) { }); it('job creation loads the job type selection page', async () => { - await ml.jobSourceSelection.selectSource('farequote'); + await ml.jobSourceSelection.selectSourceForAnomalyDetectionJob('farequote'); }); it('job creation loads the multi metric job wizard page', async () => { diff --git a/x-pack/test/functional/apps/machine_learning/anomaly_detection/population_job.ts b/x-pack/test/functional/apps/machine_learning/anomaly_detection/population_job.ts index 71e66cc569f4e..ff2275837ce2e 100644 --- a/x-pack/test/functional/apps/machine_learning/anomaly_detection/population_job.ts +++ b/x-pack/test/functional/apps/machine_learning/anomaly_detection/population_job.ts @@ -106,7 +106,7 @@ export default function({ getService }: FtrProviderContext) { }); it('job creation loads the job type selection page', async () => { - await ml.jobSourceSelection.selectSource('ecommerce'); + await ml.jobSourceSelection.selectSourceForAnomalyDetectionJob('ecommerce'); }); it('job creation loads the population job wizard page', async () => { diff --git a/x-pack/test/functional/apps/machine_learning/anomaly_detection/saved_search_job.ts b/x-pack/test/functional/apps/machine_learning/anomaly_detection/saved_search_job.ts index 0330e141b0890..7d989bc6244b8 100644 --- a/x-pack/test/functional/apps/machine_learning/anomaly_detection/saved_search_job.ts +++ b/x-pack/test/functional/apps/machine_learning/anomaly_detection/saved_search_job.ts @@ -294,7 +294,7 @@ export default function({ getService }: FtrProviderContext) { }); it('job creation loads the job type selection page', async () => { - await ml.jobSourceSelection.selectSource(testData.jobSource); + await ml.jobSourceSelection.selectSourceForAnomalyDetectionJob(testData.jobSource); }); it('job creation loads the multi metric job wizard page', async () => { diff --git a/x-pack/test/functional/apps/machine_learning/anomaly_detection/single_metric_job.ts b/x-pack/test/functional/apps/machine_learning/anomaly_detection/single_metric_job.ts index b5a544b7af9f6..1983e98a0123d 100644 --- a/x-pack/test/functional/apps/machine_learning/anomaly_detection/single_metric_job.ts +++ b/x-pack/test/functional/apps/machine_learning/anomaly_detection/single_metric_job.ts @@ -91,7 +91,7 @@ export default function({ getService }: FtrProviderContext) { }); it('job creation loads the job type selection page', async () => { - await ml.jobSourceSelection.selectSource('farequote'); + await ml.jobSourceSelection.selectSourceForAnomalyDetectionJob('farequote'); }); it('job creation loads the single metric job wizard page', async () => { diff --git a/x-pack/test/functional/services/machine_learning/job_source_selection.ts b/x-pack/test/functional/services/machine_learning/job_source_selection.ts index 9e54f59691738..41c4cfc7ec4fd 100644 --- a/x-pack/test/functional/services/machine_learning/job_source_selection.ts +++ b/x-pack/test/functional/services/machine_learning/job_source_selection.ts @@ -8,6 +8,7 @@ import { FtrProviderContext } from '../../ftr_provider_context'; export function MachineLearningJobSourceSelectionProvider({ getService }: FtrProviderContext) { const testSubjects = getService('testSubjects'); + const retry = getService('retry'); return { async assertSourceListContainsEntry(sourceName: string) { @@ -21,10 +22,16 @@ export function MachineLearningJobSourceSelectionProvider({ getService }: FtrPro await this.assertSourceListContainsEntry(sourceName); }, - async selectSource(sourceName: string) { + async selectSource(sourceName: string, nextPageSubj: string) { await this.filterSourceSelection(sourceName); - await testSubjects.clickWhenNotDisabled(`savedObjectTitle${sourceName}`); - await testSubjects.existOrFail('mlPageJobTypeSelection'); + await retry.tryForTime(30 * 1000, async () => { + await testSubjects.clickWhenNotDisabled(`savedObjectTitle${sourceName}`); + await testSubjects.existOrFail(nextPageSubj, { timeout: 10 * 1000 }); + }); + }, + + async selectSourceForAnomalyDetectionJob(sourceName: string) { + await this.selectSource(sourceName, 'mlPageJobTypeSelection'); }, }; }