Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI: reduce puppeteer test time from 34s to 13s #421

Merged
merged 3 commits into from
Aug 3, 2023
Merged

Conversation

incognitojam
Copy link
Collaborator

@incognitojam incognitojam commented Aug 3, 2023

Replace all await sleep(...)s with correct Page.waitForSelector and other query selectors.

Before:

 PASS  src/__puppeteer__/offline.test.js (8.013 s)
 PASS  src/__puppeteer__/routing.test.js (22.464 s)
 PASS  src/__puppeteer__/demo.test.js (33.238 s)

After:

 PASS  src/__puppeteer__/offline.test.js (7.93 s)
 PASS  src/__puppeteer__/demo.test.js (8.148 s)
 PASS  src/__puppeteer__/routing.test.js (12.262 s)

Tests should also be less flaky now as the sleeps are not hard-coded for each test.


This is much faster to run locally, but GitHub actions still appears to be pretty slow :/

Replace all `await sleep(...)`s with correct Page.waitForSelector and
other query selectors

Before:

```
 PASS  src/__puppeteer__/offline.test.js (8.013 s)
 PASS  src/__puppeteer__/routing.test.js (22.464 s)
 PASS  src/__puppeteer__/demo.test.js (33.238 s)
```

After:

```
 PASS  src/__puppeteer__/offline.test.js (7.93 s)
 PASS  src/__puppeteer__/demo.test.js (8.148 s)
 PASS  src/__puppeteer__/routing.test.js (12.262 s)
```
@incognitojam incognitojam merged commit 0482bdf into master Aug 3, 2023
4 checks passed
@incognitojam incognitojam deleted the improve-tests branch August 3, 2023 13:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant