Skip to content
Open
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
10 changes: 7 additions & 3 deletions flaky-tests/get-started/frameworks/playwright.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,19 @@ After correctly generating reports following the above steps, you'll be ready to

### Generating Reports

Playwright has multiple built-in reporters, including JUnit XML which Trunk can ingest. To get XML reports, add the following to your Playwright config:
Playwright has multiple built-in reporters, including JUnit XML, but we recommend using the [@trunkio/trunk-playwright-reporter](https://www.npmjs.com/package/@trunkio/trunk-playwright-reporter) reporter, which is purpose-built for Trunk and offers better integration. To get started, install the package from npm:

```
npm install @trunkio/trunk-playwright-reporter --save-dev
```

{% code title="playwright.config.ts" %}
```typescript
import { defineConfig } from '@playwright/test';

export default defineConfig({
reporter: [
['junit', { outputFile: 'junit.xml' }]
[['@trunkio/trunk-playwright-reporter']]
],
});
```
Expand All @@ -37,7 +41,7 @@ export default defineConfig({
Alternatively, you can specify reporting behavior inline in your CI:

```sh
npx playwright test --reporter=junit
npx playwright test --reporter=@trunkio/trunk-playwright-reporter
```

#### Report File Path
Expand Down
Loading