End-to-end testing with Playwright 1.58+. Use when testing critical user journeys, browser automation, cross-browser testing, AI-assisted test generation, or validating complete application flows.
View on GitHubyonatangross/orchestkit
ork-testing
February 4, 2026
Select agents to install to:
npx add-skill https://github.com/yonatangross/orchestkit/blob/main/plugins/ork-testing/skills/e2e-testing/SKILL.md -a claude-code --skill e2e-testingInstallation paths:
.claude/skills/e2e-testing/# E2E Testing with Playwright 1.58+
Validate critical user journeys end-to-end with AI-assisted test generation.
## Quick Reference - Semantic Locators
```typescript
// PREFERRED: Role-based locators (most resilient)
await page.getByRole('button', { name: 'Add to cart' }).click();
await page.getByRole('link', { name: 'Checkout' }).click();
// GOOD: Label-based for form controls
await page.getByLabel('Email').fill('test@example.com');
// ACCEPTABLE: Test IDs for stable anchors
await page.getByTestId('checkout-button').click();
// AVOID: CSS selectors and XPath (fragile)
// await page.click('[data-testid="add-to-cart"]');
```
**Locator Priority:** `getByRole()` > `getByLabel()` > `getByPlaceholder()` > `getByTestId()`
## Basic Test
```typescript
import { test, expect } from '@playwright/test';
test('user can complete checkout', async ({ page }) => {
await page.goto('/products');
await page.getByRole('button', { name: 'Add to cart' }).click();
await page.getByRole('link', { name: 'Checkout' }).click();
await page.getByLabel('Email').fill('test@example.com');
await page.getByRole('button', { name: 'Submit' }).click();
await expect(page.getByRole('heading', { name: 'Order confirmed' })).toBeVisible();
});
```
## AI Agents (1.58+)
### Initialize AI Agents
```bash
# Initialize agents for your preferred AI tool
npx playwright init-agents --loop=claude # For Claude Code
npx playwright init-agents --loop=vscode # For VS Code (requires v1.105+)
npx playwright init-agents --loop=opencode # For OpenCode
```
### Generated Structure
Running `init-agents` creates the following:
| Directory/File | Purpose |
|----------------|---------|
| `.github/` | Agent definitions and configuration |
| `specs/` | Test plans in Markdown format |
| `tests/seed.spec.ts` | Seed file for AI agents to reference |
### Working with AI Agents
After initialization, agents can:
- Read test plans from `specs/` and generate tests
- Use `seed.spec.ts` as a template for con