mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-07-17 01:46:07 +00:00
feat(agent-platform): add scenario-based route creation
This commit is contained in:
@@ -20,6 +20,10 @@ await loadEnvFiles();
|
||||
const paths = evidencePaths(caseId);
|
||||
await ensureEvidence(paths);
|
||||
const mobileScreenshot = paths.screenshot.replace(/\.png$/, "-mobile.png");
|
||||
const scenarioMenuScreenshot = paths.screenshot.replace(
|
||||
/\.png$/,
|
||||
"-scenario-menu.png",
|
||||
);
|
||||
|
||||
const startedAt = new Date();
|
||||
const frontendUrl = process.env.LANGBOT_FRONTEND_URL || "";
|
||||
@@ -50,6 +54,7 @@ const result = {
|
||||
network_log: paths.networkLog,
|
||||
screenshot: paths.screenshot,
|
||||
mobile_screenshot: mobileScreenshot,
|
||||
scenario_menu_screenshot: scenarioMenuScreenshot,
|
||||
automation_result_json: paths.automationResultJson,
|
||||
result_json: paths.resultJson,
|
||||
},
|
||||
@@ -93,10 +98,23 @@ try {
|
||||
.getByText(/Event Routing|事件路由|イベントルーティング/)
|
||||
.first()
|
||||
.waitFor();
|
||||
const addBehavior = page.getByRole("button", {
|
||||
name: /Add behavior|添加行为|動作を追加/,
|
||||
});
|
||||
await addBehavior.waitFor();
|
||||
await addBehavior.click();
|
||||
const messageBehavior = page.getByRole("menuitem", {
|
||||
name: /Reply to messages|回复收到的消息|受信メッセージに返信/,
|
||||
});
|
||||
await messageBehavior.waitFor();
|
||||
await page.waitForTimeout(250);
|
||||
await safeScreenshot(page, scenarioMenuScreenshot);
|
||||
await messageBehavior.click();
|
||||
await page
|
||||
.getByRole("button", { name: /Add Route|添加路由|ルートを追加/ })
|
||||
.getByText(/Message received|收到消息|メッセージを受信/)
|
||||
.first()
|
||||
.waitFor();
|
||||
result.visible_signals.push("create-mode-routing");
|
||||
result.visible_signals.push("create-mode-routing", "scenario-route-added");
|
||||
|
||||
const create = await apiJson(backendUrl, "/api/v1/platform/bots", {
|
||||
method: "POST",
|
||||
|
||||
@@ -27,7 +27,7 @@ automation_env:
|
||||
preconditions:
|
||||
- "The target is a local test instance where a temporary HTTP Bot may be created and deleted."
|
||||
steps:
|
||||
- "Open Create Bot, choose HTTP Bot, and confirm event routing can be configured before the first save."
|
||||
- "Open Create Bot, choose HTTP Bot, and add a message-reply behavior before the first save."
|
||||
- "Create a temporary HTTP Bot with a saved message.received route to the discard processor."
|
||||
- "Open the Bot configuration in the WebUI."
|
||||
- "Confirm the adapter capability summary, friendly event name, target, and route status are visible."
|
||||
@@ -36,7 +36,7 @@ steps:
|
||||
- "Run the saved runtime route with a synthetic event."
|
||||
- "Close the dialog and confirm the route card shows the latest discarded status."
|
||||
checks:
|
||||
- "UI: A user can choose a channel and add event routes during initial Bot creation."
|
||||
- "UI: A user can choose a channel and add a scenario-labeled behavior during initial Bot creation."
|
||||
- "UI: Event routing uses user-facing labels and does not require the raw event name in the primary route card."
|
||||
- "UI: Definite route shadowing and unmatched-event fallback behavior are visible without opening raw logs."
|
||||
- "UI: Dry-run visibly reports that the route matched the discard processor."
|
||||
|
||||
Reference in New Issue
Block a user