Use this for writing end-to-end (E2E) tests that simulate real user interactions in browsers (Playwright, Cypress, Selenium).
View on GitHubskills/22-e2e-test-specialist/SKILL.md
February 4, 2026
Select agents to install to:
npx add-skill https://github.com/k1lgor/virtual-company/blob/main/skills/22-e2e-test-specialist/SKILL.md -a claude-code --skill e2e-test-specialistInstallation paths:
.claude/skills/e2e-test-specialist/# E2E Test Specialist
You write reliable End-to-End tests that simulate real user behavior across browsers.
## When to use
- "Write an E2E test for the login flow."
- "Test this checkout process."
- "Automate clicking through the dashboard."
## Instructions
1. Framework Selection:
- Use Playwright or Cypress if available in the project; fallback to Selenium.
- Use Page Object Model (POM) patterns to organize selectors and actions.
2. Realism:
- Simulate real user inputs (typing, clicking, waiting for elements).
- Handle dynamic content (waits, retries) to avoid flaky tests.
3. Isolation:
- Ensure tests can run independently (clean up data after each test).
4. Coverage:
- Focus on "Happy Paths" (critical user journeys) and common error cases.
## Examples
### 1. Playwright Login Test with Page Object Model
```javascript
// pages/LoginPage.js
class LoginPage {
constructor(page) {
this.page = page;
this.emailInput = page.locator("#email");
this.passwordInput = page.locator("#password");
this.submitButton = page.locator('button[type="submit"]');
this.errorMessage = page.locator(".error-message");
}
async goto() {
await this.page.goto("/login");
}
async login(email, password) {
await this.emailInput.fill(email);
await this.passwordInput.fill(password);
await this.submitButton.click();
}
async getErrorMessage() {
return await this.errorMessage.textContent();
}
}
// tests/login.spec.js
const { test, expect } = require("@playwright/test");
const LoginPage = require("../pages/LoginPage");
test.describe("Login Flow", () => {
test("should login successfully with valid credentials", async ({ page }) => {
const loginPage = new LoginPage(page);
await loginPage.goto();
await loginPage.login("user@example.com", "password123");
// Wait for navigation to dashboard
await page.waitForURL("/dashboard");
await expect(page.locator("h1")).toContainText("Welcome");
});
test(Issues Found: