Skip to content

Commit

Permalink
chore: replace Cypress with Playwright
Browse files Browse the repository at this point in the history
  • Loading branch information
razonyang committed May 26, 2024
1 parent b85e4f5 commit ecd8f92
Show file tree
Hide file tree
Showing 9 changed files with 206 additions and 1,795 deletions.
42 changes: 19 additions & 23 deletions .github/workflows/tests.yml → .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
@@ -1,51 +1,47 @@
name: Tests

on: push

name: Playwright Tests
on:
push:
jobs:
build:
test:
strategy:
matrix:
version:
- latest
case: [default]
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- run: sudo apt-get install libgtk2.0-0 libgtk-3-0 libgbm-dev libnotify-dev libnss3 libxss1 libasound2 libxtst6 xauth xvfb

- name: Setup Node.js
uses: actions/setup-node@v4
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20

node-version: lts/*
- name: Setup caches
uses: actions/cache@v4
with:
path: /home/runner/.cache/hugo_cache
key: ${{ runner.os }}-hugomod-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-hugomod-${{ hashFiles('**/go.sum') }}
- name: Setup Go
uses: actions/setup-go@v5

- name: Setup Hugo
uses: peaceiris/actions-hugo@v3
with:
hugo-version: ${{ matrix.version }}
extended: true

- name: Install dependencies
working-directory: tests/${{ matrix.case }}
run: npm ci

- name: Start Hugo server
- name: Install Playwright Browsers
working-directory: tests/${{ matrix.case }}
run: hugo server &

- name: Cypress run
run: npx playwright install --with-deps
- name: Run Playwright tests
working-directory: tests/${{ matrix.case }}
run: npx cypress run
run: npx playwright test
- uses: actions/upload-artifact@v4
working-directory: tests/${{ matrix.case }}
if: always()
with:
name: playwright-report
path: playwright-report/
retention-days: 30
5 changes: 5 additions & 0 deletions tests/default/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
node_modules/
/test-results/
/playwright-report/
/blob-report/
/playwright/.cache/
32 changes: 0 additions & 32 deletions tests/default/cypress/e2e/home.cy.ts

This file was deleted.

Empty file.
1 change: 0 additions & 1 deletion tests/default/cypress/support/e2e.ts

This file was deleted.

Loading

0 comments on commit ecd8f92

Please sign in to comment.