* refactor: consolidate AGENTS.md and CLAUDE.md files, update tech stack and architecture details - Merged content from CLAUDE.md into AGENTS.md for better organization. - Updated tech stack section to reflect the current technologies used, including Next.js, Supabase, and Tailwind CSS. - Enhanced monorepo structure documentation with detailed directory purposes. - Streamlined multi-tenant architecture explanation and essential commands. - Added key patterns for naming conventions and server actions. - Removed outdated agent files related to Playwright and PostgreSQL, ensuring a cleaner codebase. - Bumped version to 2.23.7 to reflect changes.
61 lines
1.2 KiB
Markdown
61 lines
1.2 KiB
Markdown
# End-to-End Testing
|
|
|
|
## Skills
|
|
|
|
For E2E test implementation:
|
|
- `/playwright-e2e` - Test patterns and Page Objects
|
|
|
|
## Running Tests
|
|
|
|
```bash
|
|
# Single file (preferred)
|
|
pnpm --filter web-e2e exec playwright test <name> --workers=1
|
|
|
|
# All tests
|
|
pnpm test
|
|
```
|
|
|
|
## Page Object Pattern (Required)
|
|
|
|
```typescript
|
|
export class AuthPageObject {
|
|
constructor(private readonly page: Page) {}
|
|
|
|
async signIn(params: { email: string; password: string }) {
|
|
await this.page.fill('input[name="email"]', params.email);
|
|
await this.page.fill('input[name="password"]', params.password);
|
|
await this.page.click('button[type="submit"]');
|
|
}
|
|
}
|
|
```
|
|
|
|
## Selectors
|
|
|
|
Always use `data-test` attributes:
|
|
|
|
```typescript
|
|
await this.page.click('[data-test="submit-button"]');
|
|
await this.page.getByTestId('submit-button').click();
|
|
```
|
|
|
|
## Reliability with `toPass()`
|
|
|
|
```typescript
|
|
await expect(async () => {
|
|
const response = await this.page.waitForResponse(
|
|
resp => resp.url().includes('auth/v1/user')
|
|
);
|
|
expect(response.status()).toBe(200);
|
|
}).toPass();
|
|
```
|
|
|
|
## Test Organization
|
|
|
|
```
|
|
tests/
|
|
├── authentication/
|
|
├── billing/
|
|
├── *.po.ts # Page Objects
|
|
└── utils/
|
|
```
|