mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
Attempt to fix flaky sidenav test (#212213)
Fixes #195153 ## Summary Waiting for the page to be loaded and the side nav item to exist before clicking.
This commit is contained in:
parent
9d1d297ae9
commit
f5c4f203fc
2 changed files with 8 additions and 1 deletions
|
@ -115,8 +115,10 @@ export function SolutionNavigationProvider(ctx: Pick<FtrProviderContext, 'getSer
|
|||
async clickLink(by: { deepLinkId: AppDeepLinkId } | { navId: string } | { text: string }) {
|
||||
await this.expectLinkExists(by);
|
||||
if ('deepLinkId' in by) {
|
||||
await testSubjects.existOrFail(`~nav-item-deepLinkId-${by.deepLinkId}`);
|
||||
await testSubjects.click(`~nav-item-deepLinkId-${by.deepLinkId}`);
|
||||
} else if ('navId' in by) {
|
||||
await testSubjects.existOrFail(`~nav-item-id-${by.navId}`);
|
||||
await testSubjects.click(`~nav-item-id-${by.navId}`);
|
||||
} else {
|
||||
await retry.try(async () => {
|
||||
|
|
|
@ -9,7 +9,11 @@ import expect from '@kbn/expect';
|
|||
import { FtrProviderContext } from '../../../ftr_provider_context';
|
||||
|
||||
export default function ({ getPageObjects, getService }: FtrProviderContext) {
|
||||
const { common, solutionNavigation } = getPageObjects(['common', 'solutionNavigation']);
|
||||
const { common, solutionNavigation, header } = getPageObjects([
|
||||
'common',
|
||||
'solutionNavigation',
|
||||
'header',
|
||||
]);
|
||||
const spaces = getService('spaces');
|
||||
const browser = getService('browser');
|
||||
|
||||
|
@ -24,6 +28,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
|
|||
// Create a space with the observability solution and navigate to its home page
|
||||
({ cleanUp, space: spaceCreated } = await spaces.create({ solution: 'oblt' }));
|
||||
await browser.navigateTo(spaces.getRootUrl(spaceCreated.id));
|
||||
await header.waitUntilLoadingHasFinished();
|
||||
});
|
||||
|
||||
after(async () => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue