[Uptime] Add timeout for slow process to skipped functional tests (#56065) (#56136)

* Reorder assertions in functional tests.

* Introduce retry to functional tests.
This commit is contained in:
Justin Kambic 2020-01-28 09:13:51 -07:00 committed by GitHub
parent 1c8d7aed8c
commit 67343f77b1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -7,9 +7,9 @@
import expect from '@kbn/expect';
import { FtrProviderContext } from '../../ftr_provider_context';
export default ({ getPageObjects }: FtrProviderContext) => {
// TODO: add UI functional tests
export default ({ getPageObjects, getService }: FtrProviderContext) => {
const pageObjects = getPageObjects(['uptime']);
const retry = getService('retry');
describe('overview page', function() {
const DEFAULT_DATE_START = 'Sep 10, 2019 @ 12:40:08.078';
@ -84,16 +84,18 @@ export default ({ getPageObjects }: FtrProviderContext) => {
]);
});
// Flakey, see https://github.com/elastic/kibana/issues/54541
describe.skip('snapshot counts', () => {
describe('snapshot counts', () => {
it('updates the snapshot count when status filter is set to down', async () => {
await pageObjects.uptime.goToUptimePageAndSetDateRange(
DEFAULT_DATE_START,
DEFAULT_DATE_END
);
await pageObjects.uptime.setStatusFilter('down');
const counts = await pageObjects.uptime.getSnapshotCount();
expect(counts).to.eql({ up: '0', down: '7' });
await retry.tryForTime(12000, async () => {
const counts = await pageObjects.uptime.getSnapshotCount();
expect(counts).to.eql({ up: '0', down: '7' });
});
});
it('updates the snapshot count when status filter is set to up', async () => {
@ -102,8 +104,10 @@ export default ({ getPageObjects }: FtrProviderContext) => {
DEFAULT_DATE_END
);
await pageObjects.uptime.setStatusFilter('up');
const counts = await pageObjects.uptime.getSnapshotCount();
expect(counts).to.eql({ up: '93', down: '0' });
await retry.tryForTime(12000, async () => {
const counts = await pageObjects.uptime.getSnapshotCount();
expect(counts).to.eql({ up: '93', down: '0' });
});
});
});
});