Skip to content

Playwright Tests

Playwright Tests #196

Workflow file for this run

name: Playwright Tests
on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:
inputs:
environment:
type: choice
required: true
description: Environment
options:
- STAGING
env:
ENVIRONMENT: ${{ github.event.inputs.environment || 'STAGING' }}
jobs:
test:
timeout-minutes: 10
runs-on: ubuntu-latest
container:
image: mcr.microsoft.com/playwright:v1.45.3-jammy
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 20
- name: Install dependencies
run: npm ci
- name: Environment
run: |
echo "${ENVIRONMENT}"
- name: Run your tests
run: npx playwright test
env:
AUTH_TOKEN: ${{ secrets[format('{0}_TOKEN', env.ENVIRONMENT)] }}
BASE_URL: ${{ vars[format('{0}_BASE_URL', env.ENVIRONMENT)] }}
COOKIE_DOMAIN: ${{ vars[format('{0}_COOKIE_DOMAIN', env.ENVIRONMENT)] }}
ADMIN_URL: ${{ vars[format('{0}_ADMIN_URL', env.ENVIRONMENT)] }}
ADMIN_USERNAME: ${{ secrets[format('{0}_ADMIN_USERNAME', env.ENVIRONMENT)] }}
ADMIN_PASSWORD: ${{ secrets[format('{0}_ADMIN_PASSWORD', env.ENVIRONMENT)] }}
- uses: actions/upload-artifact@v3
if: always()
with:
name: playwright-report
path: playwright-report/
retention-days: 30