From c5a09084e91de9a3f14f91cd557d173794b854bd Mon Sep 17 00:00:00 2001 From: Rodney Norris Date: Mon, 16 Dec 2024 09:50:54 -0600 Subject: [PATCH] test(search): fix flakey solution nav (#204275) ## Summary Closes #201037 - unskipping search solution navigation tests - removing canvas from checks - canvas only renders if you have canvases, this seems to have broken and make solution nav tests flakey. removing canvas from our checks - removed ent-search apps these links were removed in another PR but I missed updating this test because it was skipped - added names for the test spaces - added some expects when opening sections to ensure they are open before moving on. I saw some flakes locally without these. ### Checklist - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [x] [Flaky Test Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was used on any tests changed Co-authored-by: Elastic Machine --- .../tests/classic_navigation.ts | 5 +- .../tests/solution_navigation.ts | 72 +++---------------- 2 files changed, 13 insertions(+), 64 deletions(-) diff --git a/x-pack/test/functional_search/tests/classic_navigation.ts b/x-pack/test/functional_search/tests/classic_navigation.ts index a290f7523f49c..118fb4b7b2a4f 100644 --- a/x-pack/test/functional_search/tests/classic_navigation.ts +++ b/x-pack/test/functional_search/tests/classic_navigation.ts @@ -26,7 +26,10 @@ export default function searchSolutionNavigation({ }); // Create a space with the search solution and navigate to its home page - ({ cleanUp, space: spaceCreated } = await spaces.create({ solution: 'classic' })); + ({ cleanUp, space: spaceCreated } = await spaces.create({ + name: 'search-classic-ftr', + solution: 'classic', + })); await browser.navigateTo(spaces.getRootUrl(spaceCreated.id)); await common.navigateToApp('enterpriseSearch'); }); diff --git a/x-pack/test/functional_search/tests/solution_navigation.ts b/x-pack/test/functional_search/tests/solution_navigation.ts index 03a4614017ba2..5517a9513ea48 100644 --- a/x-pack/test/functional_search/tests/solution_navigation.ts +++ b/x-pack/test/functional_search/tests/solution_navigation.ts @@ -14,10 +14,8 @@ export default function searchSolutionNavigation({ const { common, solutionNavigation } = getPageObjects(['common', 'solutionNavigation']); const spaces = getService('spaces'); const browser = getService('browser'); - const kibanaServer = getService('kibanaServer'); - // FLAKY: https://github.com/elastic/kibana/issues/201037 - describe.skip('Search Solution Navigation', () => { + describe('Search Solution Navigation', () => { let cleanUp: () => Promise; let spaceCreated: { id: string } = { id: '' }; @@ -28,20 +26,14 @@ export default function searchSolutionNavigation({ }); // Create a space with the search solution and navigate to its home page - ({ cleanUp, space: spaceCreated } = await spaces.create({ solution: 'es' })); + ({ cleanUp, space: spaceCreated } = await spaces.create({ + name: 'search-ftr', + solution: 'es', + })); await browser.navigateTo(spaces.getRootUrl(spaceCreated.id)); - - // canvas application is only available when installation contains canvas workpads - await kibanaServer.importExport.load( - 'x-pack/test/functional/fixtures/kbn_archiver/canvas/default' - ); }); after(async () => { - await kibanaServer.importExport.unload( - 'x-pack/test/functional/fixtures/kbn_archiver/canvas/default' - ); - // Clean up space created await cleanUp(); }); @@ -59,8 +51,6 @@ export default function searchSolutionNavigation({ await solutionNavigation.sidenav.expectLinkExists({ text: 'Search applications' }); await solutionNavigation.sidenav.expectLinkExists({ text: 'Behavioral Analytics' }); await solutionNavigation.sidenav.expectLinkExists({ text: 'Inference Endpoints' }); - await solutionNavigation.sidenav.expectLinkExists({ text: 'App Search' }); - await solutionNavigation.sidenav.expectLinkExists({ text: 'Workplace Search' }); await solutionNavigation.sidenav.expectLinkExists({ text: 'Other tools' }); }); @@ -210,38 +200,9 @@ export default function searchSolutionNavigation({ deepLinkId: 'searchInferenceEndpoints:inferenceEndpoints', }); - // check Enterprise Search - // > App Search - await solutionNavigation.sidenav.clickLink({ - deepLinkId: 'appSearch:engines', - }); - await solutionNavigation.sidenav.expectLinkActive({ - deepLinkId: 'appSearch:engines', - }); - // ent-search node not running for FTRs, so we see setup guide without breadcrumbs - // await solutionNavigation.breadcrumbs.expectBreadcrumbExists({ - // text: 'App Search', - // }); - await solutionNavigation.breadcrumbs.expectBreadcrumbExists({ - deepLinkId: 'appSearch:engines', - }); - // > Workplace Search - await solutionNavigation.sidenav.clickLink({ - deepLinkId: 'workplaceSearch', - }); - await solutionNavigation.sidenav.expectLinkActive({ - deepLinkId: 'workplaceSearch', - }); - // ent-search node not running for FTRs, so we see setup guide without breadcrumbs - // await solutionNavigation.breadcrumbs.expectBreadcrumbExists({ - // text: 'Workplace Search', - // }); - await solutionNavigation.breadcrumbs.expectBreadcrumbExists({ - deepLinkId: 'workplaceSearch', - }); - // Other tools await solutionNavigation.sidenav.openSection('search_project_nav.otherTools'); + await solutionNavigation.sidenav.expectSectionOpen('search_project_nav.otherTools'); // > Maps await solutionNavigation.sidenav.clickLink({ deepLinkId: 'maps', @@ -256,20 +217,6 @@ export default function searchSolutionNavigation({ await solutionNavigation.breadcrumbs.expectBreadcrumbExists({ deepLinkId: 'maps', }); - // > Canvas - await solutionNavigation.sidenav.clickLink({ - deepLinkId: 'canvas', - }); - await solutionNavigation.sidenav.expectLinkActive({ - deepLinkId: 'canvas', - }); - await solutionNavigation.breadcrumbs.expectBreadcrumbExists({ text: 'Other tools' }); - await solutionNavigation.breadcrumbs.expectBreadcrumbExists({ - text: 'Canvas', - }); - await solutionNavigation.breadcrumbs.expectBreadcrumbExists({ - deepLinkId: 'canvas', - }); // > Graph await solutionNavigation.sidenav.clickLink({ deepLinkId: 'graph', @@ -292,6 +239,9 @@ export default function searchSolutionNavigation({ it('renders only expected items', async () => { await solutionNavigation.sidenav.openSection('search_project_nav.otherTools'); await solutionNavigation.sidenav.openSection('project_settings_project_nav'); + await solutionNavigation.sidenav.expectSectionOpen('search_project_nav.otherTools'); + await solutionNavigation.sidenav.expectSectionOpen('project_settings_project_nav'); + await solutionNavigation.sidenav.expectOnlyDefinedLinks([ 'search_project_nav', 'enterpriseSearch', @@ -309,12 +259,8 @@ export default function searchSolutionNavigation({ 'enterpriseSearchAnalytics', 'relevance', 'searchInferenceEndpoints:inferenceEndpoints', - 'entsearch', - 'appSearch:engines', - 'workplaceSearch', 'otherTools', 'maps', - 'canvas', 'graph', 'project_settings_project_nav', 'ml:modelManagement',