Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Dashboard] Fixes dashboard_save functional test #98830

Merged
merged 2 commits into from
May 17, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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