F2-8: 表单写体验 e2e 三态验证 + 截图竞态修复

- 新增 e2e/form-write.spec.ts:成功态/校验失败态/403态三个 E2E- 前缀用例
  成功态 psql 落库验证 + 清理;校验失败态断言 status≠0 且 msg 无 "Internal Server Error"
- f2-16-column-render.spec.ts:删除未用变量 BACKEND_NODE(TS 告警)+ 截图前等 Page-body
- schema-samples.spec.ts:截图前 waitForSelector cxd-Page-body/table,避免截到 loading

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
2026-06-12 00:48:00 +08:00
parent 45fc56c7e6
commit e4b6e61d3f
7 changed files with 316 additions and 1 deletions

View File

@@ -14,7 +14,6 @@ import { fileURLToPath } from 'node:url';
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const BACKEND_NODE = 'http://localhost:8093';
const TEMPLATE_ID = 'e732c4b0-2402-4e73-8cc4-786c8a8c52af';
const ARTIFACT_DIR = path.join(__dirname, 'artifacts', 'f2-16');
@@ -87,6 +86,12 @@ test('F2-16 通知管理页列渲染为人话(日期/枚举/布尔)', async
// schema 无报错卡
await expect(page.locator('[data-testid="schema-error-card"]')).not.toBeVisible();
// F2-8 竞态修复:等待 amis crud 内容区可见(表格或空状态),再截图
await page.waitForSelector(
'[data-testid="amis-host"] table, [data-testid="amis-host"] .cxd-CRUD, [data-testid="amis-host"] .cxd-Page-body',
{ timeout: 15_000 },
).catch(() => {/* 无表格(空页或无权限),继续截图 */});
// 截图:全页
await page.screenshot({
path: path.join(ARTIFACT_DIR, 'notify-manage-full.png'),