test(e2e): executable AI-recipe render smoke gate (M-Gate)

把「手动用浏览器验 AI 生成页渲染成 house-style」codify 成可复用的可执行门,补上
critic 点名「playwright-render 名实不符(从不真渲染)」的缺口——不给后端加浏览器依赖。

- e2e/recipe-render-smoke.spec.ts:给定 templateId,从 served schema 自推期望
  (数据列 label + 所有按钮 label),再断言 amis 真渲染成无错 DOM:amis-host 可见
  且无 schema-error-card / 每列每动作出现 / tbody 无裸 true·false·ISO 串
  (列渲染类型生效)/ 0 console.error·pageerror。
- playwright.recipe-smoke.config.ts:复用已在跑的 5174,不自起 webServer。
- recipe-render-smoke.sh:一键端到端——登录→auto-develop 1 maintenance + 1 tree
  样例→对两页跑断言→DROP 表+删三真相行清理(trap 保证失败也清,sys_ai_* 保留)。

验证:./recipe-render-smoke.sh 端到端全绿(maintenance + tree 两页均 PASSED,
0 console error),库残留复查 0。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-19 20:28:32 +08:00
parent d26e16c689
commit 4b564c6316
3 changed files with 265 additions and 0 deletions

View File

@@ -0,0 +1,30 @@
import { defineConfig, devices } from '@playwright/test';
// ────────────────────────────────────────────────────────────────────────────
// AI recipe 渲染冒烟门专属配置(M-Gate 可执行化)。
//
// 与默认 playwright.config.ts 的区别(关键):
// - 复用【已在跑】的 5174 dev server,不自拉 webServer(不重启任何服务)。
// - 仅匹配 recipe-render-smoke.spec.ts。
//
// 一键跑(含生成/清理):见 recipe-render-smoke.sh
// 单跑某页:RECIPE_SMOKE_TEMPLATE=<id> npx playwright test --config=playwright.recipe-smoke.config.ts
// 前置:localhost:5174(前端 dev)+ localhost:8093(后端 dev/eip4dev)。
// ────────────────────────────────────────────────────────────────────────────
export default defineConfig({
testDir: './e2e',
testMatch: /recipe-render-smoke\.spec\.ts/,
fullyParallel: false,
workers: 1,
timeout: 90_000,
reporter: [['list']],
outputDir: './e2e/artifacts/recipe-render-smoke/_pw-output',
use: {
baseURL: 'http://localhost:5174',
trace: 'retain-on-failure',
screenshot: 'only-on-failure',
video: 'off',
},
projects: [{ name: 'chromium', use: { ...devices['Desktop Chrome'] } }],
// 故意不配置 webServer —— 复用已在跑的 5174,不重启。
});