Skip to content

docs: initial readme on tests #11

docs: initial readme on tests

docs: initial readme on tests #11

Workflow file for this run

name: Playwright Tests
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: lts/*
- name: Cache node modules
uses: actions/cache@v4
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install dependencies
run: npm ci
- name: Install Playwright Browsers
run: npx playwright install --with-deps
- name: Create env file
run: |
echo "COOKIE_NAME=%realworldfront%" >> .env
echo "COOKIE_PASSWORD=${{ secrets.COOKIE_PASSWORD }}" >> .env
echo "BASE_URL=http://localhost:9001" >> .env
echo "NEXT_PUBLIC_RELATIVE_PATH=http://localhost:3000/api" >> .env
- name: Start App
run: npm run dev &
- name: Start Mockoon
run: |
npm install -g @mockoon/cli
mockoon-cli start --data ./mockoon/RealWorldApi.json --port 9001 &
- name: Run Playwright tests
run: npx playwright test
- name: Upload Playwright report
uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: playwright-report
path: playwright-report/
retention-days: 30