Skip to content

Commit

Permalink
[Infra] Attempt to fix home_page test (elastic#202120)
Browse files Browse the repository at this point in the history
fixes elastic#194945

## Summary

Attempt to fix saved views test case in the home_page suite
  • Loading branch information
crespocarlos authored and CAWilson94 committed Dec 12, 2024
1 parent 5b4426c commit 37ade0e
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions x-pack/test/functional/page_objects/infra_saved_views.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export function InfraSavedViewsProvider({ getService }: FtrProviderContext) {
const retry = getService('retry');
const testSubjects = getService('testSubjects');
const browser = getService('browser');
const config = getService('config');

return {
async clickSavedViewsButton() {
Expand All @@ -25,13 +26,15 @@ export function InfraSavedViewsProvider({ getService }: FtrProviderContext) {

return button.click();
},
pressEsc() {
async pressEsc() {
return browser.pressKeys([Key.ESCAPE]);
},

async closeSavedViewsPopover() {
await testSubjects.find('savedViews-popover');
return this.pressEsc();
await retry.tryForTime(config.get('timeouts.try'), async () => {
await this.pressEsc();
await testSubjects.missingOrFail('loadViewsFlyout');
});
},

clickManageViewsButton() {
Expand All @@ -55,7 +58,7 @@ export function InfraSavedViewsProvider({ getService }: FtrProviderContext) {
await testSubjects.setValue('savedViewName', name);
await testSubjects.click('createSavedViewButton');
await testSubjects.missingOrFail('createSavedViewButton', { timeout: 20000 });
await retry.tryForTime(10 * 1000, async () => {
await retry.tryForTime(config.get('timeouts.try'), async () => {
await testSubjects.missingOrFail('savedViews-upsertModal');
});
},
Expand All @@ -71,7 +74,7 @@ export function InfraSavedViewsProvider({ getService }: FtrProviderContext) {
},

async ensureViewIsLoaded(name: string) {
await retry.tryForTime(5000, async () => {
await retry.tryForTime(config.get('timeouts.try'), async () => {
const subject = await testSubjects.find('savedViews-openPopover');
expect(await subject.getVisibleText()).to.be(name);
});
Expand Down

0 comments on commit 37ade0e

Please sign in to comment.