Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Playwright Tests

on:
workflow_dispatch:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
test:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install pnpm
uses: pnpm/action-setup@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: pnpm

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Install Playwright browsers
run: pnpm exec playwright install --with-deps

- name: Run Playwright tests
run: pnpm exec playwright test

- name: Upload Playwright report
if: ${{ !cancelled() }}
uses: actions/upload-artifact@v4
with:
name: playwright-report
path: playwright-report/
retention-days: 30
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
"dev": "vite",
"build": "tsc && vite build",
"preview": "vite preview",
"preinstall": "lefthook install"
"preinstall": "lefthook install",
"test": "playwright test",
"test:headed": "playwright test --headed"
},
"dependencies": {
"@ant-design/cssinjs": "^1.22.0",
Expand Down Expand Up @@ -75,7 +77,9 @@
"@commitlint/cli": "^17.8.1",
"@commitlint/config-conventional": "^17.8.1",
"@faker-js/faker": "^8.4.1",
"@playwright/test": "^1.62.1",
"@types/color": "^3.0.6",
"@types/node": "^26.1.2",
"@types/numeral": "^2.0.5",
"@types/ramda": "^0.29.12",
"@types/react": "^19.0.12",
Expand Down
27 changes: 27 additions & 0 deletions playwright.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import process from "node:process";
import { defineConfig, devices } from "@playwright/test";

export default defineConfig({
testDir: "./tests",
fullyParallel: true,
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 2 : 0,
workers: process.env.CI ? 1 : undefined,
reporter: "list",
use: {
baseURL: "http://127.0.0.1:3001",
trace: "on-first-retry",
},
webServer: {
command: "pnpm dev --host 127.0.0.1 --port 3001",
url: "http://127.0.0.1:3001",
reuseExistingServer: !process.env.CI,
timeout: 120000,
},
projects: [
{
name: "chromium",
use: { ...devices["Desktop Chrome"] },
},
],
});
Loading