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/fixtures-helpers.md
View on GitHub# Test Data Fixtures and Helpers
## Fixtures for Test Data
```typescript
// components/<testing-component>/tests/e2e/fixtures/users.ts
export const testUsers = {
admin: {
email: 'e2e-admin@test.com',
password: 'E2EAdminPass123!',
name: 'E2E Admin',
role: 'admin',
},
planner: {
email: 'e2e-planner@test.com',
password: 'E2EPlannerPass123!',
name: 'E2E Planner',
role: 'planner',
},
viewer: {
email: 'e2e-viewer@test.com',
password: 'E2EViewerPass123!',
name: 'E2E Viewer',
role: 'viewer',
},
};
```
## API Helper for Test Setup
```typescript
// components/<testing-component>/tests/e2e/helpers/api.ts
import { APIRequestContext } from '@playwright/test';
export class TestAPI {
constructor(private request: APIRequestContext) {}
async createUser(userData: {
email: string;
name: string;
password: string;
role: string;
}): Promise<{ id: string }> {
const response = await this.request.post('/api/users', {
data: userData,
});
const body = await response.json();
return body.data;
}
async deleteUser(userId: string): Promise<void> {
await this.request.delete(`/api/users/${userId}`);
}
async createPlan(planData: { name: string; ownerId: string }): Promise<{ id: string }> {
const response = await this.request.post('/api/plans', {
data: planData,
});
const body = await response.json();
return body.data;
}
async cleanup(options: { userIds?: string[]; planIds?: string[] }): Promise<void> {
for (const planId of options.planIds || []) {
await this.request.delete(`/api/plans/${planId}`);
}
for (const userId of options.userIds || []) {
await this.request.delete(`/api/users/${userId}`);
}
}
}
```
## Auth Helper
```typescript
// components/<testing-component>/tests/e2e/helpers/auth.ts
import { Page } from '@playwright/test';
import { LoginPage } from '../pages/login.page';
export const loginAs = async (
page: Page,
credentials: { email: string; password: string }
): Promise<void> => {
const loginPage = new LoginPage(page);
await loginPage.goto();
await loginPage.login(credentials.email, credentials.password);
await loginPage.expectRedirectToDashboard();
};
export const loginWithStorageState = async (
page: Page,
storageStatePath: string
): Promise<void> => {
// Use saved authentication state for faster tests
await page.context().addCookies(require(storageStatePath).cookies);
};
```
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 |