@kkeve/suite 0.0.12 → 0.0.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commands/run.js +4 -1
- package/dist/core/generateReport/reportData.js +6 -3
- package/dist/core/global-setup.d.ts +1 -1
- package/dist/core/global-setup.js +22 -12
- package/dist/core/keve-test.js +83 -35
- package/dist/core/learned-actions.d.ts +37 -8
- package/dist/core/learned-actions.js +214 -22
- package/dist/page-agent/agent.d.ts +21 -0
- package/dist/page-agent/agent.js +282 -4
- package/dist/page-agent/system_prompt.md +70 -14
- package/dist/page-agent/tools.js +814 -17
- package/doc/skills/keve-e2e-gen/references/script-generation-guide.md +11 -0
- package/package.json +1 -1
|
@@ -51,6 +51,7 @@
|
|
|
51
51
|
> 2. **绝不硬编码等待时间**:不使用 `waitForTimeout()`,通过 POM waitForReady 或断言等待
|
|
52
52
|
> 3. **绝不硬编码环境数据**(D05):ID/配置值从 `fixtures/test-data.ts` 导入
|
|
53
53
|
> 4. **每个测试覆盖恰好一个排列**:测试体内无 if/else 分支逻辑
|
|
54
|
+
> 5. **绝不使用 `waitForLoadState('networkidle')`**:BI 仪表盘等页面有 WebSocket/SSE/长轮询等持久连接,`networkidle` 永远不会 resolve 导致无限挂起。使用 `waitForLoadState('domcontentloaded')` 或 `page.goto(url, { waitUntil: 'domcontentloaded' })` 代替
|
|
54
55
|
|
|
55
56
|
### 正确模式 vs 禁止模式
|
|
56
57
|
|
|
@@ -64,6 +65,16 @@ await expect(page.locator('[data-e2e-name="智能应用列表-筛选区域"]')).
|
|
|
64
65
|
await page.locator('.filter-area').click();
|
|
65
66
|
await page.waitForTimeout(5000);
|
|
66
67
|
await agentDetailPage.navigate(636, 'edit');
|
|
68
|
+
|
|
69
|
+
// ❌ 禁止:waitForLoadState('networkidle') — BI 页面有持久连接会无限挂起
|
|
70
|
+
await page.goto(url);
|
|
71
|
+
await page.waitForLoadState('networkidle'); // ← 永远不会 resolve!
|
|
72
|
+
|
|
73
|
+
// ✅ 正确:使用 domcontentloaded 替代
|
|
74
|
+
await page.goto(url, { waitUntil: 'domcontentloaded' });
|
|
75
|
+
// 或
|
|
76
|
+
await page.goto(url);
|
|
77
|
+
await page.waitForLoadState('domcontentloaded');
|
|
67
78
|
```
|
|
68
79
|
|
|
69
80
|
### fixtures/test-data.ts 结构
|
package/package.json
CHANGED