# Get started > Playwright e2e

# Playwright E2E testing

## Overview

Your existing Playwright E2E test suite can be integrated with Artillery Cloud to provide a reporting dashboard, and tools for debugging and collaboration for your Playwright E2E tests:

* A central dashboard for your team's Playwright test reports
* Real-time streaming of test results – this is useful for monitoring large test suites as they're running in CI
* Automatic tracking of [Web Vitals](https://web.dev/articles/vitals) metrics for all pages in your tests
* GitHub Actions integration with PR comments
* AI-assisted analysis & debugging
* Shareable URLs
* Notes & comments on test results

![Artillery Cloud Playwright Reporter](/img/playwright-reporter@2x.png)

## Getting Started

The Artillery Playwright reporter is a standard Playwright Test Runner [reporter](https://playwright.dev/docs/test-reporters) which sends test results to Artillery Cloud. You need to install it as a dependency in your Playwright project, and enable it it your Playwright config file.

### Install Artillery Playwright Reporter

```sh npm2yarn
npm install -D @artilleryio/playwright-reporter
```

### Enable the reporter

Enable the reporter in your Playwright config:

```ts filename="playwright.config.ts" {3}
export default defineConfig({
  reporter: [
    ['@artilleryio/playwright-reporter', { name: 'My Test Suite' }],
  ],
  // ... rest of your config
});
```

### Set your Artillery Cloud API key

Sign up for Artillery Cloud and [create an API key](https://app.artillery.io/settings/api-keys), and then export it as `ARTILLERY_CLOUD_API_KEY`:

```sh
export ARTILLERY_CLOUD_API_KEY=YOUR_API_KEY
```

### Run your Playwright tests

Run your Playwright test suite as normal, e.g. with:

```sh
npx playwright test
```

When the test starts the reporter will print the URL of the test run to the console. The URL will look like this:

```
https://app.artillery.io/orgidkdowwbwpjiyxn/playwright/pwzxhq_abcdefabcdefghi_7atf
```

The report will be updated in real time as the test is running.

## Web Vitals

![Web Vitals reporting for Playwright E2E tests](/img/playwright-reporter/web-vitals@2x.png)

You can configure your tests to track & report [Web Vitals](https://web.dev/articles/vitals) automatically for every page in your tests (LCP, CLS, FCP, TTFB, and INP).

To enable performance tracking, use the `withPerformanceTracking()` method to extend Playwright's built-in test function:

```ts
// Rename the "test" import from @playwright/test to "base":

// Import the withPerformanceTracking function:

// Extend the base test function with performance tracking. This
// needs to be at the top before using test()
const test = withPerformanceTracking(base);

// The rest of your tests remain the same, e.g.:

test('has title', async ({ page }) => {
  await page.goto('https://playwright.dev/');
  await expect(page).toHaveTitle(/Playwright/);
});
```

## GitHub Actions

When the reporter is used in a GitHub Actions workflow, it can post comments to the PR with the test results. To enable PR comments, set `GITHUB_TOKEN` environment variable in your GitHub Actions job that runs Playwright tests:

```yaml
jobs:
  test:
    steps:
      - uses: actions/checkout@v4
        with:
          fetch-depth: 0

      - name: Setup Node.js
        uses: actions/setup-node@v4
        with:
          node-version: '22'
          cache: 'npm'

      - name: Run Playwright tests
        env:
          ARTILLERY_CLOUD_API_KEY: "${{ secrets.ARTILLERY_CLOUD_API_KEY }}" # API key to send results to Artillery Cloud
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Enable PR comments
        run: npx playwright test
```

If the test suite runs multiple times, the comment will be updated with the link to each run, and its results.

![Artillery Cloud Playwright reporter GitHub Actions integration](/img/playwright-reporter-github-actions.png)

## Share URLs

When you need to share a test report with someone who's not a member of your Artillery Cloud workspace, you can generate a share URL via **Share** -> **Share test publicly** on the report page.

Anyone with the link will be able to see the report. Share URLs are not crawled by Google or other search engines by default, but if the link is posted on the public internet it may get crawled. Playwright test reports may contain sensitive information so only share them with trusted parties.

Share URLs can be disabled again at any time via **Share** dialog.

## Current limitations

* **Sharded mode** - Playwright test suites running in sharded mode are not fully supported yet. Each run will produce multiple partial reports in Artillery Cloud, one per shard.
