Open kibanamachine opened 1 year ago
Pinging @elastic/kibana-presentation (Team:Presentation)
This is a strange one... it looks like it somehow missed the title input when typing it in, then tried to save?
This is a strange one... it looks like it somehow missed the title input when typing it in, then tried to save?
It is true that title input was not correctly entered, but there is an error in the retry logic. saveDashboard
has a retry wrapper around a block that calls enterDashboardTitleAndClickSave
. enterDashboardTitleAndClickSave
clicks dashboardSaveMenuItem
to open the save dialog. enterDashboardTitleAndClickSave
fails because save dialog is not closed, so retry wrapper calls enterDashboardTitleAndClickSave
again. This is where the test gets stuck because enterDashboardTitleAndClickSave
clicks dashboardSaveMenuItem
to open the save dialog (which is already open) and can not recover from this state. I can put up a PR to only click dashboardSaveMenuItem
if the save dialog is not already open.
Inlined code from dashboard_page to highlight where the problem is
public async saveDashboard(
dashboardName: string,
saveOptions: SaveDashboardOptions = { waitDialogIsClosed: true, exitFromEditMode: true },
clickMenuItem = true
) {
await this.retry.try(async () => {
await this.enterDashboardTitleAndClickSave(dashboardName, saveOptions, clickMenuItem);
if (saveOptions.needsConfirm) {
await this.ensureDuplicateTitleCallout();
await this.clickSave();
}
// Confirm that the Dashboard has actually been saved
await this.testSubjects.existOrFail('saveDashboardSuccess');
});
const message = await this.common.closeToast();
await this.header.waitUntilLoadingHasFinished();
await this.common.waitForSaveModalToClose();
const isInViewMode = await this.testSubjects.exists('dashboardEditMode');
if (saveOptions.exitFromEditMode && !isInViewMode) {
await this.clickCancelOutOfEditMode();
}
await this.header.waitUntilLoadingHasFinished();
return message;
}
public async enterDashboardTitleAndClickSave(
dashboardTitle: string,
saveOptions: SaveDashboardOptions = { waitDialogIsClosed: true },
clickMenuItem = true
) {
if (clickMenuItem) {
// This fails on retry since 'dashboardSaveMenuItem' is not clickable because the dialog is already open.
await this.testSubjects.click('dashboardSaveMenuItem');
}
const modalDialog = await this.testSubjects.find('savedObjectSaveModal');
this.log.debug('entering new title');
await this.testSubjects.setValue('savedObjectTitle', dashboardTitle);
if (saveOptions.storeTimeWithDashboard !== undefined) {
await this.setStoreTimeWithDashboard(saveOptions.storeTimeWithDashboard);
}
const saveAsNewCheckboxExists = await this.testSubjects.exists('saveAsNewCheckbox');
if (saveAsNewCheckboxExists) {
await this.setSaveAsNewCheckBox(Boolean(saveOptions.saveAsNew));
}
if (saveOptions.tags) {
await this.selectDashboardTags(saveOptions.tags);
}
await this.clickSave();
if (saveOptions.waitDialogIsClosed) {
await this.testSubjects.waitForDeleted(modalDialog);
}
}
New failure: CI Build - main
New failure: CI Build - main
New failure: CI Build - main
Ran the flaky test 100 times and it passed - it's also been awhile since this test last failed. Closing for now.
New failure: kibana-on-merge - 8.14
New failure: kibana-on-merge - main
New failure: kibana-on-merge - main
A test failed on a tracked branch
First failure: CI Build - main