Skip to content

Commit

Permalink
revert common_page object toasts handling
Browse files Browse the repository at this point in the history
  • Loading branch information
Michail Yasonik committed Feb 19, 2021
1 parent bc62d98 commit 572b2fc
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions test/functional/page_objects/common_page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ export function CommonPageProvider({ getService, getPageObjects }: FtrProviderCo
const globalNav = getService('globalNav');
const testSubjects = getService('testSubjects');
const PageObjects = getPageObjects(['login']);
const toasts = getService('toasts');

const defaultTryTimeout = config.get('timeouts.try');
const defaultFindTimeout = config.get('timeouts.find');
Expand Down Expand Up @@ -397,7 +396,16 @@ export function CommonPageProvider({ getService, getPageObjects }: FtrProviderCo
}

async clearAllToasts() {
await toasts.dismissAllToasts();
const toasts = await find.allByCssSelector('.euiToast');
for (const toastElement of toasts) {
try {
await toastElement.moveMouseTo();
const closeBtn = await toastElement.findByCssSelector('.euiToast__closeButton');
await closeBtn.click();
} catch (err) {
// ignore errors, toast clear themselves after timeout
}
}
}

async getJsonBodyText() {
Expand Down

0 comments on commit 572b2fc

Please sign in to comment.