No selectors. No flake. Just plain English.
- π£οΈ Write Tests in Plain English β Describe what you want, not how to find it. "Add laptop to cart" just works.
- π BDD & YAML Support β Works with Playwright-BDD, Cucumber.js, or simple YAML files. Zero step definitions needed.
- π Any LLM Provider β Claude, OpenAI, or Gemini. Use the model that fits your budget and needs.
- β‘ 2-Minute Setup β
npx openqa initand you're running tests. No complex configuration.
Powered by: Claude Agent SDK β’ LangChain β’ Playwright MCP
New Project (YAML, Playwright-BDD, or Cucumber.js):
npx openqa initThis single command will:
- Prompt for framework selection (YAML, Playwright-BDD, or Cucumber.js)
- Install dependencies and Playwright browsers
- Prompt for AI provider (Anthropic or Other)
- Show tailored setup instructions
Write tests in YAML or .feature files - AI handles everything!
name: Shopping Tests
tests:
- name: Buy a product
steps:
- Navigate to "https://shop.example.com"
- Search for "laptop" and add the first result to cart
- Proceed to checkout and enter shipping details
- Verify "Order confirmed" appears on the pageYAML with Custom Fixtures (Cloud browsers, custom data, etc.):
name: Cloud Browser Tests
fixtureFile: ./fixtures/browser.js # Custom Playwright fixtures
tests:
- name: Test with cloud browser
steps:
- Navigate to "https://shop.example.com"
- Add laptop to cart// fixtures/browser.js - Custom browser fixture
import { test as base } from '@playwright/test';
import { chromium } from '@playwright/test';
export const test = base.extend({
browser: [async ({}, use) => {
const browser = await chromium.connectOverCDP('ws://your-cloud-browser');
await use(browser);
await browser.close();
}, { scope: 'worker' }],
});Integrations with Existing Projects:
Step 1: Install OpenQA
npm install openqaStep 2: Setup authentication
Choose ONE method:
# A. Claude Code CLI (recommended)
claude login
# B. API Key
export ANTHROPIC_API_KEY=your_key
# C. .env file
echo "ANTHROPIC_API_KEY=your_key" > .envFor OpenAI/Google, create .env:
AGENT_TYPE=langchain
DEFAULT_PROVIDER=openai # or 'google'
OPENAI_API_KEY=your_keyStep 3: Replace step definitions
// features/steps/steps.ts
export { test } from 'openqa/bdd/playwright-bdd';Step 4: Run tests
npm testStep 1: Install OpenQA
npm install openqa @playwright/testStep 2: Setup authentication
Choose ONE method:
# A. Claude Code CLI (recommended)
claude login
# B. API Key
export ANTHROPIC_API_KEY=your_key
# C. .env file
echo "ANTHROPIC_API_KEY=your_key" > .envFor OpenAI/Google, create .env:
AGENT_TYPE=langchain
DEFAULT_PROVIDER=openai # or 'google'
OPENAI_API_KEY=your_keyStep 3: Replace step definitions
// features/step_definitions/steps.js
import 'openqa/bdd/cucumber';
// Browser setup included automatically!Step 4: Run tests
npm testStep 1: Install OpenQA
npm install openqaStep 2: Setup authentication
Choose ONE method:
# A. Claude Code CLI (recommended)
claude login
# B. API Key
export ANTHROPIC_API_KEY=your_key
# C. .env file
echo "ANTHROPIC_API_KEY=your_key" > .envFor OpenAI/Google, create .env:
AGENT_TYPE=langchain
DEFAULT_PROVIDER=openai # or 'google'
OPENAI_API_KEY=your_keyStep 3: Use in your tests
import { test } from "@playwright/test";
import { runAgent } from "openqa";
test("AI agent fills form", async ({ page, context }) => {
await page.goto("https://example.com/form");
// Agent uses the same browser context
await runAgent('Fill in the form with test data', context);
// Verify in the same browser
await expect(page.locator('input[name="email"]')).toHaveValue("[email protected]");
});Step 4: Run tests
npx playwright testThe agent uses @playwright/mcp with createConnection() to share the browser context. This enables:
- Shared cookies and session storage
- Same page state and navigation history
- True collaborative automation between tests and AI
Run AI agent with natural language instruction.
Parameters:
prompt(string): Natural language instructionbrowserContext(BrowserContext): Playwright browser contextoptions(object): Optional configurationverbose(boolean): Enable logging (default: true)agentType(string): 'claude' (default) or 'langchain'provider(string): AI provider ('anthropic', 'openai', 'google')model(string): Model namerecursionLimit(number): Max recursion depth (default: 100)
Returns: Promise
Playwright-BDD (simple):
// features/steps/steps.ts
export { test } from 'openqa/bdd/playwright-bdd';Playwright-BDD (custom):
import { createAIStep } from 'openqa/bdd/playwright-bdd';
createAIStep({
verbose: false,
agentType: 'claude',
});Cucumber.js:
import 'openqa/bdd/cucumber';examples/playwright-yaml/- YAML tests with natural language + custom fixturesexamples/playwright/- Standard Playwright testsexamples/playwright-bdd-simple/- 1-line BDD integrationexamples/playwright-bdd/- Manual BDD setupexamples/playwright-bdd-onkernel/- BDD with OnKernel cloud browsersexamples/playwright-bdd-steel/- BDD with Steel Docker browsers
- Node.js 18+
@playwright/test^1.56.0- Claude Code login, Anthropic API key, or other provider API key
- Website: https://www.auto-browse.com/
- NPM: https://www.npmjs.com/package/openqa
- GitHub: https://github.com/auto-browse/openqa
MIT