browsertrix/.github/workflows/ui-tests-playwright.yml
Sara Tavares b61592b5ed
CI: Add Playwright UI e2e tests + CI (#614)
Adds Playwright for UI tests.
Basic Playwright test to login.
Playwright Github Action.

---------

Co-authored-by: sua yoo <sua@suayoo.com>
2023-03-22 16:23:22 -07:00

50 lines
1.4 KiB
YAML

name: Playwright Tests
on:
push:
branches: [ main ]
pull_request:
types: [opened, synchronize, reopened, edited]
jobs:
test:
timeout-minutes: 60
runs-on: ubuntu-latest
env:
DEV_PASSWORD: ${{ secrets.DEV_PASSWORD }}
API_BASE_URL: ${{ secrets.API_BASE_URL }}
working-directory: ./frontend
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: '16'
cache: 'yarn'
cache-dependency-path: frontend/yarn.lock
- name: Install dependencies
working-directory: frontend
run: yarn install --frozen-lockfile
- name: Install Playwright Browsers
run: yarn add playwright && yarn playwright install --with-deps
working-directory: ./frontend
- name: Create env file
run: |
cd frontend
touch .env
echo DEV_PASSWORD="${{ secrets.DEV_PASSWORD }}" >> .env
echo API_BASE_URL=${{ secrets.API_BASE_URL }} >> .env
cat .env
- name: Build frontend
run: cd frontend && yarn build
id: build-frontend
- name: Run Playwright tests
run: cd frontend && yarn playwright test
- uses: actions/upload-artifact@v2
if: always()
with:
name: playwright-report
path: frontend/playwright-report/
retention-days: 30