From d518c08ad209aefe6648e134621bca1ec3ef7194 Mon Sep 17 00:00:00 2001 From: Eoghan Murray Date: Wed, 20 Jan 2021 15:34:29 +0000 Subject: [PATCH] Tweaks to timings to get tests passing on my dev laptop (#466) * Tweaks to timings to get tests passing on my dev laptop - hopefully this makes tests more deterministic * Okay understand what's going on now that the test has run in the travis environment --- test/record.test.ts | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/test/record.test.ts b/test/record.test.ts index 61121b2e29..fb6a3f799b 100644 --- a/test/record.test.ts +++ b/test/record.test.ts @@ -33,6 +33,8 @@ interface IWindow extends Window { } describe('record', function (this: ISuite) { + this.timeout(10_000); + before(async () => { this.browser = await launchPuppeteer(); @@ -138,11 +140,12 @@ describe('record', function (this: ISuite) { while (count--) { await this.page.type('input', 'a'); } - await this.page.waitFor(500); - expect(this.events.length).to.equal(33); + await this.page.waitFor(300); + expect(this.events.length).to.equal(33); // before first automatic snapshot + await this.page.waitFor(200); // could be 33 or 35 events by now depending on speed of test env await this.page.type('input', 'a'); await this.page.waitFor(10); - expect(this.events.length).to.equal(36); + expect(this.events.length).to.equal(36); // additionally includes the 2 checkout events expect( this.events.filter( (event: eventWithTime) => event.type === EventType.Meta, @@ -223,7 +226,7 @@ describe('record', function (this: ISuite) { styleSheet.insertRule('body { color: #ccc; }'); }, 10); }); - await this.page.waitFor(10); + await this.page.waitFor(50); const styleSheetRuleEvents = this.events.filter( (e) => e.type === EventType.IncrementalSnapshot &&