Quickstart
Run this from your existing project root:Step 1: Choose your agent
Both agents connect to the same Playwright MCP server over HTTP and expose the same interface. You can swap between them by changing one import.
Step 2: Choose your model
Claude Code models:
OpenCode models use
provider/model format:
Or enter any custom model name your OpenCode installation supports.
Step 3: Choose your framework
Playwright-BDD — Uses Gherkin.feature files with the Playwright test runner. Recommended.
Cucumber.js — Standard Cucumber with Playwright browser automation.
Step 4: Point to your feature files
Enter the relative path from your project root to your.feature files. For example:
features/— defaulttests/features/src/test/features/
What gets created
.openqa/features/ by default. To move them, update the path in playwright.config.ts (or cucumber.js) — see Writing Feature Files.
Authentication
No API key needed for local development. Just log in once with the CLI and you’re done.
- Claude Code (local)
- OpenCode (local)
- API Key (Claude Code)
- API Key (OpenCode)
.env needed for local runs.Environment Variables
The scaffolded project uses varlock for environment variable management. Variables are defined in.env.schema (committed to git) and values go in .env (gitignored). Secrets are automatically redacted from logs.
All variables are optional. Copy
.env.example to .env and uncomment what you need.
Adding your own variables — declare them in .env.schema, add values to .env:
Customizing Your Setup
openqa init is a starting point — everything in .openqa/ is yours to edit.
Playwright config — .openqa/playwright.config.ts is a standard Playwright config file. Update timeouts, add projects, enable retries, change reporters — anything the Playwright docs describe will work here.
Step definitions — .openqa/steps/steps.ts is a regular Playwright-BDD step file (or Cucumber.js for the Cucumber framework). Add non-AI steps, Before/After hooks, or custom fixtures alongside the AI step.
Writing Feature Files
Two example feature files are scaffolded into.openqa/features/ — edit or replace them with your own tests.
Use * (asterisk) for natural, AI-friendly steps:
Given/When/Then also works — both are identical under the hood.
Tips for good steps:
- Be specific about URLs:
I navigate to "https://..."notI go to the site - Quote the exact text you expect:
I should see "Buy groceries" - Describe intent, not mechanics:
I add a new todo item "..."notI click the input and type "..."
.openqa/playwright.config.ts (or cucumber.js):
Run your tests
Changing Model or Provider
Your model is set in one line inside.openqa/steps/steps.ts (Playwright-BDD) or .openqa/steps/steps.js (Cucumber.js). Open that file and change the provider call — that’s it.
Change the Claude Code model:
Switching between
claudeCode and openCode requires changing the import and the provider call. Everything else — feature files, step syntax, test runner commands — stays the same.Examples
Browse working examples in the repository:examples/playwright-bdd/— Playwright-BDD with natural language stepsexamples/cucumberjs/— Cucumber.js integrationexamples/playwright-yaml/— YAML-based tests