Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Serverless][FTR] Fix flaky viewer_role_login test for MKI #178522

Original file line number Diff line number Diff line change
Expand Up @@ -179,19 +179,18 @@ export const SecurityNavControl: FunctionComponent<SecurityNavControlProps> = ({
panelPaddingSize="none"
buffer={0}
>
<div data-test-subj="userMenu">
<EuiContextMenu
className="chrNavControl__userMenu"
initialPanelId={0}
panels={[
{
id: 0,
title: displayName,
content: <ContextMenuContent items={items} />,
},
]}
/>
</div>
<EuiContextMenu
className="chrNavControl__userMenu"
initialPanelId={0}
panels={[
{
id: 0,
title: displayName,
content: <ContextMenuContent items={items} />,
},
]}
data-test-subj="userMenu"
/>
</EuiPopover>
);
};
15 changes: 11 additions & 4 deletions x-pack/test_serverless/functional/page_objects/svl_common_page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export function SvlCommonPageProvider({ getService, getPageObjects }: FtrProvide
const testSubjects = getService('testSubjects');
const find = getService('find');
const config = getService('config');
const pageObjects = getPageObjects(['security', 'common']);
const pageObjects = getPageObjects(['security', 'common', 'header']);
const retry = getService('retry');
const deployment = getService('deployment');
const log = getService('log');
Expand Down Expand Up @@ -229,15 +229,22 @@ export function SvlCommonPageProvider({ getService, getPageObjects }: FtrProvide
},

async clickUserAvatar() {
await testSubjects.click('userMenuAvatar');
await pageObjects.header.waitUntilLoadingHasFinished();
await testSubjects.click('userMenuAvatar', 10_000);
},

async assertUserAvatarExists() {
await testSubjects.existOrFail('userMenuAvatar');
await pageObjects.header.waitUntilLoadingHasFinished();
await testSubjects.existOrFail('userMenuAvatar', {
timeout: 10_000,
});
},

async assertUserMenuExists() {
await testSubjects.existOrFail('userMenu');
await pageObjects.header.waitUntilLoadingHasFinished();
await testSubjects.existOrFail('userMenu', {
timeout: 10_000,
});
},
};
}