From 4f9e7490797e88027acbd7b099f10db6a1c85d12 Mon Sep 17 00:00:00 2001 From: Dzmitry Lemechko Date: Thu, 5 Oct 2023 10:12:57 +0200 Subject: [PATCH] [ftr] unskip tests that failed due to auth issue or navigation (#168006) ## Summary While debugging MKI failures I found some tests that should be stable without modification. I added waiting for page to loaded in some places though. https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/3340 60x for examples & 20x for oblt configs --- .../search_examples/search_example.ts | 5 ++-- .../dataset_selection_state.ts | 26 ++++++++++++++++--- .../observability_log_explorer/header_menu.ts | 6 ++++- .../test_suites/search/empty_page.ts | 3 +++ 4 files changed, 34 insertions(+), 6 deletions(-) diff --git a/x-pack/test_serverless/functional/test_suites/common/examples/search_examples/search_example.ts b/x-pack/test_serverless/functional/test_suites/common/examples/search_examples/search_example.ts index 67a2e41d50314..dff9c30052905 100644 --- a/x-pack/test_serverless/functional/test_suites/common/examples/search_examples/search_example.ts +++ b/x-pack/test_serverless/functional/test_suites/common/examples/search_examples/search_example.ts @@ -17,7 +17,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { // Failing: See https://github.com/elastic/kibana/issues/165730 // FLAKY: https://github.com/elastic/kibana/issues/165735 - describe.skip('Search example', () => { + describe('Search example', () => { describe('with bfetch', () => { testSearchExample(); }); @@ -83,7 +83,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); }); - it('should handle warnings', async () => { + // failing because no toasts are displayed + it.skip('should handle warnings', async () => { await testSubjects.click('searchWithWarning'); await retry.waitFor('', async () => { const toastCount = await toasts.getToastCount(); diff --git a/x-pack/test_serverless/functional/test_suites/observability/observability_log_explorer/dataset_selection_state.ts b/x-pack/test_serverless/functional/test_suites/observability/observability_log_explorer/dataset_selection_state.ts index 4c8ddb58bf45d..1e12a054c852f 100644 --- a/x-pack/test_serverless/functional/test_suites/observability/observability_log_explorer/dataset_selection_state.ts +++ b/x-pack/test_serverless/functional/test_suites/observability/observability_log_explorer/dataset_selection_state.ts @@ -12,13 +12,27 @@ import { FtrProviderContext } from '../../../ftr_provider_context'; export default function ({ getService, getPageObjects }: FtrProviderContext) { const browser = getService('browser'); const retry = getService('retry'); - const PageObjects = getPageObjects(['common', 'observabilityLogExplorer']); + const PageObjects = getPageObjects([ + 'common', + 'observabilityLogExplorer', + 'svlCommonPage', + 'header', + ]); + + // https://github.com/elastic/kibana/issues/166016 + describe('DatasetSelection initialization and update', () => { + before(async () => { + await PageObjects.svlCommonPage.login(); + }); + + after(async () => { + await PageObjects.svlCommonPage.forceLogout(); + }); - // FLAKY: https://github.com/elastic/kibana/issues/166016 - describe.skip('DatasetSelection initialization and update', () => { describe('when the "index" query param does not exist', () => { it('should initialize the "All logs" selection', async () => { await PageObjects.observabilityLogExplorer.navigateTo(); + await PageObjects.header.waitUntilLoadingHasFinished(); const datasetSelectionTitle = await PageObjects.observabilityLogExplorer.getDatasetSelectorButtonText(); @@ -35,6 +49,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { _a: rison.encode({ index: azureActivitylogsIndex }), }), }); + await PageObjects.header.waitUntilLoadingHasFinished(); const datasetSelectionTitle = await PageObjects.observabilityLogExplorer.getDatasetSelectorButtonText(); @@ -49,6 +64,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { _a: rison.encode({ index: invalidEncodedIndex }), }), }); + await PageObjects.header.waitUntilLoadingHasFinished(); const datasetSelectionTitle = await PageObjects.observabilityLogExplorer.getDatasetSelectorButtonText(); @@ -61,6 +77,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { describe('when navigating back and forth on the page history', () => { it('should decode and restore the selection for the current index', async () => { await PageObjects.observabilityLogExplorer.navigateTo(); + await PageObjects.header.waitUntilLoadingHasFinished(); const allDatasetSelectionTitle = await PageObjects.observabilityLogExplorer.getDatasetSelectorButtonText(); expect(allDatasetSelectionTitle).to.be('All logs'); @@ -73,6 +90,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { controlPanels: rison.encode({}), }), }); + await PageObjects.header.waitUntilLoadingHasFinished(); const azureDatasetSelectionTitle = await PageObjects.observabilityLogExplorer.getDatasetSelectorButtonText(); expect(azureDatasetSelectionTitle).to.be('[Azure Logs] activitylogs'); @@ -80,6 +98,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { // Go back to previous page selection await retry.try(async () => { await browser.goBack(); + await PageObjects.header.waitUntilLoadingHasFinished(); const backNavigationDatasetSelectionTitle = await PageObjects.observabilityLogExplorer.getDatasetSelectorButtonText(); expect(backNavigationDatasetSelectionTitle).to.be('All logs'); @@ -88,6 +107,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { // Go forward to previous page selection await retry.try(async () => { await browser.goForward(); + await PageObjects.header.waitUntilLoadingHasFinished(); const forwardNavigationDatasetSelectionTitle = await PageObjects.observabilityLogExplorer.getDatasetSelectorButtonText(); expect(forwardNavigationDatasetSelectionTitle).to.be('[Azure Logs] activitylogs'); diff --git a/x-pack/test_serverless/functional/test_suites/observability/observability_log_explorer/header_menu.ts b/x-pack/test_serverless/functional/test_suites/observability/observability_log_explorer/header_menu.ts index c7cba34e28ec2..882c5803a6cc0 100644 --- a/x-pack/test_serverless/functional/test_suites/observability/observability_log_explorer/header_menu.ts +++ b/x-pack/test_serverless/functional/test_suites/observability/observability_log_explorer/header_menu.ts @@ -18,10 +18,11 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { 'observabilityLogExplorer', 'svlCommonPage', 'timePicker', + 'header', ]); // FLAKY: https://github.com/elastic/kibana/issues/167189 - describe.skip('Header menu', () => { + describe('Header menu', () => { before(async () => { await kibanaServer.importExport.load('test/functional/fixtures/kbn_archiver/discover'); await esArchiver.load( @@ -29,6 +30,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { ); await PageObjects.svlCommonPage.login(); await PageObjects.observabilityLogExplorer.navigateTo(); + await PageObjects.header.waitUntilLoadingHasFinished(); }); after(async () => { @@ -47,6 +49,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { describe('Discover fallback link', () => { before(async () => { await PageObjects.observabilityLogExplorer.navigateTo(); + await PageObjects.header.waitUntilLoadingHasFinished(); }); it('should render a button link ', async () => { @@ -99,6 +102,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { describe('Add data link', () => { before(async () => { await PageObjects.observabilityLogExplorer.navigateTo(); + await PageObjects.header.waitUntilLoadingHasFinished(); }); it('should render a button link ', async () => { diff --git a/x-pack/test_serverless/functional/test_suites/search/empty_page.ts b/x-pack/test_serverless/functional/test_suites/search/empty_page.ts index 5a7891968cb81..e3e82c0b0d97b 100644 --- a/x-pack/test_serverless/functional/test_suites/search/empty_page.ts +++ b/x-pack/test_serverless/functional/test_suites/search/empty_page.ts @@ -25,6 +25,7 @@ export default function ({ getPageObject, getService }: FtrProviderContext) { it('should show search specific empty page in discover', async () => { await svlCommonNavigation.sidenav.clickLink({ deepLinkId: 'discover' }); + await testSubjects.existOrFail('~breadcrumb-deepLinkId-discover'); await testSubjects.existOrFail('kbnOverviewElasticsearchGettingStarted'); await testSubjects.click('kbnOverviewElasticsearchGettingStarted'); await svlCommonNavigation.breadcrumbs.expectBreadcrumbExists({ text: 'Getting started' }); @@ -32,6 +33,7 @@ export default function ({ getPageObject, getService }: FtrProviderContext) { it('should show search specific empty page in visualize', async () => { await svlCommonNavigation.sidenav.clickLink({ deepLinkId: 'visualize' }); + await testSubjects.existOrFail('~breadcrumb-deepLinkId-visualize'); await testSubjects.existOrFail('kbnOverviewElasticsearchGettingStarted'); await testSubjects.click('kbnOverviewElasticsearchGettingStarted'); await svlCommonNavigation.breadcrumbs.expectBreadcrumbExists({ text: 'Getting started' }); @@ -39,6 +41,7 @@ export default function ({ getPageObject, getService }: FtrProviderContext) { it('should show search specific empty page in dashboards', async () => { await svlCommonNavigation.sidenav.clickLink({ deepLinkId: 'dashboards' }); + await testSubjects.existOrFail('~breadcrumb-deepLinkId-dashboards'); await testSubjects.existOrFail('kbnOverviewElasticsearchGettingStarted'); await testSubjects.click('kbnOverviewElasticsearchGettingStarted'); await svlCommonNavigation.breadcrumbs.expectBreadcrumbExists({ text: 'Getting started' });