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

[FTR] Refactor toasts svc #174222

Merged
merged 87 commits into from
Feb 14, 2024
Merged
Show file tree
Hide file tree
Changes from 85 commits
Commits
Show all changes
87 commits
Select commit Hold shift + click to select a range
27af4c5
[FTR] Move toasts service to shared location
wayneseymour Jan 6, 2024
23638b5
Rename dismissToast to dismissToastByIndex.
wayneseymour Jan 10, 2024
472fbd2
[CI] Auto-commit changed files from 'node scripts/lint_ts_projects --…
kibanamachine Jan 9, 2024
cbfde4c
Use new service instead.
wayneseymour Jan 11, 2024
1d19997
Refactor to shared pkg.
wayneseymour Jan 11, 2024
30780d4
Refactor to shared pkg.
wayneseymour Jan 11, 2024
3a9a1bd
Refactor to shared pkg.
wayneseymour Jan 11, 2024
bfdcab0
Drop dup symbol.
wayneseymour Jan 11, 2024
1fefe7c
Fixup symbols
wayneseymour Jan 11, 2024
7e4bbfe
Fixup symbols
wayneseymour Jan 11, 2024
ee104fb
Mv to toasts svc.
wayneseymour Jan 11, 2024
adfeb0a
Refactor name to be most specific.
wayneseymour Jan 11, 2024
981e1f4
Add type.
wayneseymour Jan 11, 2024
6de0f9e
Cleanup.
wayneseymour Jan 11, 2024
01d3956
Cleanup.
wayneseymour Jan 17, 2024
5441085
More refactoring.
wayneseymour Jan 17, 2024
bc6f2ba
de duplicate
wayneseymour Jan 17, 2024
4adb2df
correct symbol name
wayneseymour Jan 17, 2024
18cdfd5
[FTR] Move toasts service to shared location
wayneseymour Jan 6, 2024
f4f90c3
Rename dismissToast to dismissToastByIndex.
wayneseymour Jan 10, 2024
9e69f15
[CI] Auto-commit changed files from 'node scripts/lint_ts_projects --…
kibanamachine Jan 9, 2024
0a6f0d1
Use new service instead.
wayneseymour Jan 11, 2024
e43130b
Refactor to shared pkg.
wayneseymour Jan 11, 2024
d01cb32
Refactor to shared pkg.
wayneseymour Jan 11, 2024
842053a
Refactor to shared pkg.
wayneseymour Jan 11, 2024
cf96415
Drop dup symbol.
wayneseymour Jan 11, 2024
432b1aa
Fixup symbols
wayneseymour Jan 11, 2024
a8a552c
Fixup symbols
wayneseymour Jan 11, 2024
41f6ad0
Mv to toasts svc.
wayneseymour Jan 11, 2024
65cc4ff
Refactor name to be most specific.
wayneseymour Jan 11, 2024
79e04c5
Add type.
wayneseymour Jan 11, 2024
b54d554
Cleanup.
wayneseymour Jan 11, 2024
b843213
Cleanup.
wayneseymour Jan 17, 2024
afd49cc
More refactoring.
wayneseymour Jan 17, 2024
583503c
de duplicate
wayneseymour Jan 17, 2024
c5e086c
correct symbol name
wayneseymour Jan 17, 2024
dff9fe2
fixup broken test
wayneseymour Jan 18, 2024
137f331
Merge branch 'refactor-toasts-svc' of github.com:wayneseymour/kibana …
wayneseymour Jan 18, 2024
6ff4ce7
De-dupe; drop clearAllToasts() in favor of
wayneseymour Jan 19, 2024
4475726
Drop what seems to be an un-used fn call.
wayneseymour Jan 24, 2024
66a6f26
Merge branch 'main' into refactor-toasts-svc
kibanamachine Jan 26, 2024
4083f00
Merge branch 'main' into refactor-toasts-svc
kibanamachine Jan 26, 2024
eff997c
Merge branch 'main' into refactor-toasts-svc
kibanamachine Jan 27, 2024
4182039
Merge branch 'main' into refactor-toasts-svc
kibanamachine Jan 31, 2024
c5a336d
drop unused export
wayneseymour Jan 31, 2024
c2d9837
rename symbol for consistency
wayneseymour Jan 31, 2024
72a33bd
revert this fn to where it was, due to it's specificity
wayneseymour Jan 31, 2024
9964e4a
Add getToastTitleByIndex() method.
wayneseymour Feb 1, 2024
4b43dfb
Use 'new' by index methods for toasts.
wayneseymour Feb 1, 2024
1844ec3
Merge branch 'main' of github.com:elastic/kibana into refactor-toasts…
wayneseymour Feb 1, 2024
8450696
fixup connector
wayneseymour Feb 2, 2024
a27a082
Drop duplicate.
wayneseymour Feb 2, 2024
50a1248
Merge branch 'main' of github.com:elastic/kibana into refactor-toasts…
wayneseymour Feb 2, 2024
3037066
use get toast count method instead
wayneseymour Feb 2, 2024
9feb3f0
Use getToastTitleByIndex() method instead.
wayneseymour Feb 2, 2024
2537637
Merge branch 'main' into refactor-toasts-svc
kibanamachine Feb 2, 2024
b7ded72
drop log; for now
wayneseymour Feb 2, 2024
56a8333
revert
wayneseymour Feb 2, 2024
aae2e19
drop unused
wayneseymour Feb 2, 2024
fdc589c
drop unused
wayneseymour Feb 2, 2024
e91d574
Merge branch 'main' of github.com:elastic/kibana into refactor-toasts…
wayneseymour Feb 7, 2024
7968bba
fixup stale element issue
wayneseymour Feb 7, 2024
ebe2248
Merge branch 'main' of github.com:elastic/kibana into refactor-toasts…
wayneseymour Feb 8, 2024
3624350
Take Robert's advice and refactor / merge
wayneseymour Feb 8, 2024
2f4c166
Rename and clean up this method a bit, and
wayneseymour Feb 8, 2024
6b3a0e7
Drop debug logging.
wayneseymour Feb 8, 2024
6f3832b
Drop issue link per code review.
wayneseymour Feb 9, 2024
f0d7a49
Rename per cr
wayneseymour Feb 9, 2024
d4d5fc0
Rename symbols per cr.
wayneseymour Feb 9, 2024
25282e8
revert to try to preserve history
wayneseymour Feb 9, 2024
ab2207f
use (git mv src dest) to try to preserve mv history
wayneseymour Feb 9, 2024
4186fe0
add the changes back
wayneseymour Feb 9, 2024
05359f7
Merge branch 'main' of github.com:elastic/kibana into refactor-toasts…
wayneseymour Feb 9, 2024
e0746c1
split method into 2 methods per cr.
wayneseymour Feb 9, 2024
4ea4a35
More idiomatic.
wayneseymour Feb 9, 2024
d7ca2f5
Merge branch 'main' of github.com:elastic/kibana into refactor-toasts…
wayneseymour Feb 9, 2024
8772ca9
whoops, wrong method.
wayneseymour Feb 9, 2024
1f1e9ff
the OOP oops :)
wayneseymour Feb 9, 2024
fb322ef
fixup symbols
wayneseymour Feb 10, 2024
940f838
Merge branch 'main' of github.com:elastic/kibana into refactor-toasts…
wayneseymour Feb 10, 2024
44c3782
Merge branch 'main' into refactor-toasts-svc
kibanamachine Feb 10, 2024
62613eb
Merge branch 'main' into refactor-toasts-svc
kibanamachine Feb 11, 2024
5db7143
cleanup and dog food by using the new
wayneseymour Feb 12, 2024
7032a54
Change method internals to be how it was.
wayneseymour Feb 12, 2024
4fbed13
Merge branch 'main' into refactor-toasts-svc
kibanamachine Feb 12, 2024
aa9fe63
fixup comment, per cr
wayneseymour Feb 13, 2024
14c4154
Merge branch 'refactor-toasts-svc' of github.com:wayneseymour/kibana …
wayneseymour Feb 13, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,13 @@ import { RemoteProvider } from './remote';
import { FindProvider } from './find';
import { TestSubjects } from './test_subjects';
import { BrowserProvider } from './browser';
import { ToastsService } from './toasts';

