fix flaky test - counts dashboard views (#197381)

## Summary

fix https://github.com/elastic/kibana/issues/192564

It might take a bit of time for the view count to update. So in the test
we will try to open the flyout again
This commit is contained in:
Anton Dosov 2024-10-24 15:27:04 +02:00 committed by GitHub
parent 7fa1e18516
commit 3684dedecb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -17,6 +17,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
const listingTable = getService('listingTable');
const dashboardAddPanel = getService('dashboardAddPanel');
const testSubjects = getService('testSubjects');
const retry = getService('retry');
// Failing: See https://github.com/elastic/kibana/issues/192564
describe.skip('dashboard listing page', function describeIndexTests() {
@ -272,8 +273,12 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await listingTable.clickItemLink('dashboard', DASHBOARD_NAME);
await dashboard.waitForRenderComplete();
await dashboard.gotoDashboardLandingPage();
const views2 = await getViewsCount();
expect(views2).to.be(2);
// it might take a bit for the view to be counted
await retry.try(async () => {
const views2 = await getViewsCount();
expect(views2).to.be(2);
});
});
});
});