feat(browser-automation): add playwright-cli as browser automation provider
- Add playwright-cli to BrowserAutomationProviderSchema enum - Add playwright-cli to BuiltinSkillNameSchema - Create playwrightCliSkill with official Microsoft template - Update skill selection logic to handle 3 providers - Add comprehensive tests for schema and skill selection - Regenerate JSON schema Closes #<issue-number-if-any>
This commit is contained in:
@@ -553,6 +553,18 @@ describe("BrowserAutomationProviderSchema", () => {
|
||||
// then
|
||||
expect(result.success).toBe(false)
|
||||
})
|
||||
|
||||
test("accepts 'playwright-cli' as valid provider", () => {
|
||||
// given
|
||||
const input = "playwright-cli"
|
||||
|
||||
// when
|
||||
const result = BrowserAutomationProviderSchema.safeParse(input)
|
||||
|
||||
// then
|
||||
expect(result.success).toBe(true)
|
||||
expect(result.data).toBe("playwright-cli")
|
||||
})
|
||||
})
|
||||
|
||||
describe("BrowserAutomationConfigSchema", () => {
|
||||
@@ -577,6 +589,17 @@ describe("BrowserAutomationConfigSchema", () => {
|
||||
// then
|
||||
expect(result.provider).toBe("agent-browser")
|
||||
})
|
||||
|
||||
test("accepts playwright-cli provider in config", () => {
|
||||
// given
|
||||
const input = { provider: "playwright-cli" }
|
||||
|
||||
// when
|
||||
const result = BrowserAutomationConfigSchema.parse(input)
|
||||
|
||||
// then
|
||||
expect(result.provider).toBe("playwright-cli")
|
||||
})
|
||||
})
|
||||
|
||||
describe("OhMyOpenCodeConfigSchema - browser_automation_engine", () => {
|
||||
@@ -607,6 +630,18 @@ describe("OhMyOpenCodeConfigSchema - browser_automation_engine", () => {
|
||||
expect(result.success).toBe(true)
|
||||
expect(result.data?.browser_automation_engine).toBeUndefined()
|
||||
})
|
||||
|
||||
test("accepts browser_automation_engine with playwright-cli", () => {
|
||||
// given
|
||||
const input = { browser_automation_engine: { provider: "playwright-cli" } }
|
||||
|
||||
// when
|
||||
const result = OhMyOpenCodeConfigSchema.safeParse(input)
|
||||
|
||||
// then
|
||||
expect(result.success).toBe(true)
|
||||
expect(result.data?.browser_automation_engine?.provider).toBe("playwright-cli")
|
||||
})
|
||||
})
|
||||
|
||||
describe("ExperimentalConfigSchema feature flags", () => {
|
||||
|
||||
@@ -4,6 +4,7 @@ export const BrowserAutomationProviderSchema = z.enum([
|
||||
"playwright",
|
||||
"agent-browser",
|
||||
"dev-browser",
|
||||
"playwright-cli",
|
||||
])
|
||||
|
||||
export const BrowserAutomationConfigSchema = z.object({
|
||||
@@ -12,6 +13,7 @@ export const BrowserAutomationConfigSchema = z.object({
|
||||
* - "playwright": Uses Playwright MCP server (@playwright/mcp) - default
|
||||
* - "agent-browser": Uses Vercel's agent-browser CLI (requires: bun add -g agent-browser)
|
||||
* - "dev-browser": Uses dev-browser skill with persistent browser state
|
||||
* - "playwright-cli": Uses Playwright CLI (@playwright/cli) - token-efficient CLI alternative
|
||||
*/
|
||||
provider: BrowserAutomationProviderSchema.default("playwright"),
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user