export const services = {
retryOnStale: RetryOnStaleProvider,
__webdriver__: RemoteProvider,
find: FindProvider,
testSubjects: TestSubjects,
browser: BrowserProvider,
toasts: ToastsService,
};
156 changes: 156 additions & 0 deletions packages/kbn-ftr-common-functional-ui-services/services/toasts.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/

import expect from '@kbn/expect';
import { FtrService } from './ftr_provider_context';
import { WebElementWrapper } from './web_element_wrapper';

export class ToastsService extends FtrService {
private readonly testSubjects = this.ctx.getService('testSubjects');
private readonly retry = this.ctx.getService('retry');
private readonly find = this.ctx.getService('find');
private readonly config = this.ctx.getService('config');
private readonly defaultFindTimeout = this.config.get('timeouts.find');
/**
* Returns the title and message of a specific error toast.
* This method is specific to toasts created via `.addError` since they contain
* an additional button, that should not be part of the message.
*
* @param index The index of the toast (1-based, NOT 0-based!) of the toast. Use first by default.
* @param titleOnly If this is true, only the title of the error message is returned. There are error messages that only contain a title, no message.
* @returns The title and message of the specified error toast.
*/
public async getErrorByIndex(
index: number = 1,
titleOnly: boolean = false
): Promise<{ title: string; message?: string }> {
const title = await this.getTitleByIndex(index);
if (titleOnly) return { title };

const toast = await this.getElementByIndex(index);
const messageElement = await this.testSubjects.findDescendant('errorToastMessage', toast);
const message: string = await messageElement.getVisibleText();

return { title, message };
}

public async toastMessageByTestSubj(testSubj = 'csp:toast-success') {
const testSubjSvc = this.testSubjects;
return {
async getElement(): Promise<WebElementWrapper> {
return await testSubjSvc.find(testSubj);
},
async clickToastMessageLink(linkTestSubj = 'csp:toast-success-link') {
const element = await this.getElement();
const link = await element.findByTestSubject(linkTestSubj);
await link.click();
},
};
}
Comment on lines +42 to +54
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this construction is not ideal. I know it has been taken over as-is from the old implementation, however it's always just called like this: const toastMessage = await (await toasts.toastMessageByTestSubj()).getElement(); so there's no real benefit with the nested methods and IMO just makes the code more complicated to read, write and maintain. I'd suggest to refactor this bit, either in this PR or in a follow up.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree with Robert. We should not expose WebDriver interfaces like .getElement(), but only toast specific actions: close(), getText(), waitToDisappear().

Copy link
Member

@dmlemeshko dmlemeshko Feb 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pheyos @wayneseymour wdyt about removing toast from methods name?

toasts.dismissAllToasts(); => toasts.dismissAll();
toasts.closeToast(); => toasts.close();

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good to me 👍

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I completely concur!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will be resolved by: #176570


/**
* Dismiss a specific toast from the toast list. Since toasts usually should time out themselves,
* you only need to call this for permanent toasts (e.g. error toasts).
*
* @param index The 1-based index of the toast to dismiss. Use first by default.
*/
public async dismissByIndex(index: number = 1): Promise<void> {
const toast = await this.getElementByIndex(index);
await toast.moveMouseTo();
const dismissButton = await this.testSubjects.findDescendant('toastCloseButton', toast);
await dismissButton.click();
}

public async dismissIfExists(): Promise<void> {
const toastShown = await this.find.existsByCssSelector('.euiToast');
if (toastShown) {
try {
await this.testSubjects.click('toastCloseButton');
} catch (err) {
// ignore errors, toast clear themselves after timeout
}
}
}

public async getTitleAndDismiss(): Promise<string> {
const toast = await this.find.byCssSelector('.euiToast', 6 * this.defaultFindTimeout);
await toast.moveMouseTo();
const title = await (await this.testSubjects.find('euiToastHeader__title')).getVisibleText();

await this.testSubjects.click('toastCloseButton');
return title;
}

public async dismiss(): Promise<void> {
await this.testSubjects.click('toastCloseButton', 6 * this.defaultFindTimeout);
}

public async dismissAll(): Promise<void> {
const allToastElements = await this.getAll();

if (allToastElements.length === 0) return;

for (const toastElement of allToastElements) {
try {
await toastElement.moveMouseTo();
const closeBtn = await toastElement.findByTestSubject('toastCloseButton');
await closeBtn.click();
} catch (err) {
// ignore errors, toast clear themselves after timeout
}
}
}

public async dismissAllWithChecks(): Promise<void> {
await this.retry.tryForTime(30 * 1000, async (): Promise<void> => {
await this.dismissAll();
await this.assertCount(0);
});
}

public async assertCount(expectedCount: number): Promise<void> {
await this.retry.tryForTime(5 * 1000, async (): Promise<void> => {
const toastCount = await this.getCount({ timeout: 1000 });
expect(toastCount).to.eql(
expectedCount,
`Toast count should be ${expectedCount} (got ${toastCount})`
);
});
}

public async getElementByIndex(index: number): Promise<WebElementWrapper> {
return await (await this.getGlobalList()).findByCssSelector(`.euiToast:nth-child(${index})`);
}

public async getTitleByIndex(index: number): Promise<string> {
const resultToast = await this.getElementByIndex(index);
const titleElement = await this.testSubjects.findDescendant('euiToastHeader', resultToast);
const title: string = await titleElement.getVisibleText();
return title;
}

public async getContentByIndex(index: number): Promise<string> {
const elem = await this.getElementByIndex(index);
return await elem.getVisibleText();
}

public async getAll(): Promise<WebElementWrapper[]> {
const list = await this.getGlobalList();
return await list.findAllByCssSelector(`.euiToast`);
}

private async getGlobalList(options?: { timeout?: number }): Promise<WebElementWrapper> {
return await this.testSubjects.find('globalToastList', options?.timeout);
}

public async getCount(options?: { timeout?: number }): Promise<number> {
const list = await this.getGlobalList(options);
const toasts = await list.findAllByCssSelector(`.euiToast`, options?.timeout);
return toasts.length;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"@kbn/repo-info",
"@kbn/test-subj-selector",
"@kbn/ftr-common-functional-services",
"@kbn/std"
"@kbn/std",
"@kbn/expect"
]
}
2 changes: 1 addition & 1 deletion test/accessibility/apps/discover.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
});

