Add e2e test (#1656)

* test: add e2e test
This commit is contained in:
luzhuang
2023-12-21 18:03:08 +08:00
committed by GitHub
parent 6405eddb8e
commit 8200bfdd5e
43 changed files with 2488 additions and 40 deletions

View File

@@ -73,3 +73,53 @@ jobs:
- name: Upload coverage to Codecov
run: ./node_modules/.bin/codecov
- run: curl -s https://codecov.io/bash
e2e:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x]
steps:
- uses: actions/checkout@v3
with:
lfs: true
- name: Install pnpm
uses: pnpm/action-setup@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: pnpm
- name: Install dependencies
run: pnpm i
- name: Build
run: npm run build
- name: Run Cypress Tests
uses: cypress-io/github-action@v5
with:
start: npm run e2e:case
wait-on: 'http://localhost:5175'
wait-on-timeout: 120
browser: chrome
- name: Upload Diff
if: failure()
uses: actions/upload-artifact@v3
with:
name: cypress-diff
path: e2e/diff/
- name: Upload Origin
if: failure()
uses: actions/upload-artifact@v3
with:
name: cypress-origin
path: e2e/fixtures/originImage
- name: Upload Screenshots
if: failure()
uses: actions/upload-artifact@v3
with:
name: cypress-screenshots
path: e2e/screenshots/