Loading...
Loading...
End-to-end testing with Playwright — generate, run, and debug E2E tests.
npx skill4agent add ariadoss/superskills playwrightnpx playwright --versionnpm init playwright@latest
# or add to existing project:
npm install -D @playwright/test && npx playwright installimport { test, expect } from '@playwright/test';
test.describe('Feature Name', () => {
test.beforeEach(async ({ page }) => {
// Setup: navigate, authenticate, seed data
});
test('should do expected behavior', async ({ page }) => {
// Arrange
// Act
// Assert
});
});npx playwright test <file> # Run specific test file
npx playwright test --headed # With visible browser
npx playwright test --ui # Playwright UI mode
npx playwright test --trace on # Capture trace for debugging--trace onnpx playwright show-trace trace.zipawait page.screenshot({ path: 'debug.png' })page.pause()page.goto()page.fill()page.selectOption()page.check()expect(page).toHaveURL()expect(locator).toBeVisible()toHaveText()page.screenshot()expect(page).toHaveScreenshot()@axe-core/playwrightpage.route()page.waitForResponse()data-testidtest.step()baseURLplaywright.config.tspage.waitForResponse()