await retry.try(async () => {
await toasts.dismissAllToasts();
await toasts.dismissAll();
});

await a11y.testAppSnapshot();
Expand Down
13 changes: 4 additions & 9 deletions test/examples/search/warnings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,12 @@
import type { estypes } from '@elastic/elasticsearch';
import expect from '@kbn/expect';
import assert from 'assert';
import type { WebElementWrapper } from '@kbn/ftr-common-functional-ui-services';
import type { FtrProviderContext } from '../../functional/ftr_provider_context';

// eslint-disable-next-line import/no-default-export
export default function ({ getService, getPageObjects }: FtrProviderContext) {
const PageObjects = getPageObjects(['common', 'timePicker']);
const testSubjects = getService('testSubjects');
const find = getService('find');
const retry = getService('retry');
const es = getService('es');
const log = getService('log');
Expand All @@ -25,6 +23,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
const kibanaServer = getService('kibanaServer');
const esArchiver = getService('esArchiver');
const monacoEditor = getService('monacoEditor');
const toasts = getService('toasts');

describe('handling warnings with search source fetch', function () {
const dataViewTitle = 'sample-01,sample-01-rollup';
Expand All @@ -34,7 +33,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
const testIndex = 'sample-01';
const testRollupIndex = 'sample-01-rollup';
const testRollupField = 'kubernetes.container.memory.usage.bytes';
const toastsSelector = '[data-test-subj=globalToastList] [data-test-subj=euiToastHeader]';
const shardFailureType = 'unsupported_aggregation_on_downsampled_index';
const shardFailureReason = `Field [${testRollupField}] of type [aggregate_metric_double] is not supported for aggregation [percentiles]`;

Expand Down Expand Up @@ -97,15 +95,14 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
});

afterEach(async () => {
await PageObjects.common.clearAllToasts();
await toasts.dismissAll();
});

it('should show search warnings as toasts', async () => {
await testSubjects.click('searchSourceWithOther');

await retry.try(async () => {
const toasts = await find.allByCssSelector(toastsSelector);
expect(toasts.length).to.be(2);
expect(await toasts.getCount()).to.be(2);
await testSubjects.click('viewWarningBtn');
});

Expand Down Expand Up @@ -152,10 +149,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await testSubjects.click('searchSourceWithoutOther');

// wait for toasts - toasts appear after the response is rendered
let toasts: WebElementWrapper[] = [];
await retry.try(async () => {
toasts = await find.allByCssSelector(toastsSelector);
expect(toasts.length).to.be(2);
expect(await toasts.getCount()).to.be(2);
});

// warnings tab
Expand Down
2 changes: 1 addition & 1 deletion test/functional/apps/console/_context_menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await PageObjects.console.clickContextMenu();
await PageObjects.console.clickCopyAsCurlButton();

const resultToast = await toasts.getToastElement(1);
const resultToast = await toasts.getElementByIndex(1);
const toastText = await resultToast.getVisibleText();

if (toastText.includes('Write permission denied')) {
Expand Down
2 changes: 1 addition & 1 deletion test/functional/apps/console/_text_input.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
});

await retry.try(async () => {
expect(await toasts.getToastCount()).to.equal(1);
expect(await toasts.getCount()).to.equal(1);
});
});
});
Expand Down
4 changes: 2 additions & 2 deletions test/functional/apps/dashboard/group3/bwc_shared_urls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
const query = await queryBar.getQueryString();
expect(query).to.equal('memory:>220000');

