Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/runtime-core/src/command-registry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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" },
Expand Down
13 changes: 13 additions & 0 deletions tests/recipe-validation-descriptors.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Loading