mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
Backports the following commits to 6.4: - [pageObjects/dashboard] check that save is complete before resolving (#21892)
This commit is contained in:
parent
d14b6ae7d3
commit
124a351468
2 changed files with 20 additions and 8 deletions
|
@ -42,8 +42,7 @@ export default function ({ getPageObjects, getService }) {
|
|||
it('is saved', async () => {
|
||||
await PageObjects.dashboard.clickNewDashboard();
|
||||
await PageObjects.dashboard.addVisualizations([PageObjects.dashboard.getTestVisualizationNames()[0]]);
|
||||
const isDashboardSaved = await PageObjects.dashboard.saveDashboard(dashboardName, { storeTimeWithDashboard: false });
|
||||
expect(isDashboardSaved).to.eql(true);
|
||||
await PageObjects.dashboard.saveDashboard(dashboardName, { storeTimeWithDashboard: false });
|
||||
});
|
||||
|
||||
it('Does not set the time picker on open', async () => {
|
||||
|
@ -62,8 +61,7 @@ export default function ({ getPageObjects, getService }) {
|
|||
it('is saved with quick time', async function () {
|
||||
await PageObjects.dashboard.clickEdit();
|
||||
await PageObjects.header.setQuickTime('Today');
|
||||
const isDashboardSaved = await PageObjects.dashboard.saveDashboard(dashboardName, { storeTimeWithDashboard: true });
|
||||
expect(isDashboardSaved).to.eql(true);
|
||||
await PageObjects.dashboard.saveDashboard(dashboardName, { storeTimeWithDashboard: true });
|
||||
});
|
||||
|
||||
it('sets quick time on open', async function () {
|
||||
|
@ -78,8 +76,7 @@ export default function ({ getPageObjects, getService }) {
|
|||
it('is saved with absolute time', async function () {
|
||||
await PageObjects.dashboard.clickEdit();
|
||||
await PageObjects.header.setAbsoluteRange(fromTime, toTime);
|
||||
const isDashboardSaved = await PageObjects.dashboard.saveDashboard(dashboardName, { storeTimeWithDashboard: true });
|
||||
expect(isDashboardSaved).to.eql(true);
|
||||
await PageObjects.dashboard.saveDashboard(dashboardName, { storeTimeWithDashboard: true });
|
||||
});
|
||||
|
||||
it('sets absolute time on open', async function () {
|
||||
|
|
|
@ -286,6 +286,8 @@ export function DashboardPageProvider({ getService, getPageObjects }) {
|
|||
}
|
||||
|
||||
/**
|
||||
* Save the current dashboard with the specified name and options and
|
||||
* verify that the save was successful
|
||||
*
|
||||
* @param dashName {String}
|
||||
* @param saveOptions {{storeTimeWithDashboard: boolean, saveAsNew: boolean, needsConfirm: false}}
|
||||
|
@ -299,8 +301,21 @@ export function DashboardPageProvider({ getService, getPageObjects }) {
|
|||
|
||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
||||
|
||||
// Confirm that the Dashboard has been saved.
|
||||
return await testSubjects.exists('saveDashboardSuccess');
|
||||
// Confirm that the Dashboard has actually been saved
|
||||
if (!await testSubjects.exists('saveDashboardSuccess')) {
|
||||
throw new Error('Expected to find "saveDashboardSuccess" toast after saving dashboard');
|
||||
}
|
||||
|
||||
await this.waitForSaveModalToClose();
|
||||
}
|
||||
|
||||
async waitForSaveModalToClose() {
|
||||
log.debug('Waiting for dashboard save modal to close');
|
||||
await retry.try(async () => {
|
||||
if (await testSubjects.exists('dashboardSaveModal')) {
|
||||
throw new Error('dashboard save still open');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
async cancelSave() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue