Skip to content

Commit

Permalink
refactor(test): switch e2e to @playwright/test (#1983)
Browse files Browse the repository at this point in the history
* chore: update eslint deps
* chore: install missing dependencies
* fix: eslint es module error
* fix: move eslint-plugin-jsx-ally to devDeps
* refactor(test): switch e2e to @playwright/test

This removes deprecated jest-playwright which caused issues with latest
dependencies.

E2E are now pure playwright, which reduces the surface for bugs
and should be more stable and easier to maintain in general.

Co-authored-by: Marcin Rataj <[email protected]>
  • Loading branch information
SgtPooki and lidel authored Jul 25, 2022
1 parent 829450d commit c40f0a1
Show file tree
Hide file tree
Showing 37 changed files with 5,131 additions and 10,797 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@

# testing
/coverage
/playwright-report
test/e2e/setup/ipfs-backend.json
test/e2e/state.json

# production
/build
Expand Down
20 changes: 4 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ Make sure `npm run build` is run before starting E2E tests:

```sh
> npm run build
> npm run test:e2e # end-to-end smoke tests (fast, headless, use go-ipfs)
> npm run test:e2e # end-to-end smoke tests (fast, headless, use Kubo (go-ipfs))
```

### Customizing E2E Tests
Expand Down Expand Up @@ -209,26 +209,14 @@ By default, the test run headless, so you won't see the browser. To debug test e
To disable headless mode and see the browser, set the environment variable `DEBUG=true`:

```sh
> DEBUG=true npm run test:e2e # e2e in slowed down mode in a browser window
> DEBUG=true npm run test:e2e
```

#### Breakpoints

It is possible to set a "breakpoint" via `await jestPuppeteer.debug()` to stop tests at a specific line:
It is possible to set a "breakpoint" via `await page.pause()` to stop tests at a specific line.

```js
jest.setTimeout(600000) // increase test suite timeout
await jestPuppeteer.debug() // puppeteer will pause here
```

In a **continuous integration** environment we lint the code, run the unit tests, build the app, start an http server and run the unit e2e tests:

```sh
> npm run lint
> npm test
> npm run build
> npm run test:e2e
```
Read more at <https://playwright.dev/docs/debug#using-pagepause>

## Coverage

Expand Down
Loading

0 comments on commit c40f0a1

Please sign in to comment.