Skip to content

Commit

Permalink
feat: add BROWSER_SLOWMO env var to slow down execution for debugging…
Browse files Browse the repository at this point in the history
… (in ms)

Co-authored-by: Clay Chipps <[email protected]>
  • Loading branch information
amtrack and ClayChipps committed Jan 11, 2025
1 parent 89fdc7b commit dbd9cc0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -176,3 +176,4 @@ npm run test:e2e -- -g "AdminsCanLogInAsAnyUser" # will only run tests matching
```

> Note: You can run the e2e tests in non-headless mode (opening a browser) by setting the environment variable `BROWSER_DEBUG=true`.
> Note: You can also slow down the e2e test in non-headless mode by setting the environmnet variable, where the number is milliseconds of delay `BROWSER_SLOWMO=250`.
3 changes: 2 additions & 1 deletion src/browserforce.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ export class Browserforce {
// workaround for navigating frames https://github.com/puppeteer/puppeteer/issues/5123
'--disable-features=site-per-process'
],
headless: !(process.env.BROWSER_DEBUG === 'true')
headless: !(process.env.BROWSER_DEBUG === 'true'),
slowMo: parseInt(process.env.BROWSER_SLOWMO, 10) ?? 0
});
const page = await this.getNewPage();
try {
Expand Down

0 comments on commit dbd9cc0

Please sign in to comment.