Skip to content

Commit 5b9ecd2

Browse files
committed
add(test) ui initial config
1 parent 192a4d5 commit 5b9ecd2

File tree

6 files changed

+573
-1
lines changed

6 files changed

+573
-1
lines changed

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,11 @@ config.js
55
coverage
66
dist
77
**/.vite
8+
9+
# Playwright
10+
node_modules/
11+
/test-results/
12+
/playwright-report/
13+
/blob-report/
14+
/playwright/.cache/
15+
/playwright/.auth/

package-lock.json

Lines changed: 82 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,12 @@
88
"scripts": {
99
"dev": "vite",
1010
"build": "vite build",
11-
"preview": "vite preview"
11+
"preview": "vite preview",
12+
"test": "playwright test"
1213
},
1314
"devDependencies": {
15+
"@playwright/test": "^1.55.1",
16+
"@types/node": "^24.6.0",
1417
"@types/react": "^18.3.3",
1518
"@types/react-dom": "^18.3.0",
1619
"autoprefixer": "^10.4.19",

playwright.config.ts

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
import { defineConfig, devices } from "@playwright/test";
2+
3+
export default defineConfig({
4+
testDir: "./tests",
5+
fullyParallel: true,
6+
forbidOnly: !!process.env.CI,
7+
retries: process.env.CI ? 2 : 0,
8+
workers: process.env.CI ? 1 : undefined,
9+
reporter: "html",
10+
timeout: 5000,
11+
use: {
12+
baseURL: "http://localhost:5173",
13+
trace: "on-first-retry",
14+
},
15+
16+
/* Configure projects for major browsers */
17+
projects: [
18+
{
19+
name: "chromium",
20+
use: {
21+
...devices["Desktop Chrome"],
22+
viewport: { width: 800, height: 600 },
23+
},
24+
},
25+
],
26+
27+
/* Run your local dev server before starting the tests */
28+
webServer: {
29+
command: "npm run dev",
30+
url: "http://localhost:5173",
31+
reuseExistingServer: !process.env.CI,
32+
timeout: 5000,
33+
},
34+
});

0 commit comments

Comments
 (0)