tlc-claude-code 1.2.7 → 1.2.9

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 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
 
package/init.md CHANGED
@@ -88,10 +88,17 @@ Create `.tlc.json`:
88
88
  "run": ["mocha"]
89
89
  },
90
90
  "testCommand": "npm test",
91
- "testDirectory": "test"
91
+ "testDirectory": "test",
92
+ "e2e": {
93
+ "framework": null,
94
+ "directory": "tests/e2e",
95
+ "command": null
96
+ }
92
97
  }
93
98
  ```
94
99
 
100
+ (E2E framework is configured in Step 11)
101
+
95
102
  Add test scripts to package.json:
96
103
  ```json
97
104
  "scripts": {
@@ -283,15 +290,96 @@ This branch is used by:
283
290
  - `/tlc:build` - suggests merging back to this branch
284
291
  - PR reviews - compares against this branch
285
292
 
286
- ### 11. Report Summary
293
+ ### 11. Set Up E2E Testing
294
+
295
+ Check for existing E2E setup:
296
+
297
+ ```bash
298
+ # Detect existing E2E
299
+ if [ -f "playwright.config.ts" ] || [ -f "playwright.config.js" ]; then
300
+ e2e="playwright"
301
+ elif [ -f "cypress.config.ts" ] || [ -f "cypress.config.js" ]; then
302
+ e2e="cypress"
303
+ elif [ -d "tests/e2e" ] || [ -d "e2e" ]; then
304
+ e2e="detected"
305
+ fi
306
+ ```
307
+
308
+ **If no E2E found:**
309
+
310
+ ```
311
+ No E2E testing detected.
312
+
313
+ Set up E2E tests for full user flow verification?
314
+ [1] Yes - Playwright (recommended)
315
+ [2] Yes - Cypress
316
+ [3] No - skip for now
317
+
318
+ Choice [1/2/3]: _
319
+ ```
320
+
321
+ **If Playwright selected:**
322
+
323
+ ```bash
324
+ npm init playwright@latest
325
+ ```
326
+
327
+ Create `playwright.config.ts`:
328
+ ```typescript
329
+ import { defineConfig } from '@playwright/test';
330
+
331
+ export default defineConfig({
332
+ testDir: './tests/e2e',
333
+ baseURL: process.env.BASE_URL || 'http://localhost:5001',
334
+ use: {
335
+ screenshot: 'only-on-failure',
336
+ video: 'retain-on-failure',
337
+ },
338
+ });
339
+ ```
340
+
341
+ Update `.tlc.json`:
342
+ ```json
343
+ {
344
+ "e2e": {
345
+ "framework": "playwright",
346
+ "directory": "tests/e2e",
347
+ "command": "npx playwright test"
348
+ }
349
+ }
350
+ ```
351
+
352
+ Add to `package.json`:
353
+ ```json
354
+ {
355
+ "scripts": {
356
+ "test:e2e": "playwright test",
357
+ "test:e2e:ui": "playwright test --ui"
358
+ }
359
+ }
360
+ ```
361
+
362
+ **If E2E already exists:**
363
+
364
+ ```
365
+ Detected E2E framework: playwright
366
+ E2E directory: tests/e2e
367
+ Existing E2E tests: 5 files
368
+
369
+ Keeping existing E2E setup.
370
+ ```
371
+
372
+ ### 12. Report Summary
287
373
 
288
374
  ```
289
375
  TLC initialized for [project name]
290
376
 
291
377
  Stack: [detected]
292
- Test framework: [framework] (existing/newly configured)
293
- Test directory: [path]
294
- Existing tests: [count] files
378
+ Unit tests: [framework] (existing/newly configured)
379
+ Unit test directory: [path]
380
+ E2E tests: [framework] (existing/newly configured)
381
+ E2E test directory: [path]
382
+ Existing tests: [count] unit, [count] E2E
295
383
  Untested files: [count] identified
296
384
 
297
385
  Next steps:
package/new-project.md CHANGED
@@ -252,7 +252,12 @@ Create `.tlc.json` with default test settings:
252
252
  "run": ["mocha"]
253
253
  },
254
254
  "testCommand": "npm test",
255
- "testDirectory": "test"
255
+ "testDirectory": "test",
256
+ "e2e": {
257
+ "framework": "playwright",
258
+ "directory": "tests/e2e",
259
+ "command": "npx playwright test"
260
+ }
256
261
  }
257
262
  ```
258
263
 
@@ -271,10 +276,13 @@ Scaffold based on chosen stack:
271
276
  ```
272
277
  project/
273
278
  ├── src/
274
- ├── test/
279
+ ├── test/ # Unit tests
280
+ ├── tests/
281
+ │ └── e2e/ # E2E tests (Playwright)
275
282
  ├── .env.example
276
283
  ├── .tlc.json
277
284
  ├── .mocharc.json
285
+ ├── playwright.config.ts # E2E config
278
286
  ├── docker-compose.yml
279
287
  ├── Dockerfile
280
288
  ├── [package.json | pyproject.toml | go.mod]
@@ -309,6 +317,69 @@ Add to `package.json`:
309
317
  }
310
318
  ```
311
319
 
320
+ ### Step 9: Set Up E2E Testing
321
+
322
+ E2E tests verify full user flows in the browser.
323
+
324
+ ```
325
+ Set up E2E testing?
326
+ [1] Playwright (recommended)
327
+ [2] Cypress
328
+ [3] Skip for now
329
+
330
+ Choice [1/2/3]: _
331
+ ```
332
+
333
+ **If Playwright (default):**
334
+
335
+ ```bash
336
+ npm init playwright@latest
337
+ ```
338
+
339
+ Create `playwright.config.ts`:
340
+ ```typescript
341
+ import { defineConfig } from '@playwright/test';
342
+
343
+ export default defineConfig({
344
+ testDir: './tests/e2e',
345
+ baseURL: process.env.BASE_URL || 'http://localhost:5001',
346
+ use: {
347
+ screenshot: 'only-on-failure',
348
+ video: 'retain-on-failure',
349
+ },
350
+ });
351
+ ```
352
+
353
+ Create `tests/e2e/.gitkeep` to establish the directory.
354
+
355
+ Add to `package.json`:
356
+ ```json
357
+ {
358
+ "scripts": {
359
+ "test": "mocha",
360
+ "test:watch": "mocha --watch",
361
+ "test:e2e": "playwright test",
362
+ "test:e2e:ui": "playwright test --ui"
363
+ }
364
+ }
365
+ ```
366
+
367
+ **If Cypress:**
368
+
369
+ ```bash
370
+ npm install -D cypress
371
+ npx cypress open
372
+ ```
373
+
374
+ **Summary output:**
375
+ ```
376
+ ✓ Unit tests: mocha + chai + sinon
377
+ ✓ E2E tests: playwright
378
+ ✓ Test directories: test/ (unit), tests/e2e/ (E2E)
379
+
380
+ Ready to build. Run /tlc:plan to create your first phase.
381
+ ```
382
+
312
383
  ## Usage
313
384
 
314
385
  ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tlc-claude-code",
3
- "version": "1.2.7",
3
+ "version": "1.2.9",
4
4
  "description": "TLC - Test Led Coding for Claude Code",
5
5
  "bin": {
6
6
  "tlc": "./bin/tlc.js",