Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions docs/contributors/testing-overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -387,22 +387,28 @@ or interactively
npm run test-e2e:watch
```

Sometimes it's useful to observe the browser while running tests. To do so you can use these environment variables:
Sometimes it's useful to observe the browser while running tests. Then, use this command:

```bash
PUPPETEER_HEADLESS=false PUPPETEER_SLOWMO=80 npm run test-e2e:watch
npm run test-e2e:watch -- --puppeteer-interactive
```

You can control the speed of execution with `--puppeteer-slowmo`:

```bash
npm run test-e2e:watch -- --puppeteer-interactive --puppeteer-slowmo=200
```

You can additionally have the devtools automatically open for interactive debugging in the browser:

```bash
PUPPETEER_HEADLESS=false PUPPETEER_DEVTOOLS=true npm run test-e2e:watch
npm run test-e2e:watch -- --puppeteer-devtools
```

If you're using a different setup, you can provide the base URL, username and password like this:

```bash
WP_BASE_URL=http://localhost:8888 WP_USERNAME=admin WP_PASSWORD=password npm run test-e2e
npm run test-e2e -- --wordpress-base-url=http://localhost:8888 --wordpress-username=admin --wordpress-password=password

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I completely forgot about that, thank you for bringing it up as well :)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So it was added in #14717 but it didn't touch this file.

```

If you find that end-to-end tests pass when run locally, but fail in Travis, you may be able to isolate a CPU- or netowrk-bound race condition by simulating a slow CPU or network:
Expand Down