test(工作台): 俊希测试用例重跑——TC-09/10+三入口输入输出+入库全链路验证
- cdp-test-junxi.mjs: 弹窗标题断言 AI写脚本→AI创作(09-01 改名同步);文案分支打印修正(首次/有设定正则区分) - 实测验证:TC-09 界面链路 PASS(AI选题3方向);AI创作三入口 prompt 注入 PASS(账号设定前置/选题后置/无泄漏);TC-10 自动任务链路 PASS(automations→调度器→会话→脚本02落盘);入库 PASS(video_source 6条+persona幂等+videos去重) - 库表澄清:source/analysis 无 account_id 列靠 video_id 关联,俊希行 video_id=null 属设计
This commit is contained in:
1 parent
3b09d73248
commit
6e8698a469
2 files changed
+17
-6
No files matched your search
@@ -1,5 +1,6 @@
|
||||
// 模拟点击测试:俊希「AI写脚本」界面链路(#/accounts → AI写脚本弹窗 → AI 选题生成)
|
||||
// 模拟点击测试:俊希「AI创作」界面链路(#/accounts → AI创作弹窗 → AI 选题生成)
|
||||
// 覆盖测试用例 TC-09 的界面交互环节(真实模拟用户点击,非仅文字步骤)
|
||||
// 2026-09-01 更新:按钮/弹窗标题已由「AI写脚本」统一改名为「AI创作」(cdp-test 断言同步)
|
||||
//
|
||||
// 前置:
|
||||
// 1. 工作台服务运行中(node server.js,默认端口 8900;可传参指定)
|
||||
@@ -57,11 +58,11 @@ const findBtn = await ev2(`(() => {
|
||||
})()`);
|
||||
console.log('【Step1 账号列表定位俊希】', JSON.stringify(findBtn));
|
||||
if (!findBtn.found) {
|
||||
console.log('FAIL: 账号列表未找到俊希「AI写脚本」按钮(若账号未关注,请先到周榜/账号列表关注俊希)');
|
||||
console.log('FAIL: 账号列表未找到俊希「AI创作」按钮(若账号未关注,请先到周榜/账号列表关注俊希)');
|
||||
await send('Target.closeTarget', { targetId }); ws.close(); ws2.close(); process.exit(1);
|
||||
}
|
||||
|
||||
// 4) 模拟点击「AI写脚本」→ 轮询等待弹窗出现(confirmAiScript 先 await persona 接口再建弹窗,需等待)
|
||||
// 4) 模拟点击「AI创作」→ 轮询等待弹窗出现(confirmAiScript 先 await persona 接口再建弹窗,需等待)
|
||||
await ev2(`(() => { const b = [...document.querySelectorAll('[data-create]')].find((x) => x.dataset.create === '俊希'); b.click(); return true; })()`);
|
||||
const modal = await ev2(`(async () => {
|
||||
for (let i = 0; i < 24; i++) {
|
||||
@@ -74,10 +75,12 @@ const modal = await ev2(`(async () => {
|
||||
}
|
||||
return { open: false };
|
||||
})()`);
|
||||
console.log('【Step2 AI写脚本弹窗】', JSON.stringify(modal, null, 1));
|
||||
const descOk = modal.open && modal.title.includes('AI写脚本') && modal.hasTopicInput && modal.hasGenBtn;
|
||||
console.log('【Step2 AI创作弹窗】', JSON.stringify(modal, null, 1));
|
||||
const descOk = modal.open && modal.title.includes('AI创作') && modal.hasTopicInput && modal.hasGenBtn;
|
||||
const branch = modal.open && (modal.desc || '').includes('账号设定');
|
||||
console.log(branch ? ' → 文案分支:先进行账号设定分析(首次场景,符合预期)' : ' → 文案分支:基于当前账号设定(有设定场景)');
|
||||
// 09-01 修正:有 persona 时 desc=「基于当前账号设定…」;无 persona 时才提示先分析账号设定
|
||||
const firstTime = modal.open && /先.*账号设定|暂无账号设定|尚未.*设定/.test(modal.desc || '');
|
||||
console.log(firstTime ? ' → 文案分支:先进行账号设定分析(首次场景)' : branch ? ' → 文案分支:基于当前账号设定(有设定场景)' : ' → 文案分支:未识别(需人工确认)');
|
||||
|
||||
// 5) 模拟点击「AI」选题按钮 → 轮询选题输入框(Dify 约 50s)
|
||||
await ev2(`(() => { const g = document.querySelector('#aiTopicGen'); g.click(); return true; })()`);
|
||||
|
||||
Reference in new issue
Block a user