[Functional test] Add retry for dashboard save (#70950)

This commit is contained in:
Maja Grubic 2020-07-08 08:45:20 +01:00 committed by GitHub
parent ce1846511f
commit acd5da8b9d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -290,14 +290,16 @@ export function DashboardPageProvider({ getService, getPageObjects }: FtrProvide
dashboardName: string,
saveOptions: SaveDashboardOptions = { waitDialogIsClosed: true }
) {
await this.enterDashboardTitleAndClickSave(dashboardName, saveOptions);
await retry.try(async () => {
await this.enterDashboardTitleAndClickSave(dashboardName, saveOptions);
if (saveOptions.needsConfirm) {
await this.clickSave();
}
if (saveOptions.needsConfirm) {
await this.clickSave();
}
// Confirm that the Dashboard has actually been saved
await testSubjects.existOrFail('saveDashboardSuccess');
// Confirm that the Dashboard has actually been saved
await testSubjects.existOrFail('saveDashboardSuccess');
});
const message = await PageObjects.common.closeToast();
await PageObjects.header.waitUntilLoadingHasFinished();
await PageObjects.common.waitForSaveModalToClose();