test(web): Playwright full-route smoke as deno task test:web:smoke
Logs in, opens every console route (detail routes resolved from list endpoints), fails on console errors, uncaught exceptions or 4xx/5xx API responses, and screenshots each page. Uses playwright-core with the local Chromium; documented in README. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
1023642ef9
commit
269a2269a1
4 files changed
+190
No files matched your search
@@ -16,6 +16,17 @@ deno task dev # API http://localhost:4380 控制台 http://localhost:51
|
||||
|
||||
提交前:`deno task ci`(typecheck:tsc 7.0.2 + deno check → biome → vitest → check:tokens → web 构建 + server 编译)。
|
||||
|
||||
### 前端冒烟(`deno task test:web:smoke`)
|
||||
|
||||
Playwright(`playwright-core`,用本机 Chromium)登录后逐个打开控制台全部路由(详情页从列表接口取第一条真实 ID),检查页面渲染出来、没有控制台报错 / 未捕获异常 / 4xx·5xx 的 API 请求,并逐页截图。不在 `deno task ci` 里,需要先起好后端与 web、并已初始化管理员:
|
||||
|
||||
```sh
|
||||
deno task dev # 或单容器部署后直接用 4380
|
||||
SMOKE_BASE_URL=http://127.0.0.1:5180 SMOKE_USER=<管理员> SMOKE_PASSWORD=<密码> deno task test:web:smoke
|
||||
```
|
||||
|
||||
可选:`SMOKE_OUT`(截图目录,缺省 `apps/web/test/screenshots/smoke`,已 gitignore)、`SMOKE_CHROMIUM`(浏览器路径,缺省 `/usr/bin/chromium`)、`SMOKE_SCREENSHOTS=0`。全部通过退出 0,有失败 1,前置条件不满足 2。
|
||||
|
||||
## 部署
|
||||
|
||||
除 PostgreSQL 外全部在一个容器里(api + worker + web 静态,单端口 4380);compose 只有 `app` + `postgres`。
|
||||
|
||||
Reference in new issue
Block a user