Add page data delivery and publication guards

This commit is contained in:
john
2026-07-08 21:10:47 +08:00
parent 8d629e7a4e
commit eea14c1855
66 changed files with 3035 additions and 413 deletions
+18
View File
@@ -17,6 +17,7 @@ import {
resolvePortalBase,
snapshotPublicHtml,
verifyPageAccess,
verifySurveyDelivery,
waitForAssistantGrowth,
waitForRunTerminal,
extractAssistantTexts,
@@ -112,6 +113,7 @@ async function runScenario(scenario, port) {
const run = await createAgentRun(baseUrl, auth.cookie, {
message: step.message,
sessionId,
selectedChatSkill: step.selectedChatSkill ?? null,
});
reporter.pass('提交消息', `"${step.message}" → run ${run.runId}`);
@@ -174,6 +176,22 @@ async function runScenario(scenario, port) {
});
}
if (step.expect?.survey) {
await verifySurveyDelivery({
publishKey,
replyText: reply.combined,
expect: step.expect.survey,
reporter,
});
}
const forbidReply = step.expect?.forbidReplyPatterns ?? [];
for (const pattern of forbidReply) {
if (pattern && reply.combined.includes(pattern)) {
reporter.fail('回复禁用模式', `命中 ${pattern}`);
}
}
continue;
}