tlc-claude-code 1.2.7 → 1.2.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build.md +185 -0
- package/help.md +2 -2
- package/package.json +1 -1
package/build.md
CHANGED
|
@@ -354,6 +354,138 @@ Status: ✅ All tests passing (Green)
|
|
|
354
354
|
{test runner output showing all pass}
|
|
355
355
|
```
|
|
356
356
|
|
|
357
|
+
### Step 10: E2E Testing (Optional)
|
|
358
|
+
|
|
359
|
+
After unit tests pass, offer E2E testing:
|
|
360
|
+
|
|
361
|
+
```
|
|
362
|
+
✅ Unit tests passing (11/11)
|
|
363
|
+
|
|
364
|
+
Run E2E tests?
|
|
365
|
+
[1] Yes - run full E2E suite
|
|
366
|
+
[2] Skip - proceed to verify
|
|
367
|
+
|
|
368
|
+
Choice [1/2]: _
|
|
369
|
+
```
|
|
370
|
+
|
|
371
|
+
**If user chooses E2E:**
|
|
372
|
+
|
|
373
|
+
#### 10a. Detect E2E Framework
|
|
374
|
+
|
|
375
|
+
Check `.tlc.json` or detect from project:
|
|
376
|
+
|
|
377
|
+
```bash
|
|
378
|
+
# Check config
|
|
379
|
+
e2eFramework=$(jq -r '.e2e.framework // ""' .tlc.json)
|
|
380
|
+
|
|
381
|
+
# Or detect
|
|
382
|
+
if [ -f "playwright.config.ts" ]; then
|
|
383
|
+
e2eFramework="playwright"
|
|
384
|
+
elif [ -f "cypress.config.ts" ]; then
|
|
385
|
+
e2eFramework="cypress"
|
|
386
|
+
fi
|
|
387
|
+
```
|
|
388
|
+
|
|
389
|
+
If no E2E framework:
|
|
390
|
+
```
|
|
391
|
+
No E2E framework detected.
|
|
392
|
+
|
|
393
|
+
Set up E2E testing?
|
|
394
|
+
[1] Playwright (recommended)
|
|
395
|
+
[2] Cypress
|
|
396
|
+
[3] Skip for now
|
|
397
|
+
|
|
398
|
+
Choice [1/2/3]: _
|
|
399
|
+
```
|
|
400
|
+
|
|
401
|
+
#### 10b. Generate E2E Tests from Acceptance Criteria
|
|
402
|
+
|
|
403
|
+
Read acceptance criteria from PLAN.md and generate E2E scenarios:
|
|
404
|
+
|
|
405
|
+
```
|
|
406
|
+
Analyzing phase acceptance criteria...
|
|
407
|
+
|
|
408
|
+
E2E scenarios for Phase 1:
|
|
409
|
+
1. User can log in with valid credentials
|
|
410
|
+
2. User sees error for invalid password
|
|
411
|
+
3. User session persists after refresh
|
|
412
|
+
4. User can log out
|
|
413
|
+
|
|
414
|
+
Generate E2E tests? (Y/n)
|
|
415
|
+
```
|
|
416
|
+
|
|
417
|
+
Create `tests/e2e/phase-{N}.spec.ts`:
|
|
418
|
+
|
|
419
|
+
```typescript
|
|
420
|
+
import { test, expect } from '@playwright/test';
|
|
421
|
+
|
|
422
|
+
test.describe('Phase 1: Authentication', () => {
|
|
423
|
+
test('user can log in with valid credentials', async ({ page }) => {
|
|
424
|
+
await page.goto('/login');
|
|
425
|
+
await page.fill('[name="email"]', 'user@test.com');
|
|
426
|
+
await page.fill('[name="password"]', 'password123');
|
|
427
|
+
await page.click('button[type="submit"]');
|
|
428
|
+
|
|
429
|
+
await expect(page).toHaveURL('/dashboard');
|
|
430
|
+
});
|
|
431
|
+
|
|
432
|
+
test('user sees error for invalid password', async ({ page }) => {
|
|
433
|
+
await page.goto('/login');
|
|
434
|
+
await page.fill('[name="email"]', 'user@test.com');
|
|
435
|
+
await page.fill('[name="password"]', 'wrong');
|
|
436
|
+
await page.click('button[type="submit"]');
|
|
437
|
+
|
|
438
|
+
await expect(page.locator('.error')).toContainText('Invalid credentials');
|
|
439
|
+
});
|
|
440
|
+
|
|
441
|
+
// ... more tests from acceptance criteria
|
|
442
|
+
});
|
|
443
|
+
```
|
|
444
|
+
|
|
445
|
+
#### 10c. Run E2E Tests
|
|
446
|
+
|
|
447
|
+
```bash
|
|
448
|
+
# Playwright
|
|
449
|
+
npx playwright test
|
|
450
|
+
|
|
451
|
+
# Cypress
|
|
452
|
+
npx cypress run
|
|
453
|
+
|
|
454
|
+
# Docker (if configured)
|
|
455
|
+
docker-compose --profile test up playwright
|
|
456
|
+
```
|
|
457
|
+
|
|
458
|
+
Output:
|
|
459
|
+
```
|
|
460
|
+
Running E2E tests...
|
|
461
|
+
|
|
462
|
+
✓ user can log in with valid credentials (1.2s)
|
|
463
|
+
✓ user sees error for invalid password (0.8s)
|
|
464
|
+
✓ user session persists after refresh (1.5s)
|
|
465
|
+
✓ user can log out (0.6s)
|
|
466
|
+
|
|
467
|
+
✅ 4 E2E tests passing
|
|
468
|
+
|
|
469
|
+
Phase 1 complete. Ready for /tlc:verify 1
|
|
470
|
+
```
|
|
471
|
+
|
|
472
|
+
#### 10d. E2E Failures
|
|
473
|
+
|
|
474
|
+
If E2E tests fail:
|
|
475
|
+
```
|
|
476
|
+
E2E test failed: user can log in with valid credentials
|
|
477
|
+
|
|
478
|
+
Error: Expected URL '/dashboard', got '/login'
|
|
479
|
+
Screenshot: tests/e2e/screenshots/login-failure.png
|
|
480
|
+
|
|
481
|
+
Options:
|
|
482
|
+
[1] Fix and retry
|
|
483
|
+
[2] Skip E2E (proceed to verify)
|
|
484
|
+
[3] Debug (open headed browser)
|
|
485
|
+
|
|
486
|
+
Choice [1/2/3]: _
|
|
487
|
+
```
|
|
488
|
+
|
|
357
489
|
## Framework Defaults
|
|
358
490
|
|
|
359
491
|
### TLC Default: Mocha Stack
|
|
@@ -425,6 +557,51 @@ Projects can have multiple test frameworks. Configure in `.tlc.json`:
|
|
|
425
557
|
|
|
426
558
|
When running tests, TLC will execute all frameworks in the `run` array.
|
|
427
559
|
|
|
560
|
+
### E2E Framework Configuration
|
|
561
|
+
|
|
562
|
+
Configure E2E testing in `.tlc.json`:
|
|
563
|
+
|
|
564
|
+
```json
|
|
565
|
+
{
|
|
566
|
+
"e2e": {
|
|
567
|
+
"framework": "playwright",
|
|
568
|
+
"baseUrl": "http://localhost:5001",
|
|
569
|
+
"command": "npx playwright test",
|
|
570
|
+
"docker": true
|
|
571
|
+
}
|
|
572
|
+
}
|
|
573
|
+
```
|
|
574
|
+
|
|
575
|
+
**Playwright setup** (recommended):
|
|
576
|
+
```bash
|
|
577
|
+
npm init playwright@latest
|
|
578
|
+
```
|
|
579
|
+
|
|
580
|
+
Creates `playwright.config.ts`:
|
|
581
|
+
```typescript
|
|
582
|
+
import { defineConfig } from '@playwright/test';
|
|
583
|
+
|
|
584
|
+
export default defineConfig({
|
|
585
|
+
testDir: './tests/e2e',
|
|
586
|
+
baseURL: process.env.BASE_URL || 'http://localhost:5001',
|
|
587
|
+
use: {
|
|
588
|
+
screenshot: 'only-on-failure',
|
|
589
|
+
video: 'retain-on-failure',
|
|
590
|
+
},
|
|
591
|
+
});
|
|
592
|
+
```
|
|
593
|
+
|
|
594
|
+
**Cypress setup**:
|
|
595
|
+
```bash
|
|
596
|
+
npm install -D cypress
|
|
597
|
+
npx cypress open
|
|
598
|
+
```
|
|
599
|
+
|
|
600
|
+
**Docker E2E** (already in docker-compose.dev.yml):
|
|
601
|
+
```bash
|
|
602
|
+
docker-compose --profile test up playwright
|
|
603
|
+
```
|
|
604
|
+
|
|
428
605
|
Default pytest.ini (Python):
|
|
429
606
|
```ini
|
|
430
607
|
[pytest]
|
|
@@ -472,6 +649,14 @@ Committed: feat: session management - phase 1
|
|
|
472
649
|
Running tests again...
|
|
473
650
|
✅ 11 tests passing
|
|
474
651
|
|
|
652
|
+
Run E2E tests? [1] Yes [2] Skip: 1
|
|
653
|
+
|
|
654
|
+
Running E2E tests...
|
|
655
|
+
✓ user can log in with valid credentials
|
|
656
|
+
✓ user sees error for invalid password
|
|
657
|
+
✓ session persists after refresh
|
|
658
|
+
✅ 3 E2E tests passing
|
|
659
|
+
|
|
475
660
|
Phase 1 complete. Ready for /tlc:verify 1
|
|
476
661
|
```
|
|
477
662
|
|
package/help.md
CHANGED
|
@@ -37,7 +37,7 @@ Launches the visual dashboard. Detects where you are, shows what's next.
|
|
|
37
37
|
|---------|--------------|
|
|
38
38
|
| `/tlc:discuss` | Shape implementation approach |
|
|
39
39
|
| `/tlc:plan` | Create task plan |
|
|
40
|
-
| `/tlc:build` | Write tests → implement → verify |
|
|
40
|
+
| `/tlc:build` | Write tests → implement → E2E (optional) → verify |
|
|
41
41
|
| `/tlc:verify` | Human acceptance testing |
|
|
42
42
|
|
|
43
43
|
### Quality & Testing
|
|
@@ -49,7 +49,7 @@ Launches the visual dashboard. Detects where you are, shows what's next.
|
|
|
49
49
|
| `/tlc:quality` | Test quality scoring and analysis |
|
|
50
50
|
| `/tlc:edge-cases` | Generate edge case tests |
|
|
51
51
|
| `/tlc:autofix` | Auto-fix failing tests |
|
|
52
|
-
| `/tlc:config` | Configure test frameworks |
|
|
52
|
+
| `/tlc:config` | Configure test frameworks (unit + E2E) |
|
|
53
53
|
|
|
54
54
|
### Utility
|
|
55
55
|
|