LiorCohen/sdd / plugin/fullstack-typescript/skills/components/e2e-testing/e2e-testing-standards
e2e-testing-standards
VerifiedEnd-to-end testing with Playwright - browser automation, visual regression, test data management.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 4.8 KB |
| resources/fixtures-helpers.md | markdown | 2.4 KB |
| resources/page-objects.md | markdown | 2.5 KB |
| resources/test-patterns.md | markdown | 6.0 KB |
| resources/testkube.md | markdown | 1.0 KB |
resources/page-objects.md
View on GitHub# Page Object Model
## Page Object Pattern
```typescript
// components/<testing-component>/tests/e2e/pages/login.page.ts
import { Page, Locator, expect } from '@playwright/test';
export class LoginPage {
readonly page: Page;
readonly emailInput: Locator;
readonly passwordInput: Locator;
readonly submitButton: Locator;
readonly errorMessage: Locator;
constructor(page: Page) {
this.page = page;
this.emailInput = page.locator('[data-testid="email-input"]');
this.passwordInput = page.locator('[data-testid="password-input"]');
this.submitButton = page.locator('[data-testid="login-button"]');
this.errorMessage = page.locator('[data-testid="error-message"]');
}
async goto(): Promise<void> {
await this.page.goto('/login');
}
async login(email: string, password: string): Promise<void> {
await this.emailInput.fill(email);
await this.passwordInput.fill(password);
await this.submitButton.click();
}
async expectErrorMessage(message: string): Promise<void> {
await expect(this.errorMessage).toContainText(message);
}
async expectRedirectToDashboard(): Promise<void> {
await expect(this.page).toHaveURL('/dashboard');
}
}
```
## Dashboard Page Object
```typescript
// components/<testing-component>/tests/e2e/pages/dashboard.page.ts
import { Page, Locator, expect } from '@playwright/test';
export class DashboardPage {
readonly page: Page;
readonly welcomeMessage: Locator;
readonly createPlanButton: Locator;
readonly plansList: Locator;
readonly userMenu: Locator;
readonly logoutButton: Locator;
constructor(page: Page) {
this.page = page;
this.welcomeMessage = page.locator('[data-testid="welcome-message"]');
this.createPlanButton = page.locator('[data-testid="create-plan-button"]');
this.plansList = page.locator('[data-testid="plans-list"]');
this.userMenu = page.locator('[data-testid="user-menu"]');
this.logoutButton = page.locator('[data-testid="logout-button"]');
}
async goto(): Promise<void> {
await this.page.goto('/dashboard');
}
async expectWelcomeMessage(name: string): Promise<void> {
await expect(this.welcomeMessage).toContainText(`Welcome, ${name}`);
}
async createNewPlan(): Promise<void> {
await this.createPlanButton.click();
}
async logout(): Promise<void> {
await this.userMenu.click();
await this.logoutButton.click();
}
async getPlanCount(): Promise<number> {
return this.plansList.locator('[data-testid="plan-item"]').count();
}
}
```
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| finishing-a-development-branchobra/superpowersUse when implementation is complete, all tests pass, and you need to decide how to integrate the work | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| systematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixes | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| test-driven-developmentobra/superpowersUse when implementing any feature or bugfix, before writing implementation code | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| skill-creatoranthropics/skillsCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |