Skip to content

Playwright Tests

Playwright Tests #27

Workflow file for this run

name: Playwright Tests
on: workflow_dispatch
jobs:
Build:
runs-on: ubuntu-latest
outputs:
preview_url: ${{ steps.vercel-action.outputs.preview-url }}
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: 9
- name: Setting up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'pnpm'
- name: Install dependencies
run: pnpm install
- name: Building extension
run: pnpm build --filter=@bypass/extension
- name: Uploading extension
uses: actions/upload-artifact@v4
with:
name: extension-folder
path: ./apps/extension/build
- name: Deploy Preview (Vercel)
uses: amondnet/vercel-action@v25
id: vercel-action
with:
vercel-token: ${{ secrets.VERCEL_TOKEN }}
vercel-org-id: ${{ secrets.VERCEL_ORG_ID}}
vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID}}
github-comment: false
Playwright:
needs: [Build]
timeout-minutes: 10
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: 9
- name: Setting up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'pnpm'
- name: Cache playwright binaries
uses: actions/cache@v4
id: playwright-cache
with:
path: |
~/Library/Caches/ms-playwright
~/.cache/ms-playwright
${{ github.workspace }}/node_modules/playwright
key: cache-playwright-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: cache-playwright-
- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: extension-folder
path: ./apps/extension/build/
- name: Install dependencies
run: pnpm install
- name: Install Playwright Browsers
if: steps.playwright-cache.outputs.cache-hit != 'true'
run: npx playwright install --with-deps
- name: Run Playwright tests
run: xvfb-run --auto-servernum -- npx playwright test
env:
PLAYWRIGHT_TEST_BASE_URL: ${{ needs.Build.outputs.preview_url }}
- uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report
path: playwright-report/