test(e2e): add frontend smoke coverage

This commit is contained in:
2026-09-14 12:57:35 +08:00
parent 331ea3f094
commit 69ad145e75
12 changed files with 434 additions and 0 deletions
+63
View File
@@ -0,0 +1,63 @@
name: Frontend E2E
on:
pull_request:
push:
branches:
- main
- master
workflow_dispatch: {}
jobs:
playwright:
runs-on: ubuntu-22.04
container:
image: mcr.microsoft.com/playwright:v1.63.0-noble
permissions:
contents: read
defaults:
run:
shell: sh
steps:
- name: Checkout code
env:
SERVER_URL: ${{ github.server_url }}
REPOSITORY: ${{ github.repository }}
COMMIT_SHA: ${{ github.sha }}
GIT_USERNAME: ${{ github.actor }}
GIT_TOKEN: ${{ github.token }}
run: |
case "$SERVER_URL" in
http://*)
AUTH_SERVER_URL="http://${GIT_USERNAME}:${GIT_TOKEN}@${SERVER_URL#http://}"
;;
https://*)
AUTH_SERVER_URL="https://${GIT_USERNAME}:${GIT_TOKEN}@${SERVER_URL#https://}"
;;
*)
AUTH_SERVER_URL="$SERVER_URL"
;;
esac
if [ ! -d .git ]; then
git init .
fi
if git remote get-url origin >/dev/null 2>&1; then
git remote set-url origin "${AUTH_SERVER_URL}/${REPOSITORY}.git"
else
git remote add origin "${AUTH_SERVER_URL}/${REPOSITORY}.git"
fi
git fetch --depth=1 origin "$COMMIT_SHA"
git checkout --force --detach FETCH_HEAD
git clean -ffdx
- name: Install dependencies
run: npm ci
- name: Run Playwright tests
env:
CI: "true"
run: npm run test:e2e