Skip to content

πŸ™Œ OpenHands: AI-Driven Development

test(e2e): give the preset automation's Slack stand-in the catalog identity (#18087)

Engel Nyst2ad3c574b615
diff --git a/tests/e2e/mock-llm/automations/mock-llm-preset-automation.spec.ts b/tests/e2e/mock-llm/automations/mock-llm-preset-automation.spec.ts
index d9c4ad76cf..7495f2f66a 100644
--- a/tests/e2e/mock-llm/automations/mock-llm-preset-automation.spec.ts
+++ b/tests/e2e/mock-llm/automations/mock-llm-preset-automation.spec.ts
@@ -18,6 +18,7 @@
*/
import { test, expect } from "@playwright/test";
+import { INTEGRATION_CATALOG } from "@openhands/extensions/integrations";
import {
BACKEND_URL,
SESSION_API_KEY,
@@ -40,6 +41,20 @@ const SLASH_COMMAND = "/standup-digest:setup";
const AUTOMATION_CARD_ID = "slack-standup-digest";
const REPLY_TOKEN = "PRESET_AUTOMATION_REPLY_OK";
+// Canvas recognizes an installed stdio integration by the catalog's command
+// and leading args, so the stand-in Slack server must carry that identity.
+const SLACK_STDIO_TRANSPORT = (() => {
+ const transport = INTEGRATION_CATALOG.find(
+ (entry) => entry.id === "slack",
+ )?.connectionOptions.find(
+ (option) => option.transport?.kind === "stdio",
+ )?.transport;
+ if (transport?.kind !== "stdio") {
+ throw new Error("Slack has no stdio option in the integration catalog.");
+ }
+ return transport;
+})();
+
// ── Shared helpers ────────────────────────────────────────────────────
/** Register + activate the mock LLM trajectory for a skill-triggered conversation. */
@@ -140,7 +155,7 @@ test.describe("preset automation β†’ slash command conversation", () => {
//
// Configure a dummy Slack MCP server so the frontend sees it as
// "installed" and the card is clickable without the install modal.
- // The dummy `echo` command can't do MCP JSON-RPC, so the agent-server
+ // The offline `npx` stand-in never starts an MCP server, so the agent-server
// will error during tool initialization β€” but we only care that the
// card click navigated to a conversation and sent the right prompt.
// The end-to-end skill activation + agent reply is tested in test 2
@@ -163,11 +178,14 @@ test.describe("preset automation β†’ slash command conversation", () => {
agent_settings_diff: {
mcp_config: {
slack: {
- command: "echo",
- args: ["dummy-slack-mcp"],
+ command: SLACK_STDIO_TRANSPORT.command,
+ args: SLACK_STDIO_TRANSPORT.args,
env: {
SLACK_BOT_TOKEN: "xoxb-test-token",
SLACK_TEAM_ID: "T0000000000",
+ // Keep the stand-in inert: npx fails fast instead of
+ // downloading and starting the real server.
+ npm_config_offline: "true",
},
},
},