1 parent
040504774d
commit
18bcdbeb00
8 files changed
+72
-6
No files matched your search
@@ -63,6 +63,14 @@ pnpm --filter @personal-brand/taro test:browser
|
||||
|
||||
浏览器测试需要先启动 API 和餐饮 H5 预览。`PREVIEW_URL` 指定预览地址,`CHROMIUM_PATH` 指定本机 Chromium;测试只读取开发库,模拟错误响应用于失败路径,不写入真实数据。
|
||||
|
||||
PR 和本地可用轻量 smoke 验证 Admin 会话与创建品牌流程:
|
||||
|
||||
```sh
|
||||
pnpm test:browser:smoke
|
||||
```
|
||||
|
||||
该命令会自动构建 Admin 并启动静态预览;完整浏览器回归仍使用 `pnpm --filter @personal-brand/taro test:browser`。
|
||||
|
||||
## 回滚与切换
|
||||
|
||||
所有工作在 feat/taro-template-preview 独立 worktree。用户确认前不合并、不切换主工作区、不修改开发数据库或原 dist/miniapp。确认后另行切换默认构建;旧 template:dev 始终可用。
|
||||
|
||||
@@ -11,7 +11,8 @@
|
||||
"typecheck": "tsc --noEmit",
|
||||
"lint": "pnpm --workspace-root exec eslint apps/taro/src apps/taro/config \"packages/template-*/taro/**/*.{ts,tsx}\"",
|
||||
"test": "node --experimental-strip-types --test test/*.test.mjs",
|
||||
"test:browser": "playwright test"
|
||||
"test:browser": "playwright test",
|
||||
"test:browser:smoke": "playwright test -c playwright.smoke.config.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@personal-brand/types": "workspace:*",
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
import { defineConfig } from "@playwright/test";
|
||||
|
||||
const adminOrigin = process.env.ADMIN_URL || "http://127.0.0.1:3005";
|
||||
|
||||
export default defineConfig({
|
||||
testDir: "./test/browser",
|
||||
// PR smoke 只覆盖最容易影响所有后台操作的会话与品牌创建流程。
|
||||
testMatch: ["admin-session.spec.ts", "brand-creation-and-page-scheme.spec.ts"],
|
||||
timeout: 30000,
|
||||
fullyParallel: false,
|
||||
workers: 1,
|
||||
use: {
|
||||
viewport: { width: 1440, height: 1000 },
|
||||
screenshot: "only-on-failure",
|
||||
trace: "retain-on-failure",
|
||||
launchOptions: { args: ["--no-sandbox"] },
|
||||
},
|
||||
reporter: [["list"]],
|
||||
outputDir: "../../.codex-tasks/browser-smoke/raw",
|
||||
webServer: {
|
||||
// 使用已构建的 Admin 静态产物,避免在 CI 中额外启动 API 或 Vite 开发代理。
|
||||
command:
|
||||
"pnpm --dir ../../apps/admin exec vite preview --host 127.0.0.1 --port 3005 --strictPort",
|
||||
url: `${adminOrigin}/admin/brands/new`,
|
||||
reuseExistingServer: !process.env.CI,
|
||||
timeout: 60000,
|
||||
},
|
||||
});
|
||||
Reference in new issue
Block a user