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

Fix assertions against toasts in Dashboard and Discover functional tests. #16336

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
9 changes: 6 additions & 3 deletions test/functional/apps/dashboard/_dashboard_time.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ export default function ({ getPageObjects }) {
it('is saved', async function () {
await PageObjects.dashboard.clickNewDashboard();
await PageObjects.dashboard.addVisualizations([PageObjects.dashboard.getTestVisualizationNames()[0]]);
await PageObjects.dashboard.saveDashboard(dashboardName, { storeTimeWithDashboard: false });
const isDashboardSaved = await PageObjects.dashboard.saveDashboard(dashboardName, { storeTimeWithDashboard: false });
expect(isDashboardSaved).to.eql(true);
});

it('Does not set the time picker on open', async function () {
Expand All @@ -41,7 +42,8 @@ export default function ({ getPageObjects }) {
it('is saved with quick time', async function () {
await PageObjects.dashboard.clickEdit();
await PageObjects.header.setQuickTime('Today');
await PageObjects.dashboard.saveDashboard(dashboardName, { storeTimeWithDashboard: true });
const isDashboardSaved = await PageObjects.dashboard.saveDashboard(dashboardName, { storeTimeWithDashboard: true });
expect(isDashboardSaved).to.eql(true);
});

it('sets quick time on open', async function () {
Expand All @@ -56,7 +58,8 @@ export default function ({ getPageObjects }) {
it('is saved with absolute time', async function () {
await PageObjects.dashboard.clickEdit();
await PageObjects.header.setAbsoluteRange(fromTime, toTime);
await PageObjects.dashboard.saveDashboard(dashboardName, { storeTimeWithDashboard: true });
const isDashboardSaved = await PageObjects.dashboard.saveDashboard(dashboardName, { storeTimeWithDashboard: true });
expect(isDashboardSaved).to.eql(true);
});

it('sets absolute time on open', async function () {
Expand Down
3 changes: 2 additions & 1 deletion test/functional/apps/dashboard/_view_edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ export default function ({ getService, getPageObjects }) {
await PageObjects.dashboard.gotoDashboardLandingPage();
await PageObjects.dashboard.clickNewDashboard();
await PageObjects.dashboard.addVisualizations(PageObjects.dashboard.getTestVisualizationNames());
await PageObjects.dashboard.saveDashboard(dashboardName);
const isDashboardSaved = await PageObjects.dashboard.saveDashboard(dashboardName);
expect(isDashboardSaved).to.eql(true);
});

it('existing dashboard opens in view mode', async function () {
Expand Down
6 changes: 4 additions & 2 deletions test/functional/apps/discover/_shared_links.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ export default function ({ getService, getPageObjects }) {
});

it('gets copied to clipboard', async function () {
return await PageObjects.discover.clickCopyToClipboard();
const isCopiedToClipboard = await PageObjects.discover.clickCopyToClipboard();
expect(isCopiedToClipboard).to.eql(true);
});

// TODO: verify clipboard contents
Expand All @@ -98,7 +99,8 @@ export default function ({ getService, getPageObjects }) {

// NOTE: This test has to run immediately after the test above
it('copies short URL to clipboard', async function () {
return await PageObjects.discover.clickCopyToClipboard();
const isCopiedToClipboard = await PageObjects.discover.clickCopyToClipboard();
expect(isCopiedToClipboard).to.eql(true);
});
});
});
Expand Down
2 changes: 1 addition & 1 deletion test/functional/page_objects/discover_page.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ export function DiscoverPageProvider({ getService, getPageObjects }) {
}

async clickCopyToClipboard() {
testSubjects.click('sharedSnapshotCopyButton');
await testSubjects.click('sharedSnapshotCopyButton');

// Confirm that the content was copied to the clipboard.
return await testSubjects.exists('shareCopyToClipboardSuccess');
Expand Down