Add page data delivery and publication guards
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user