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 {
Selector,
InputPageObjectType,
InputPageObject,
PageObject,
} from 'e2e-test/core/pageObjects';
import { TestPage } from 'e2e-test/core/pages';
export interface SaveDashboardModal {
name: InputPageObjectType;
save: ClickablePageObjectType;
success: PageObject;
}
export const saveDashboardModal = new TestPage<SaveDashboardModal>({
pageObjects: {
name: new InputPageObject(Selector.fromAriaLabel('Save dashboard title field')),
save: new ClickablePageObject(Selector.fromAriaLabel('Save dashboard button')),
success: new PageObject(Selector.fromSelector('.alert-success')),
},
});
......@@ -57,6 +57,7 @@ e2eScenario(
const dashboardTitle = new Date().toISOString();
await saveDashboardModal.pageObjects.name.enter(dashboardTitle);
await saveDashboardModal.pageObjects.save.click();
await saveDashboardModal.pageObjects.success.exists();
// Share the dashboard
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