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

Speed up dashboard add panel #22278

Merged
merged 13 commits into from
Aug 23, 2018
9 changes: 5 additions & 4 deletions test/functional/services/dashboard/add_panel.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export function DashboardAddPanelProvider({ getService, getPageObjects }) {
const testSubjects = getService('testSubjects');
const flyout = getService('flyout');
const PageObjects = getPageObjects(['header', 'common']);
const find = getService('find');

return new class DashboardAddPanel {
async clickOpenAddPanel() {
Expand Down Expand Up @@ -94,8 +95,10 @@ export function DashboardAddPanelProvider({ getService, getPageObjects }) {
}

async waitForEuiTableLoading() {
const addPanel = await testSubjects.find('dashboardAddPanel');
await addPanel.waitForDeletedByClassName('euiBasicTable-loading');
await retry.waitFor('dashboard add panel loading to complete', async () => {
const table = await find.byClassName('euiBasicTable');
return !((await table.getAttribute('class')).includes('loading'));
});
}

async closeAddPanel() {
Expand Down Expand Up @@ -169,8 +172,6 @@ export function DashboardAddPanelProvider({ getService, getPageObjects }) {
async addVisualization(vizName) {
log.debug(`DashboardAddPanel.addVisualization(${vizName})`);
await this.ensureAddPanelIsShowing();
// workaround for timing issue with slideout animation
await PageObjects.common.sleep(500);
await this.filterEmbeddableNames(`"${vizName.replace('-', ' ')}"`);
await testSubjects.click(`addPanel${vizName.split(' ').join('-')}`);
await this.closeAddPanel();
Expand Down
7 changes: 7 additions & 0 deletions test/functional/services/find.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,13 @@ export function FindProvider({ getService }) {
});
}

async byClassName(selector, timeout = defaultFindTimeout) {
log.debug(`findByCssSelector ${selector}`);
return await this._ensureElementWithTimeout(timeout, async remote => {
return await remote.findByClassName(selector);
});
}

async setValue(selector, text) {
return await retry.try(async () => {
const element = await this.byCssSelector(selector);
Expand Down