Create end-to-end tests using Playwright for user workflows. Use when testing user interactions, authentication flows, or full feature testing.
Create Playwright E2E tests for user workflows.
/testing:e2e-tests [feature] - Create E2E tests for feature/testing:e2e-tests status - Check E2E coverage statusimport { expect, test } from '@playwright/test';
test.describe('Feature Name', () => {
test.beforeEach(async ({ page }) => {
test.setTimeout(120000);
// Setup: login, navigate, etc.
});
test('should perform action', async ({ page }) => {
// Arrange
await page.goto('/feature');
// Act
await page.click('[data-testid="button"]');
// Assert
await expect(page.locator('.result')).toBeVisible();
});
});
tests/e2e/
├── smoke/ # Critical health checks
├── auth/ # Authentication flows
├── core/ # Core feature workflows
└── utils/ # Helper utilities
# Start server
nohup <dev-command> > dev.log 2>&1 &
# Verify ready
curl -s http://localhost:<port> | head -1
# Run tests
<playwright-runner> tests/e2e/[category]/[test]
# CRITICAL: Stop server after
pkill -f "<dev-process>"
@critical - Must pass for release@high - Important functionality@medium - Secondary features@low - Nice to havestorageState for auth tests (login once, reuse) instead of per-test UI login