diff --git a/docs/src/ci.md b/docs/src/ci.md index 0a8c950aa5..115e9af842 100644 --- a/docs/src/ci.md +++ b/docs/src/ci.md @@ -76,6 +76,36 @@ steps: We run [our tests](https://github.com/microsoft/playwright/blob/master/.github/workflows/tests_secondary.yml) on GitHub Actions, across a matrix of 3 platforms (Windows, Linux, macOS) and 3 browsers (Chromium, Firefox, WebKit). +### GitHub Actions on deployment + +This will start the tests after a [GitHub Deployment](https://developer.github.com/v3/repos/deployments/) went into the `success` state. +Services like Azure Static Web Apps, Netlify, Vercel, etc. use this pattern so you can run your end-to-end tests on their deployed enviornment. + +```yml +name: Playwright Tests +on: + deployment_status: +jobs: + test: + timeout-minutes: 60 + runs-on: ubuntu-latest + if: github.event.deployment_status.state == 'success' + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v2 + with: + node-version: '14.x' + - name: Install dependencies + run: npm ci + - name: Install Playwright + run: npx playwright install --with-deps + - name: Run Playwright tests + run: npm run test:e2e + env: + # This might depend on your test-runner/language binding + PLAYWRIGHT_TEST_BASE_URL: ${{ github.event.deployment_status.target_url }} +``` + ### Docker We have a [pre-built Docker image](./docker.md) which can either be used directly, or as a reference to update your existing Docker definitions.