Skip to content
This repository was archived by the owner on Sep 11, 2025. It is now read-only.
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
11 changes: 8 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,15 @@ test('should display correct browser', async () => {

### Notes

`playwright` actions can take some time for execution, because of it `jest-playwright` overrides jest default timeout interval from 5 to 15 seconds.
You can change this interval with [`testTimeout`](https://jestjs.io/docs/en/configuration#testtimeout-number) in your `jest` configuration.

## Configuration

It's recommend to use a separate Jest configuration `jest.e2e.config.js` for `jest-playwright` to gain speed improvements and by that to only use Playwright in the end-to-end tests. For that you have to use the `-c` flag when calling Jest and use the [`testMatch`](https://jestjs.io/docs/en/configuration#testmatch-arraystring) or [`testRegex`](https://jestjs.io/docs/en/configuration#testregex-string--arraystring) in your Jest config to split them.

Be sure to remove any existing `testEnvironment` option from your Jest configuration. The `jest-playwright-preset` preset needs to manage that option itself.

## Configuration

Configuration options can be specified using a `jest-playwright.config.js` file at the root of your project:

```js
Expand Down Expand Up @@ -238,7 +241,7 @@ All of them are available globally in each Jest test. If you are using ESLint an

Debugging tests can be hard sometimes and it is very useful to be able to pause tests in order to inspect the browser. There are two ways to put your tests in debug mode:

- Playwright give you [ability](https://playwright.dev/docs/debug/#run-in-debug-mode) to configure the browser for debugging with the `PWDEBUG` environment variable:
- Playwright give you [ability](https://playwright.dev/docs/debug/#run-in-debug-mode) to configure the browser for debugging with the `PWDEBUG` environment variable. It will launch the browser in headful mode and disables playwright timeout:
```js
PWDEBUG=1 jest
```
Expand All @@ -249,6 +252,8 @@ PWDEBUG=1 jest
await jestPlaywright.debug()
```

In these cases **Jest** won't timeout anymore.

## Reset helper functions

### Reset current page
Expand Down