diff --git a/x-pack/test/functional/apps/ml/anomaly_detection_integrations/lens_to_ml.ts b/x-pack/test/functional/apps/ml/anomaly_detection_integrations/lens_to_ml.ts index 1d0fb39bc3799..bb9c58991a28d 100644 --- a/x-pack/test/functional/apps/ml/anomaly_detection_integrations/lens_to_ml.ts +++ b/x-pack/test/functional/apps/ml/anomaly_detection_integrations/lens_to_ml.ts @@ -36,9 +36,9 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await dashboardPanelActions.openContextMenuMorePanel(header); } - // Failing: See https://github.com/elastic/kibana/issues/142762 - describe.skip('create jobs from lens', function () { + describe('create jobs from lens', function () { this.tags(['ml']); + let jobId: string; before(async () => { await ml.testResources.setKibanaTimeZoneToUTC(); @@ -58,9 +58,13 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.common.navigateToApp('dashboard'); }); + afterEach(async () => { + await ml.api.deleteAnomalyDetectionJobES(jobId); + }); + it('can create a single metric job from vis with single layer', async () => { const selectedPanelTitle = 'panel2'; - const jobId = 'job_from_lens_1'; + jobId = 'job_from_lens_1'; const numberOfCompatibleLayers = 1; const layerIndex = 0; @@ -88,13 +92,11 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await ml.jobSelection.assertJobSelection([jobId]); await ml.api.assertModelMemoryLimitForJob(jobId, '11mb'); - - await ml.api.deleteAnomalyDetectionJobES(jobId); }); it('can create multi metric job from vis with single layer', async () => { const selectedPanelTitle = 'panel1'; - const jobId = 'job_from_lens_2'; + jobId = 'job_from_lens_2'; const numberOfCompatibleLayers = 1; const layerIndex = 0; @@ -122,8 +124,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await ml.jobSelection.assertJobSelection([jobId]); await ml.api.assertModelMemoryLimitForJob(jobId, '12mb'); - - await ml.api.deleteAnomalyDetectionJobES(jobId); }); }); } diff --git a/x-pack/test/functional/apps/ml/anomaly_detection_integrations/lens_to_ml_with_wizard.ts b/x-pack/test/functional/apps/ml/anomaly_detection_integrations/lens_to_ml_with_wizard.ts index 5fc18c470a135..9c70e92a02026 100644 --- a/x-pack/test/functional/apps/ml/anomaly_detection_integrations/lens_to_ml_with_wizard.ts +++ b/x-pack/test/functional/apps/ml/anomaly_detection_integrations/lens_to_ml_with_wizard.ts @@ -89,8 +89,7 @@ export default function ({ getService, getPageObject, getPageObjects }: FtrProvi await ml.jobTable.assertJobRowJobId(jobId); } - // Failing: See https://github.com/elastic/kibana/issues/144186 - describe.skip('create jobs from lens with wizard', function () { + describe('create jobs from lens with wizard', function () { this.tags(['ml']); before(async () => { diff --git a/x-pack/test/functional/apps/ml/anomaly_detection_jobs/custom_urls.ts b/x-pack/test/functional/apps/ml/anomaly_detection_jobs/custom_urls.ts index e5f181ea8414c..5661a30362641 100644 --- a/x-pack/test/functional/apps/ml/anomaly_detection_jobs/custom_urls.ts +++ b/x-pack/test/functional/apps/ml/anomaly_detection_jobs/custom_urls.ts @@ -62,8 +62,7 @@ export default function ({ getService }: FtrProviderContext) { const ml = getService('ml'); const browser = getService('browser'); - // Failing: See https://github.com/elastic/kibana/issues/143933 - describe.skip('custom urls', function () { + describe('custom urls', function () { this.tags(['ml']); let testDashboardId: string | null = null; diff --git a/x-pack/test/functional/apps/ml/data_visualizer/index_data_visualizer_data_view_management.ts b/x-pack/test/functional/apps/ml/data_visualizer/index_data_visualizer_data_view_management.ts index 767a5951de04b..9378e36dc04f4 100644 --- a/x-pack/test/functional/apps/ml/data_visualizer/index_data_visualizer_data_view_management.ts +++ b/x-pack/test/functional/apps/ml/data_visualizer/index_data_visualizer_data_view_management.ts @@ -172,8 +172,7 @@ export default function ({ getService }: FtrProviderContext) { await ml.dataVisualizerIndexBased.assertTotalFieldsCount(testData.expected.totalFieldsCount); } - // FLAKY: https://github.com/elastic/kibana/issues/143007 - describe.skip('data view management', function () { + describe('data view management', function () { this.tags(['ml']); const indexPatternTitle = 'ft_farequote'; before(async () => { diff --git a/x-pack/test/functional/apps/ml/short_tests/pages.ts b/x-pack/test/functional/apps/ml/short_tests/pages.ts index 87fb9d03ca0c9..e17454d0fa222 100644 --- a/x-pack/test/functional/apps/ml/short_tests/pages.ts +++ b/x-pack/test/functional/apps/ml/short_tests/pages.ts @@ -10,8 +10,7 @@ import { FtrProviderContext } from '../../../ftr_provider_context'; export default function ({ getService }: FtrProviderContext) { const ml = getService('ml'); - // FLAKY: https://github.com/elastic/kibana/issues/142397 - describe.skip('page navigation', function () { + describe('page navigation', function () { this.tags(['skipFirefox', 'ml']); before(async () => { await ml.api.cleanMlIndices(); diff --git a/x-pack/test/functional/services/ml/custom_urls.ts b/x-pack/test/functional/services/ml/custom_urls.ts index 46e145cda1c3c..aeda445942382 100644 --- a/x-pack/test/functional/services/ml/custom_urls.ts +++ b/x-pack/test/functional/services/ml/custom_urls.ts @@ -170,12 +170,15 @@ export function MachineLearningCustomUrlsProvider({ async assertDiscoverCustomUrlAction(expectedHitCountFormatted: string) { await PageObjects.discover.waitForDiscoverAppOnScreen(); + await PageObjects.header.waitUntilLoadingHasFinished(); + // Make sure all existing popovers are closed await browser.pressKeys(browser.keys.ESCAPE); // During cloud tests, the small browser width might cause hit count to be invisible // so temporarily collapsing the sidebar ensures the count shows await PageObjects.discover.closeSidebar(); + await retry.tryForTime(10 * 1000, async () => { const hitCount = await PageObjects.discover.getHitCount(); expect(hitCount).to.eql( diff --git a/x-pack/test/functional/services/ml/data_visualizer_index_based.ts b/x-pack/test/functional/services/ml/data_visualizer_index_based.ts index 600790294a539..7014d6d0f7f40 100644 --- a/x-pack/test/functional/services/ml/data_visualizer_index_based.ts +++ b/x-pack/test/functional/services/ml/data_visualizer_index_based.ts @@ -19,6 +19,11 @@ export function MachineLearningDataVisualizerIndexBasedProvider({ const filterBar = getService('filterBar'); const browser = getService('browser'); + type RandomSamplerOption = + | 'dvRandomSamplerOptionOnAutomatic' + | 'dvRandomSamplerOptionOnManual' + | 'dvRandomSamplerOptionOff'; + return { async assertTimeRangeSelectorSectionExists() { await testSubjects.existOrFail('dataVisualizerTimeRangeSelectorSection'); @@ -34,11 +39,15 @@ export function MachineLearningDataVisualizerIndexBasedProvider({ }); }, - async clickUseFullDataButton(expectedFormattedTotalDocCount: string) { + async clickUseFullDataButton( + expectedFormattedTotalDocCount: string, + randomSamplerOption: RandomSamplerOption = 'dvRandomSamplerOptionOff' + ) { await retry.tryForTime(30 * 1000, async () => { await testSubjects.clickWhenNotDisabledWithoutRetry('dataVisualizerButtonUseFullData'); await testSubjects.clickWhenNotDisabledWithoutRetry('superDatePickerApplyTimeButton'); - await this.assertTotalDocumentCount(expectedFormattedTotalDocCount); + await this.setRandomSamplingOption(randomSamplerOption); + await await this.assertTotalDocumentCount(expectedFormattedTotalDocCount); }); }, @@ -238,10 +247,7 @@ export function MachineLearningDataVisualizerIndexBasedProvider({ }, async assertRandomSamplingOption( - expectedOption: - | 'dvRandomSamplerOptionOnAutomatic' - | 'dvRandomSamplerOptionOnManual' - | 'dvRandomSamplerOptionOff', + expectedOption: RandomSamplerOption, expectedProbability?: number ) { await retry.tryForTime(20000, async () => { @@ -291,12 +297,7 @@ export function MachineLearningDataVisualizerIndexBasedProvider({ }); }, - async setRandomSamplingOption( - option: - | 'dvRandomSamplerOptionOnAutomatic' - | 'dvRandomSamplerOptionOnManual' - | 'dvRandomSamplerOptionOff' - ) { + async setRandomSamplingOption(option: RandomSamplerOption) { await retry.tryForTime(20000, async () => { // escape popover await browser.pressKeys(browser.keys.ESCAPE);