Commit fb21492e by David Committed by GitHub

E2E: saving a dashboard should wait for success (#18171)

- navigating right away triggered the unsaved warning on slower machines
- this change makes sure we see a success message first
parent 2c8809d3
...@@ -4,17 +4,20 @@ import { ...@@ -4,17 +4,20 @@ import {
Selector, Selector,
InputPageObjectType, InputPageObjectType,
InputPageObject, InputPageObject,
PageObject,
} from 'e2e-test/core/pageObjects'; } from 'e2e-test/core/pageObjects';
import { TestPage } from 'e2e-test/core/pages'; import { TestPage } from 'e2e-test/core/pages';
export interface SaveDashboardModal { export interface SaveDashboardModal {
name: InputPageObjectType; name: InputPageObjectType;
save: ClickablePageObjectType; save: ClickablePageObjectType;
success: PageObject;
} }
export const saveDashboardModal = new TestPage<SaveDashboardModal>({ export const saveDashboardModal = new TestPage<SaveDashboardModal>({
pageObjects: { pageObjects: {
name: new InputPageObject(Selector.fromAriaLabel('Save dashboard title field')), name: new InputPageObject(Selector.fromAriaLabel('Save dashboard title field')),
save: new ClickablePageObject(Selector.fromAriaLabel('Save dashboard button')), save: new ClickablePageObject(Selector.fromAriaLabel('Save dashboard button')),
success: new PageObject(Selector.fromSelector('.alert-success')),
}, },
}); });
...@@ -57,6 +57,7 @@ e2eScenario( ...@@ -57,6 +57,7 @@ e2eScenario(
const dashboardTitle = new Date().toISOString(); const dashboardTitle = new Date().toISOString();
await saveDashboardModal.pageObjects.name.enter(dashboardTitle); await saveDashboardModal.pageObjects.name.enter(dashboardTitle);
await saveDashboardModal.pageObjects.save.click(); await saveDashboardModal.pageObjects.save.click();
await saveDashboardModal.pageObjects.success.exists();
// Share the dashboard // Share the dashboard
const dashboardsPage = dashboardsPageFactory(dashboardTitle); const dashboardsPage = dashboardsPageFactory(dashboardTitle);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment