Skip to content

Commit

Permalink
docs: update information about playwright test runner
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe committed Mar 19, 2024
1 parent cbf4d54 commit 8e635fd
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions docs/1.getting-started/11.testing.md
Expand Up @@ -16,7 +16,7 @@ In order to allow you to manage your other testing dependencies, `@nuxt/test-uti

- you can choose between `happy-dom` and `jsdom` for a runtime Nuxt environment
- you can choose between `vitest`, `cucumber`, `jest` and `playwright` for end-to-end test runners
- `playwright-core` is only required if you wish to use the built-in browser testing utilities
- `playwright-core` is only required if you wish to use the built-in browser testing utilities (and are not using `@playwright/test` as your test runner)

::code-group
```bash [yarn]
Expand Down Expand Up @@ -388,7 +388,7 @@ await setup({

## End-To-End Testing

For end-to-end testing, we support [Vitest](https://github.com/vitest-dev/vitest) and [Jest](https://jestjs.io) as test runners.
For end-to-end testing, we support [Vitest](https://github.com/vitest-dev/vitest), [Jest](https://jestjs.io), [Cucumber](https://cucumber.io/) and [Playwright](https://playwright.dev/) as test runners.

### Setup

Expand Down Expand Up @@ -493,11 +493,11 @@ const pageUrl = url('/page')

### Testing in a Browser

We provide built-in support using Playwright within `@nuxt/test-utils`, but you can also use other test runners for end-to-end browser testing.
We provide built-in support using Playwright within `@nuxt/test-utils`, either programmatically or via the Playwright test runner.

#### `createPage(url)`

You can create a configured Playwright browser instance, and (optionally) point it at a path from the running server. You can find out more about the API methods available from [in the Playwright documentation](https://playwright.dev/docs/api/class-page).
Within `vitest`, `jest` or `cucumber`, you can create a configured Playwright browser instance with `createPage`, and (optionally) point it at a path from the running server. You can find out more about the API methods available from [in the Playwright documentation](https://playwright.dev/docs/api/class-page).

```ts twoslash
import { createPage } from '@nuxt/test-utils/e2e'
Expand All @@ -508,7 +508,7 @@ const page = await createPage('/page')

#### Testing with Playwright Test Runner

We provide first-class support for using `@nuxt/test-utils` within a Playwright test runner.
We also provide first-class support for using `@nuxt/test-utils` within [the Playwright test runner](https://playwright.dev/docs/intro).

You can provide global Nuxt configuration, with the same configuration details as the `setup()` function mentioned earlier in this section.

Expand Down

0 comments on commit 8e635fd

Please sign in to comment.