Skip to content

Commit

Permalink
Stabilize dashboard render and filtering tests (elastic#30419)
Browse files Browse the repository at this point in the history
* Stabilize dashboard render test

* extend retry default timeout

* Track which visualizations aren’t completing their rendering if this test fails

* unskip test suite

* Make sure you don’t start clicking until the table finished loading after a search.

* Close toast after adding visualizations

* Unskip filtering tests too
  • Loading branch information
stacey-gammon authored Feb 12, 2019
1 parent 37915f0 commit e85bbf4
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/functional_test_runner/lib/config/schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export const schema = Joi.object().keys({

timeouts: Joi.object().keys({
find: Joi.number().default(10000),
try: Joi.number().default(40000),
try: Joi.number().default(120000),
waitFor: Joi.number().default(20000),
esRequestTimeout: Joi.number().default(30000),
kibanaStabilize: Joi.number().default(15000),
Expand Down
4 changes: 2 additions & 2 deletions test/functional/apps/dashboard/_dashboard_filtering.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export default function ({ getService, getPageObjects }) {
const dashboardPanelActions = getService('dashboardPanelActions');
const PageObjects = getPageObjects(['dashboard', 'header', 'visualize']);

describe.skip('dashboard filtering', async () => {
describe('dashboard filtering', async () => {
before(async () => {
await PageObjects.dashboard.gotoDashboardLandingPage();
});
Expand Down Expand Up @@ -181,7 +181,7 @@ export default function ({ getService, getPageObjects }) {
await pieChart.expectPieSliceCount(5);
});

it.skip('area, bar and heatmap charts', async () => {
it('area, bar and heatmap charts', async () => {
await dashboardExpect.seriesElementCount(3);
});

Expand Down
10 changes: 3 additions & 7 deletions test/functional/apps/dashboard/_embeddable_rendering.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,7 @@ export default function ({ getService, getPageObjects }) {
await dashboardExpect.vegaTextsDoNotExist(['5,000']);
};


// FLAKY: https://github.com/elastic/kibana/issues/28818
describe.skip('dashboard embeddable rendering', function describeIndexTests() {
describe('dashboard embeddable rendering', function describeIndexTests() {
before(async () => {
await PageObjects.dashboard.clickNewDashboard();

Expand All @@ -115,18 +113,16 @@ export default function ({ getService, getPageObjects }) {
await dashboardAddPanel.addVisualization('Filter Bytes Test: vega');

await PageObjects.header.waitUntilLoadingHasFinished();
await dashboardExpect.panelCount(27);
await PageObjects.dashboard.waitForRenderComplete();
const panelCount = await PageObjects.dashboard.getPanelCount();
expect(panelCount).to.be(27);
});

it('adding saved searches', async () => {
await dashboardAddPanel.addEverySavedSearch('"Rendering Test"');
await dashboardAddPanel.closeAddPanel();
await PageObjects.header.waitUntilLoadingHasFinished();
await dashboardExpect.panelCount(28);
await PageObjects.dashboard.waitForRenderComplete();
const panelCount = await PageObjects.dashboard.getPanelCount();
expect(panelCount).to.be(28);

await PageObjects.dashboard.saveDashboard('embeddable rendering test', { storeTimeWithDashboard: true });
});
Expand Down
3 changes: 2 additions & 1 deletion test/functional/services/dashboard/add_panel.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ export function DashboardAddPanelProvider({ getService, getPageObjects }) {
const embeddableRows = await addPanel.findAllByClassName('euiLink');
for (let i = 0; i < embeddableRows.length; i++) {
await embeddableRows[i].click();
await PageObjects.common.closeToast();
}
log.debug(`Added ${embeddableRows.length} embeddables`);
}
Expand Down Expand Up @@ -171,7 +172,7 @@ export function DashboardAddPanelProvider({ getService, getPageObjects }) {
// The search input field may be disabled while the table is loading so wait for it
await this.waitForEuiTableLoading();
await testSubjects.setValue('savedObjectFinderSearchInput', name);
await PageObjects.header.waitUntilLoadingHasFinished();
await this.waitForEuiTableLoading();
}

async panelAddLinkExists(name) {
Expand Down
10 changes: 9 additions & 1 deletion test/functional/services/renderable.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
*/

const RENDER_COMPLETE_SELECTOR = '[data-render-complete="true"]';
const RENDER_COMPLETE_PENDING_SELECTOR = '[data-render-complete="false"]';
const DATA_LOADING_SELECTOR = '[data-loading]';

export function RenderableProvider({ getService }) {
Expand All @@ -39,7 +40,14 @@ export function RenderableProvider({ getService }) {
await retry.try(async () => {
const completedElements = await find.allByCssSelector(RENDER_COMPLETE_SELECTOR);
if (completedElements.length < count) {
throw new Error(`${completedElements.length} elements completed rendering, waiting on a total of ${count}`);
const pendingElements = await find.allByCssSelector(RENDER_COMPLETE_PENDING_SELECTOR);
const pendingElementNames = [];
for (const pendingElement of pendingElements) {
const title = await pendingElement.getAttribute('data-title');
pendingElementNames.push(title);
}
throw new Error(`${completedElements.length} elements completed rendering, still waiting on a total of ${count}
specifically:\n${pendingElementNames.join('\n')}`);
}

const stillLoadingElements = await find.allByCssSelector(DATA_LOADING_SELECTOR, 1000);
Expand Down

0 comments on commit e85bbf4

Please sign in to comment.