Skip to content

Commit

Permalink
[Dashboard] Fixes dashboard_save functional test (#98830) (#100227)
Browse files Browse the repository at this point in the history
Co-authored-by: Kibana Machine <[email protected]>

Co-authored-by: Kibana Machine <[email protected]>
  • Loading branch information
cqliu1 and kibanamachine authored May 17, 2021
1 parent 2bb2fc2 commit 3124344
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 @@ -277,6 +277,7 @@ export function DashboardPageProvider({ getService, getPageObjects }: FtrProvide
}

public async clickQuickSave() {
await this.expectQuickSaveButtonEnabled();
log.debug('clickQuickSave');
await testSubjects.click('dashboardQuickSaveMenuItem');
}
Expand Down Expand Up @@ -630,6 +631,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 3124344

Please sign in to comment.