Skip to content

Commit

Permalink
add more test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
mgiota committed Oct 1, 2024
1 parent 14b14b1 commit e542e88
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 1 deletion.
10 changes: 9 additions & 1 deletion test/functional/page_objects/solution_navigation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,22 @@ export function SolutionNavigationProvider(ctx: Pick<FtrProviderContext, 'getSer
// side nav related actions
sidenav: {
async expectLinkExists(
by: { deepLinkId: AppDeepLinkId } | { navId: string } | { text: string }
by:
| { deepLinkId: AppDeepLinkId }
| { navId: string }
| { text: string }
| { panelNavLinkId: string }
) {
if ('deepLinkId' in by) {
await testSubjects.existOrFail(`~nav-item-deepLinkId-${by.deepLinkId}`, {
timeout: TIMEOUT_CHECK,
});
} else if ('navId' in by) {
await testSubjects.existOrFail(`~nav-item-id-${by.navId}`, { timeout: TIMEOUT_CHECK });
} else if ('panelNavLinkId' in by) {
await testSubjects.existOrFail(`~panelNavItem-id-${by.panelNavLinkId}`, {
timeout: TIMEOUT_CHECK,
});
} else {
expect(await getByVisibleText('~nav-item', by.text)).not.be(null);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,37 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
await solutionNavigation.sidenav.clickLink({ navId: 'observabilityAIAssistant' }); // click on AI Assistant link
await solutionNavigation.breadcrumbs.expectBreadcrumbExists({ text: 'AI Assistant' });

// check Other Tools section
await solutionNavigation.sidenav.openPanel('otherTools', { button: 'link' });
{
const isOpen = await solutionNavigation.sidenav.isPanelOpen('otherTools');
expect(isOpen).to.be(true);
}
await solutionNavigation.sidenav.expectLinkExists({
panelNavLinkId: 'logs:anomalies',
});

await solutionNavigation.sidenav.expectLinkExists({
panelNavLinkId: 'logs:log-categories',
});

await solutionNavigation.sidenav.clickPanelLink('visualize');
await solutionNavigation.breadcrumbs.expectBreadcrumbExists({
text: 'Visualize library',
});

// check Machine Learning section
await solutionNavigation.sidenav.openPanel('machine_learning-landing');
{
const isOpen = await solutionNavigation.sidenav.isPanelOpen('machine_learning-landing');
expect(isOpen).to.be(true);
}

await solutionNavigation.sidenav.clickPanelLink('ml:suppliedConfigurations');
await solutionNavigation.breadcrumbs.expectBreadcrumbExists({
text: 'Supplied configurations',
});

// navigate to a different section
await solutionNavigation.sidenav.openSection('project_settings_project_nav');
await solutionNavigation.sidenav.clickLink({ deepLinkId: 'management' });
Expand Down

0 comments on commit e542e88

Please sign in to comment.