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
This commit is contained in:
David 2019-07-18 15:36:03 +02:00 committed by GitHub
parent 2c8809d3cf
commit fb21492eae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 0 deletions

View File

@ -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')),
},
});

View File

@ -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);