Skip to content

Commit

Permalink
Fixed dashboard_save functional test
Browse files Browse the repository at this point in the history
  • Loading branch information
cqliu1 committed Apr 29, 2021
1 parent 18213b6 commit 5e4acf4
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
9 changes: 6 additions & 3 deletions test/functional/apps/dashboard/dashboard_save.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
import { FtrProviderContext } from '../../ftr_provider_context';

export default function ({ getService, getPageObjects }: FtrProviderContext) {
const PageObjects = getPageObjects(['dashboard', 'header']);
const PageObjects = getPageObjects(['dashboard', 'header', 'visualize']);
const listingTable = getService('listingTable');
const testSubjects = getService('testSubjects');
const dashboardAddPanel = getService('dashboardAddPanel');

// FLAKY: https://github.com/elastic/kibana/issues/89476
describe.skip('dashboard save', function describeIndexTests() {
describe('dashboard save', function describeIndexTests() {
this.tags('includeFirefox');
const dashboardName = 'Dashboard Save Test';
const dashboardNameEnterKey = 'Dashboard Save Test with Enter Key';
Expand Down Expand Up @@ -127,6 +127,9 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {

await PageObjects.dashboard.switchToEditMode();
await PageObjects.dashboard.expectExistsQuickSaveOption();
await dashboardAddPanel.clickMarkdownQuickButton();
await PageObjects.visualize.saveVisualizationAndReturn();
await PageObjects.dashboard.waitForRenderComplete();
await PageObjects.dashboard.clickQuickSave();

await testSubjects.existOrFail('saveDashboardSuccess');
Expand Down
10 changes: 10 additions & 0 deletions test/functional/page_objects/dashboard_page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,7 @@ export function DashboardPageProvider({ getService, getPageObjects }: FtrProvide
}

public async clickQuickSave() {
await this.expectQuickSaveButtonEnabled();
log.debug('clickQuickSave');
await testSubjects.click('dashboardQuickSaveMenuItem');
}
Expand Down Expand Up @@ -624,6 +625,15 @@ export function DashboardPageProvider({ getService, getPageObjects }: FtrProvide
await testSubjects.existOrFail('dashboardQuickSaveMenuItem');
}

public async expectQuickSaveButtonEnabled() {
log.debug('expectQuickSaveButtonEnabled');
const quickSaveButton = await testSubjects.find('dashboardQuickSaveMenuItem');
const isDisabled = await quickSaveButton.getAttribute('disabled');
if (isDisabled) {
throw new Error('Quick save button disabled');
}
}

public async getNotLoadedVisualizations(vizList: string[]) {
const checkList = [];
for (const name of vizList) {
Expand Down

0 comments on commit 5e4acf4

Please sign in to comment.