docs: update TEA fragment counts and fix playwright-utils code examples
This commit is contained in:
parent
f88f330724
commit
caad5d46ae
|
|
@ -199,7 +199,7 @@ Epic/Release Gate → TEA: *nfr-assess, *trace Phase 2 (release decision)
|
||||||
|
|
||||||
TEA uniquely requires:
|
TEA uniquely requires:
|
||||||
|
|
||||||
- **Extensive domain knowledge**: 32 fragments covering test patterns, CI/CD, fixtures, quality practices, and optional playwright-utils integration
|
- **Extensive domain knowledge**: 33 fragments covering test patterns, CI/CD, fixtures, quality practices, and optional playwright-utils integration
|
||||||
- **Cross-cutting concerns**: Domain-specific testing patterns that apply across all BMad projects (vs project-specific artifacts like PRDs/stories)
|
- **Cross-cutting concerns**: Domain-specific testing patterns that apply across all BMad projects (vs project-specific artifacts like PRDs/stories)
|
||||||
- **Optional integrations**: MCP capabilities (exploratory, verification) and playwright-utils support
|
- **Optional integrations**: MCP capabilities (exploratory, verification) and playwright-utils support
|
||||||
|
|
||||||
|
|
@ -412,8 +412,8 @@ TEA optionally integrates with `@seontechnologies/playwright-utils`, an open-sou
|
||||||
Benefit: Advanced patterns without boilerplate
|
Benefit: Advanced patterns without boilerplate
|
||||||
|
|
||||||
3. `*test-review`:
|
3. `*test-review`:
|
||||||
- Default: Reviews against core knowledge base (21 fragments)
|
- Default: Reviews against core knowledge base (22 fragments)
|
||||||
- **+ playwright-utils**: Reviews against expanded knowledge base (32 fragments: 21 core + 11 playwright-utils)
|
- **+ playwright-utils**: Reviews against expanded knowledge base (33 fragments: 22 core + 11 playwright-utils)
|
||||||
|
|
||||||
Benefit: Reviews include fixture composition, auth patterns, network recording best practices
|
Benefit: Reviews include fixture composition, auth patterns, network recording best practices
|
||||||
|
|
||||||
|
|
@ -423,7 +423,7 @@ TEA optionally integrates with `@seontechnologies/playwright-utils`, an open-sou
|
||||||
|
|
||||||
Benefit: Faster CI feedback, HTTP error detection
|
Benefit: Faster CI feedback, HTTP error detection
|
||||||
|
|
||||||
**Utilities available** (11 total): api-request, network-recorder, auth-session, intercept-network-call, recurse, log, file-utils, burn-in, network-error-monitor, fixtures-composition
|
**Utilities available** (10 total): api-request, network-recorder, auth-session, intercept-network-call, recurse, log, file-utils, burn-in, network-error-monitor, fixtures-composition
|
||||||
|
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -229,7 +229,8 @@ const checkNumberOfTodosInLocalStorage = functionTestStep(
|
||||||
**Implementation**:
|
**Implementation**:
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
// playwright/config/dev.config.ts
|
// playwright/support/fixtures.ts
|
||||||
|
import { test as base } from '@playwright/test';
|
||||||
import { log, captureTestContext } from '@seontechnologies/playwright-utils';
|
import { log, captureTestContext } from '@seontechnologies/playwright-utils';
|
||||||
|
|
||||||
// Configure file logging globally
|
// Configure file logging globally
|
||||||
|
|
@ -241,9 +242,13 @@ log.configure({
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
// In your fixtures
|
// Extend base test with file logging context capture
|
||||||
base.beforeEach(async ({}, testInfo) => {
|
export const test = base.extend({
|
||||||
captureTestContext(testInfo); // Required for file logging
|
// Auto-capture test context for file logging
|
||||||
|
autoTestContext: [async ({}, use, testInfo) => {
|
||||||
|
captureTestContext(testInfo);
|
||||||
|
await use(undefined);
|
||||||
|
}, { auto: true }],
|
||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
@ -350,14 +355,14 @@ log.errorSync('Setup failed');
|
||||||
|
|
||||||
## Log Levels Guide
|
## Log Levels Guide
|
||||||
|
|
||||||
| Level | When to Use | Shows in Report | Shows in Console |
|
| Level | When to Use | Shows in Report | Shows in Console |
|
||||||
| --------- | ----------------------------------- | -------------------- | ---------------- |
|
| --------- | ----------------------------------- | ----------------- | ---------------- |
|
||||||
| `step` | Test organization, major actions | Collapsible steps | Yes |
|
| `step` | Test organization, major actions | Collapsible steps | Yes |
|
||||||
| `info` | General information, state changes | Yes | Yes |
|
| `info` | General information, state changes | Yes | Yes |
|
||||||
| `success` | Successful operations | Yes | Yes |
|
| `success` | Successful operations | Yes | Yes |
|
||||||
| `warning` | Non-critical issues, skipped checks | Yes | Yes |
|
| `warning` | Non-critical issues, skipped checks | Yes | Yes |
|
||||||
| `error` | Failures, exceptions | Yes | Configurable |
|
| `error` | Failures, exceptions | Yes | Configurable |
|
||||||
| `debug` | Detailed data, objects | Yes (attached) | Configurable |
|
| `debug` | Detailed data, objects | Yes (attached) | Configurable |
|
||||||
|
|
||||||
## Comparison with console.log
|
## Comparison with console.log
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -155,7 +155,7 @@ export const test = base.extend(
|
||||||
**For merged fixtures:**
|
**For merged fixtures:**
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { mergeTests } from '@playwright/test';
|
import { test as base, mergeTests } from '@playwright/test';
|
||||||
import { createNetworkErrorMonitorFixture } from '@seontechnologies/playwright-utils/network-error-monitor/fixtures';
|
import { createNetworkErrorMonitorFixture } from '@seontechnologies/playwright-utils/network-error-monitor/fixtures';
|
||||||
|
|
||||||
const networkErrorMonitor = base.extend(
|
const networkErrorMonitor = base.extend(
|
||||||
|
|
@ -174,6 +174,7 @@ export const test = mergeTests(authFixture, networkErrorMonitor);
|
||||||
**Implementation**:
|
**Implementation**:
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
|
import { test as base } from '@playwright/test';
|
||||||
import { createNetworkErrorMonitorFixture } from '@seontechnologies/playwright-utils/network-error-monitor/fixtures';
|
import { createNetworkErrorMonitorFixture } from '@seontechnologies/playwright-utils/network-error-monitor/fixtures';
|
||||||
|
|
||||||
const networkErrorMonitor = base.extend(
|
const networkErrorMonitor = base.extend(
|
||||||
|
|
@ -320,14 +321,14 @@ The monitor has minimal performance impact:
|
||||||
|
|
||||||
## Comparison with Alternatives
|
## Comparison with Alternatives
|
||||||
|
|
||||||
| Approach | Network Error Monitor | Manual afterEach |
|
| Approach | Network Error Monitor | Manual afterEach |
|
||||||
| --------------------------- | ----------------------- | ------------------------ |
|
| --------------------------- | --------------------- | --------------------- |
|
||||||
| **Setup Required** | Zero (auto-enabled) | Every test file |
|
| **Setup Required** | Zero (auto-enabled) | Every test file |
|
||||||
| **Catches Silent Failures** | Yes | Yes (if configured) |
|
| **Catches Silent Failures** | Yes | Yes (if configured) |
|
||||||
| **Structured Artifacts** | JSON attached | Custom impl |
|
| **Structured Artifacts** | JSON attached | Custom impl |
|
||||||
| **Test Failure Safety** | Try/finally | afterEach may not run |
|
| **Test Failure Safety** | Try/finally | afterEach may not run |
|
||||||
| **Opt-Out Mechanism** | Annotation | Custom logic |
|
| **Opt-Out Mechanism** | Annotation | Custom logic |
|
||||||
| **Status Aware** | Respects skip/failed | No |
|
| **Status Aware** | Respects skip/failed | No |
|
||||||
|
|
||||||
## When to Use
|
## When to Use
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue