Skip to content

Commit 2a83f1d

Browse files
authored
feat: add playwright e2e testing framework (vbenjs#4468)
* feat: add playwright e2e testing framework
1 parent 4b3d2d2 commit 2a83f1d

File tree

22 files changed

+345
-300
lines changed

22 files changed

+345
-300
lines changed

.gitpod.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ ports:
33
onOpen: open-preview
44
tasks:
55
- init: corepack enable && pnpm install
6-
command: pnpm run dev
6+
command: pnpm run dev:play

README.ja-JP.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,10 @@ pnpm build
133133

134134
<a style="display: block;width: 100px;height: 50px;line-height: 50px; color: #fff;text-align: center; background: #408aed;border-radius: 4px;" href="https://www.paypal.com/paypalme/cvvben">Paypal Me</a>
135135

136+
## スター歴史
137+
138+
[![Star History Chart](https://api.star-history.com/svg?repos=vbenjs/vue-vben-admin&type=Date)](https://star-history.com/#vbenjs/vue-vben-admin&Date)
139+
136140
## 貢献者
137141

138142
<a href="https://github.com/vbenjs/vue-vben-admin/graphs/contributors">

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,10 @@ If you think this project is helpful to you, you can help the author buy a cup o
132132

133133
<a style="display: block;width: 100px;height: 50px;line-height: 50px; color: #fff;text-align: center; background: #408aed;border-radius: 4px;" href="https://www.paypal.com/paypalme/cvvben">Paypal Me</a>
134134

135+
## Star History
136+
137+
[![Star History Chart](https://api.star-history.com/svg?repos=vbenjs/vue-vben-admin&type=Date)](https://star-history.com/#vbenjs/vue-vben-admin&Date)
138+
135139
## Contributor
136140

137141
<a href="https://github.com/vbenjs/vue-vben-admin/graphs/contributors">

README.zh-CN.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,10 @@ pnpm build
132132

133133
[CHANGELOG](https://github.com/vbenjs/vue-vben-admin/releases)
134134

135+
## Star History
136+
137+
[![Star History Chart](https://api.star-history.com/svg?repos=vbenjs/vue-vben-admin&type=Date)](https://star-history.com/#vbenjs/vue-vben-admin&Date)
138+
135139
## Contributor
136140

137141
<a href="https://github.com/vbenjs/vue-vben-admin/graphs/contributors">

docs/src/en/guide/essentials/development.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,6 @@ The execution command is: `pnpm run [script]` or `npm run [script]`.
4646
```json
4747
{
4848
"scripts": {
49-
// Install dependencies
50-
"bootstrap": "pnpm install",
5149
// Build the project
5250
"build": "cross-env NODE_OPTIONS=--max-old-space-size=8192 turbo build",
5351
// Build the project with analysis
@@ -107,9 +105,9 @@ The execution command is: `pnpm run [script]` or `npm run [script]`.
107105
// Package specification check
108106
"publint": "vsh publint",
109107
// Delete all node_modules, yarn.lock, package.lock.json, and reinstall dependencies
110-
"reinstall": "pnpm clean --del-lock && pnpm bootstrap",
108+
"reinstall": "pnpm clean --del-lock && pnpm install",
111109
// Run vitest unit tests
112-
"test:unit": "vitest",
110+
"test:unit": "vitest run --dom",
113111
// Update project dependencies
114112
"update:deps": " pnpm update --latest --recursive",
115113
// Changeset generation and versioning

docs/src/guide/essentials/development.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,6 @@ npm 脚本是项目常见的配置,用于执行一些常见的任务,比如
4646
```json
4747
{
4848
"scripts": {
49-
// 安装依赖
50-
"bootstrap": "pnpm install",
5149
// 构建项目
5250
"build": "cross-env NODE_OPTIONS=--max-old-space-size=8192 turbo build",
5351
// 构建项目并分析
@@ -107,9 +105,9 @@ npm 脚本是项目常见的配置,用于执行一些常见的任务,比如
107105
// 包规范检查
108106
"publint": "vsh publint",
109107
// 删除所有的node_modules、yarn.lock、package.lock.json,重新安装依赖
110-
"reinstall": "pnpm clean --del-lock && pnpm bootstrap",
108+
"reinstall": "pnpm clean --del-lock && pnpm install",
111109
// 运行 vitest 单元测试
112-
"test:unit": "vitest",
110+
"test:unit": "vitest run --dom",
113111
// 更新项目依赖
114112
"update:deps": " pnpm update --latest --recursive",
115113
// changeset生成提交集

internal/lint-configs/eslint-config/src/configs/node.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ export async function node(): Promise<Linter.Config[]> {
2424
'vite',
2525
'@vue/test-utils',
2626
'@vben/tailwind-config',
27+
'@playwright/test',
2728
],
2829
},
2930
],

internal/lint-configs/eslint-config/src/custom-config.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,14 @@ const customConfig: Linter.Config[] = [
134134
'unicorn/prefer-module': 'off',
135135
},
136136
},
137+
{
138+
files: ['**/**/playwright.config.ts'],
139+
rules: {
140+
'n/prefer-global/buffer': 'off',
141+
'n/prefer-global/process': 'off',
142+
'no-console': 'off',
143+
},
144+
},
137145
{
138146
files: ['internal/**/**'],
139147
rules: {

package.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,10 @@
2525
},
2626
"type": "module",
2727
"scripts": {
28-
"bootstrap": "pnpm install",
2928
"build": "cross-env NODE_OPTIONS=--max-old-space-size=8192 turbo build",
3029
"build:analyze": "turbo build:analyze",
31-
"build:docker": "./build-local-docker-image.sh",
3230
"build:antd": "pnpm run build --filter=@vben/web-antd",
31+
"build:docker": "./build-local-docker-image.sh",
3332
"build:docs": "pnpm run build --filter=@vben/docs",
3433
"build:ele": "pnpm run build --filter=@vben/web-ele",
3534
"build:naive": "pnpm run build --filter=@vben/web-naive",
@@ -55,15 +54,16 @@
5554
"prepare": "is-ci || husky",
5655
"preview": "turbo-run preview",
5756
"publint": "vsh publint",
58-
"reinstall": "pnpm clean --del-lock && pnpm bootstrap",
59-
"test:unit": "vitest",
57+
"reinstall": "pnpm clean --del-lock && pnpm install",
58+
"test:unit": "vitest run --dom",
59+
"test:e2e": "turbo run test:e2e",
6060
"update:deps": "pnpm update --latest --recursive",
6161
"version": "pnpm exec changeset version && pnpm install --no-frozen-lockfile"
6262
},
6363
"devDependencies": {
6464
"@changesets/changelog-github": "catalog:",
6565
"@changesets/cli": "catalog:",
66-
"@types/jsdom": "catalog:",
66+
"@playwright/test": "catalog:",
6767
"@types/node": "catalog:",
6868
"@vben/commitlint-config": "workspace:*",
6969
"@vben/eslint-config": "workspace:*",
@@ -80,10 +80,11 @@
8080
"autoprefixer": "catalog:",
8181
"cross-env": "catalog:",
8282
"cspell": "catalog:",
83+
"happy-dom": "catalog:",
8384
"husky": "catalog:",
8485
"is-ci": "catalog:",
85-
"jsdom": "catalog:",
8686
"lint-staged": "catalog:",
87+
"playwright": "catalog:",
8788
"rimraf": "catalog:",
8889
"tailwindcss": "catalog:",
8990
"turbo": "catalog:",
@@ -113,8 +114,7 @@
113114
},
114115
"neverBuiltDependencies": [
115116
"canvas",
116-
"node-gyp",
117-
"playwright"
117+
"node-gyp"
118118
]
119119
}
120120
}

packages/@core/ui-kit/shadcn-ui/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
{
22
"name": "@vben-core/shadcn-ui",
33
"version": "5.3.0",
4+
"#main": "./dist/index.mjs",
5+
"#module": "./dist/index.mjs",
46
"homepage": "https://github.com/vbenjs/vue-vben-admin",
57
"bugs": "https://github.com/vbenjs/vue-vben-admin/issues",
68
"repository": {
@@ -20,16 +22,14 @@
2022
"sideEffects": [
2123
"**/*.css"
2224
],
23-
"#main": "./dist/index.mjs",
2425
"main": "./src/index.ts",
25-
"#module": "./dist/index.mjs",
2626
"module": "./src/index.ts",
2727
"exports": {
2828
".": {
2929
"types": "./src/index.ts",
3030
"development": "./src/index.ts",
31-
"//default": "./dist/index.mjs",
32-
"default": "./src/index.ts"
31+
"default": "./src/index.ts",
32+
"//default": "./dist/index.mjs"
3333
}
3434
},
3535
"publishConfig": {

0 commit comments

Comments
 (0)