Skip to content

Commit

Permalink
test(search): fix flakey solution nav (elastic#204275)
Browse files Browse the repository at this point in the history
## Summary

Closes elastic#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 <[email protected]>
  • Loading branch information
2 people authored and JoseLuisGJ committed Dec 19, 2024
1 parent a015d5e commit c5a0908
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 64 deletions.
5 changes: 4 additions & 1 deletion x-pack/test/functional_search/tests/classic_navigation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');
});
Expand Down
72 changes: 9 additions & 63 deletions x-pack/test/functional_search/tests/solution_navigation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<unknown>;
let spaceCreated: { id: string } = { id: '' };

Expand All @@ -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();
});
Expand All @@ -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' });
});

Expand Down Expand Up @@ -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',
Expand All @@ -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',
Expand All @@ -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',
Expand All @@ -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',
Expand Down

0 comments on commit c5a0908

Please sign in to comment.