skills/testing/testing-e2e/SKILL.md
E2E: Playwright browser automation/visual regression, Cypress, Selenium. POM, trace viewer, CI
npx skillsauth add alphaonedev/openclaw-graph testing-e2eInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
This skill enables end-to-end (E2E) testing using tools like Playwright, Cypress, and Selenium for browser automation, visual regression testing, and integration with CI/CD pipelines. It focuses on reliable test automation for web applications.
Use this skill for full-stack testing of web apps, such as verifying user flows, UI interactions, or visual changes. Apply it in scenarios like regression testing before deployments, cross-browser compatibility checks, or when debugging UI issues in production-like environments.
expect.toHaveScreenshot().To set up E2E tests, initialize a project with the chosen tool and write tests in a dedicated directory. Always use environment variables for sensitive data, like $PLAYWRIGHT_BROWSER for browser selection.
Example 1: Playwright test for login flow
tests/login.spec.jsconst { test } = require('@playwright/test');
test('login success', async ({ page }) => {
await page.goto('https://app.example.com');
await page.fill('#username', 'user');
await page.click('#login');
});
npx playwright test --headed --project=chromiumExample 2: Cypress test for form submission
cypress/integration/form.spec.jsdescribe('Form Submission', () => {
it('submits correctly', () => {
cy.visit('/form');
cy.get('#name').type('Test User');
cy.get('button[type=submit]').click();
cy.url().should('include', '/success');
});
});
npx cypress run --browser chrome --spec cypress/integration/form.spec.jsFor Selenium, use WebDriver with POM: Define a page class and call methods in tests.
npx playwright install to setup browsers; npx playwright test --trace on for tracing; API: page.locator('selector').click() for interactions.npx cypress open for interactive mode; npx cypress run --config video=true to enable videos; API: cy.get('selector').should('be.visible') for assertions.webdriverio or similar; Command: node selenium-test.js with script like driver.get('https://example.com'); Config: JSON file for WebDriver options, e.g., { "browserName": "chrome" }.npx playwright show-trace trace.zip to view traces; Cypress via plugins like cypress-image-snapshot.Integrate this skill into your workflow by adding it to package.json scripts, e.g., "test:e2e": "npx playwright test". For CI, use GitHub Actions with a step: run: npx cypress run --reporter junit. If API keys are needed (e.g., for cloud services), set env vars like $SELENIUM_GRID_URL or $CYPRESS_API_KEY. Ensure browsers are installed via tools like playwright install --with-deps. For multi-tool setups, use a config file like playwright.config.ts with exports for projects.
When tests fail, check logs first: Use Playwright's --trace flag to generate traces and debug with the trace viewer. For Cypress, enable --config video=true to capture videos. Handle common errors by adding retries, e.g., in Playwright: test('retry', { retries: 2 }, async () => { ... }). For Selenium, wrap code in try-catch blocks:
try {
await driver.findElement(By.id('element')).click();
} catch (error) {
console.error('Element not found:', error);
}
Assert conditions explicitly to avoid flaky tests, and use env vars for dynamic configs to prevent setup errors.
tools
Root web development: project structure, tooling selection, deployment decisions
development
WebAssembly: Rust/Go/C to WASM, wasm-bindgen, Emscripten, WASM Component Model
development
Vue 3: Composition API script setup, Pinia, Vue Router 4, SFCs, Vite, Nuxt 3
tools
Tailwind CSS 4: utility classes, config, JIT, arbitrary values, darkMode, plugins, shadcn/ui