const warningToast = await toasts.getToastElement(1);
const warningToast = await toasts.getElementByIndex(1);
expect(await warningToast.getVisibleText()).to.contain('Cannot load panels');

await PageObjects.dashboard.waitForRenderComplete();
Expand All @@ -96,7 +96,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
const query = await queryBar.getQueryString();
expect(query).to.equal('memory:>220000');

const warningToast = await toasts.getToastElement(1);
const warningToast = await toasts.getElementByIndex(1);
expect(await warningToast.getVisibleText()).to.contain('Cannot load panels');
await PageObjects.dashboard.waitForRenderComplete();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export default function ({
const dashboardAddPanel = getService('dashboardAddPanel');
const testSubjects = getService('testSubjects');
const retry = getService('retry');
const toasts = getService('toasts');

describe('dashboard snapshots', function describeIndexTests() {
before(async function () {
Expand Down Expand Up @@ -58,7 +59,7 @@ export default function ({
await PageObjects.dashboard.clickNewDashboard();
await PageObjects.timePicker.setLogstashDataRange();
await dashboardAddPanel.addVisualization('Rendering Test: tsvb-ts');
await PageObjects.common.closeToastIfExists();
await toasts.dismissIfExists();

await PageObjects.dashboard.saveDashboard('tsvb');
await PageObjects.dashboard.clickFullScreenMode();
Expand All @@ -80,7 +81,7 @@ export default function ({
await PageObjects.dashboard.clickNewDashboard();
await PageObjects.timePicker.setLogstashDataRange();
await dashboardAddPanel.addVisualization('Rendering Test: area with not filter');
await PageObjects.common.closeToastIfExists();
await toasts.dismissIfExists();

await PageObjects.dashboard.saveDashboard('area');
await PageObjects.dashboard.clickFullScreenMode();
Expand Down
6 changes: 3 additions & 3 deletions test/functional/apps/discover/group1/_shared_links.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
expect(resolvedTime.start).to.equal(actualTime.start);
expect(resolvedTime.end).to.equal(actualTime.end);
});
await toasts.dismissAllToasts();
await toasts.dismissAll();
});

it("sharing hashed url shouldn't crash the app", async () => {
Expand All @@ -173,12 +173,12 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await browser.get(currentUrl, false);
const resolvedUrl = await browser.getCurrentUrl();
expect(resolvedUrl).to.match(/discover/);
const { title } = await toasts.getErrorToast(1, true);
const { title } = await toasts.getErrorByIndex(1, true);
expect(title).to.contain(
'Unable to completely restore the URL, be sure to use the share functionality.'
);
});
await toasts.dismissAllToasts();
await toasts.dismissAll();
});
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
).to.be(true);
}

expect(await toasts.getToastCount()).to.be(1);
await toasts.dismissAllToasts();
expect(await toasts.getCount()).to.be(1);
await toasts.dismissAll();

await dataGrid.clickCopyColumnValues('_source');

Expand All @@ -68,8 +68,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
expect(copiedSourceData.endsWith('}')).to.be(true);
}

expect(await toasts.getToastCount()).to.be(1);
await toasts.dismissAllToasts();
expect(await toasts.getCount()).to.be(1);
await toasts.dismissAll();
});

