Skip to content

Commit

Permalink
Add a retry to dashboard test for a sometimes slow async operation (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
brianseeders committed Mar 10, 2020
1 parent 6e08471 commit 70fa098
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions test/functional/apps/dashboard/dashboard_query_bar.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export default function({ getService, getPageObjects }) {
const kibanaServer = getService('kibanaServer');
const pieChart = getService('pieChart');
const queryBar = getService('queryBar');
const retry = getService('retry');
const PageObjects = getPageObjects(['common', 'dashboard', 'discover']);

describe('dashboard query bar', () => {
Expand All @@ -41,10 +42,11 @@ export default function({ getService, getPageObjects }) {
await esArchiver.unload('dashboard/current/data');

await queryBar.clickQuerySubmitButton();
const headers = await PageObjects.discover.getColumnHeaders();
expect(headers.length).to.be(0);

await pieChart.expectPieSliceCount(0);
await retry.tryForTime(5000, async () => {
const headers = await PageObjects.discover.getColumnHeaders();
expect(headers.length).to.be(0);
await pieChart.expectPieSliceCount(0);
});
});
});
}

0 comments on commit 70fa098

Please sign in to comment.