diff --git a/packages/runtime-core/src/command-registry.ts b/packages/runtime-core/src/command-registry.ts index 9d27b8d3..969ec1e2 100644 --- a/packages/runtime-core/src/command-registry.ts +++ b/packages/runtime-core/src/command-registry.ts @@ -103,7 +103,7 @@ const snapshotScopingAcceptedArgs: CommandDefinition["acceptedArgs"] = [ { name: "snapshot-post-types", description: "Comma-separated post types used to scope posts and postmeta table exports.", format: "string" }, ] -const browserActionCaptureValues = ["steps", "actions", "console", "errors", "html", "network", "screenshot", "dom-snapshot"] as const +export const browserActionCaptureValues = ["steps", "actions", "console", "errors", "html", "network", "websocket", "screenshot", "dom-snapshot", "video"] as const const browserScenarioCaptureValues = ["steps", "actions", "console", "errors", "html", "network", "performance", "memory", "screenshot", "dom-snapshot"] as const const browserActionEnvironmentAcceptedArgs: CommandDefinition["acceptedArgs"] = [ { name: "route-host", description: "Preview host alias routed to the local Playground preview.", repeatable: true, format: "hostname" }, diff --git a/tests/recipe-validation-descriptors.test.ts b/tests/recipe-validation-descriptors.test.ts index 6c53cc23..620f8904 100644 --- a/tests/recipe-validation-descriptors.test.ts +++ b/tests/recipe-validation-descriptors.test.ts @@ -117,4 +117,17 @@ await withTempDir("wp-codebox-recipe-browser-payload-files-", async (recipeDirec } }) +await withTempDir("wp-codebox-recipe-validation-capture-", async (recipeDirectory) => { + // Every capture the browser-actions runner accepts must also pass recipe + // validation, or recipe-driven runs (e.g. video recordings) are rejected + // before they start. + const runnerCaptures = ["steps", "console", "errors", "html", "network", "websocket", "screenshot", "dom-snapshot", "video"] + const recipe: WorkspaceRecipe = { + schema: "wp-codebox/workspace-recipe/v1", + workflow: { steps: [{ command: "wordpress.browser-actions", args: ["url=/", `capture=${runnerCaptures.join(",")}`] }] }, + } + const issues = await validateWorkspaceRecipeSemantics(recipe, join(recipeDirectory, "recipe.json")) + assert.deepEqual(issues.filter(({ code }) => code === "invalid-capture"), []) +}) + console.log("recipe validation descriptors ok")