it('should be able to copy a column name to clipboard', async () => {
Expand All @@ -82,8 +82,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
expect(copiedTimestampName).to.be('@timestamp');
}

expect(await toasts.getToastCount()).to.be(1);
await toasts.dismissAllToasts();
expect(await toasts.getCount()).to.be(1);
await toasts.dismissAll();

await dataGrid.clickCopyColumnName('_source');

Expand All @@ -92,8 +92,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
expect(copiedSourceName).to.be('Document');
}

expect(await toasts.getToastCount()).to.be(1);
await toasts.dismissAllToasts();
expect(await toasts.getCount()).to.be(1);
await toasts.dismissAll();
});
});
}
4 changes: 2 additions & 2 deletions test/functional/apps/discover/group4/_adhoc_data_views.ts
Original file line number Diff line number Diff line change
Expand Up @@ -255,12 +255,12 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
const second = await PageObjects.discover.getCurrentDataViewId();
expect(first).not.equal(second);

await toasts.dismissAllToasts();
await toasts.dismissAll();

await browser.goBack();
await PageObjects.header.waitUntilLoadingHasFinished();

const [firstToast, secondToast] = await toasts.getAllToastElements();
const [firstToast, secondToast] = await toasts.getAll();

expect([await firstToast.getVisibleText(), await secondToast.getVisibleText()].sort()).to.eql(
[
Expand Down
Loading