Skip to content

Commit 3800a5f

Browse files
feat: adds playwright test suite
1 parent 5ac2960 commit 3800a5f

File tree

16 files changed

+4343
-3398
lines changed

16 files changed

+4343
-3398
lines changed

package.json

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,12 @@
2727
"publish": "node ./build/build.mjs --publish",
2828
"nuxt:dev": "nuxi dev build/nuxt-playground",
2929
"cypress:open": "cypress open",
30-
"cypress:server": "cd docs && npx vite --config=./vite.config.ts --port=5555"
30+
"cypress:server": "cd docs && npx vite --config=./vite.config.ts --port=5555",
31+
"playwright:install": "pnpm exec playwright install",
32+
"test:e2e": "playwright test",
33+
"test:e2e:headed": "playwright test --headed --project=chromium",
34+
"test:e2e:ui": "playwright test --ui",
35+
"test:e2e:leak": "LEAK_STRICT=1 playwright test -g memory --project=chromium"
3136
},
3237
"exports": {
3338
"./vue": {
@@ -84,6 +89,7 @@
8489
"chalk": "^5.3.0",
8590
"consola": "^3.2.3",
8691
"cypress": "^9.7.0",
92+
"@playwright/test": "^1.47.2",
8793
"execa": "^6.1.0",
8894
"jiti": "^1.21.6",
8995
"mlly": "^1.7.1",
@@ -105,5 +111,6 @@
105111
"vue": "^3.4.38",
106112
"vue-github-button": "^3.1.3",
107113
"vue-router": "^4.4.3"
108-
}
114+
},
115+
"packageManager": "[email protected]+sha512.ad27a79641b49c3e481a16a805baa71817a04bbe06a38d17e60e2eaee83f6a146c6a688125f5792e48dd5ba30e7da52a5cda4c3992b9ccf333f9ce223af84748"
109116
}

playwright-report/index.html

Lines changed: 77 additions & 0 deletions
Large diffs are not rendered by default.

playwright.config.ts

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
import { defineConfig, devices } from '@playwright/test'
2+
3+
export default defineConfig({
4+
testDir: './tests/e2e',
5+
fullyParallel: true,
6+
forbidOnly: !!process.env.CI,
7+
retries: process.env.CI ? 2 : 0,
8+
workers: process.env.CI ? 2 : undefined,
9+
reporter: [['list'], ['html', { open: 'never' }]],
10+
use: {
11+
baseURL: 'http://localhost:5173',
12+
trace: 'retain-on-failure',
13+
video: 'retain-on-failure',
14+
screenshot: 'only-on-failure',
15+
},
16+
webServer: {
17+
command: 'cd docs && vite --config=./vite.config.ts --port=5173',
18+
port: 5173,
19+
stdout: 'pipe',
20+
stderr: 'pipe',
21+
reuseExistingServer: !process.env.CI,
22+
timeout: 60 * 1000,
23+
},
24+
projects: [
25+
{
26+
name: 'chromium',
27+
use: { ...devices['Desktop Chrome'] },
28+
},
29+
{
30+
name: 'firefox',
31+
use: { ...devices['Desktop Firefox'] },
32+
},
33+
{
34+
name: 'webkit',
35+
use: { ...devices['Desktop Safari'] },
36+
},
37+
],
38+
})
39+
40+

0 commit comments

Comments
 (0)