ccqa 0.3.10 → 0.5.0

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/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  **Your Claude subscription already includes a QA engineer.**
4
4
 
5
- ccqa turns Claude Code into a browser test recorder. Write a spec in Markdown, run `ccqa trace`, and Claude drives your app via [agent-browser](https://github.com/vercel-labs/agent-browser). Every action is recorded and compiled into a deterministic test script you can run in CI. No extra API key. Just `claude`.
5
+ ccqa turns Claude Code into a browser test recorder. Write a spec in YAML, run `ccqa trace`, and Claude drives your app via [agent-browser](https://github.com/vercel-labs/agent-browser). Every action is recorded and compiled into a deterministic test script you can run in CI. No extra API key. Just `claude`.
6
6
 
7
7
  [日本語版 README](./docs/README.ja.md)
8
8
 
@@ -10,7 +10,7 @@ ccqa turns Claude Code into a browser test recorder. Write a spec in Markdown, r
10
10
 
11
11
  ```mermaid
12
12
  flowchart LR
13
- A["Write spec\n(test-spec.md)"] --> B["ccqa trace\n(Claude drives browser)"]
13
+ A["Write spec\n(spec.yaml)"] --> B["ccqa trace\n(Claude drives browser)"]
14
14
  B --> C["ccqa generate\n(LLM → test script)"]
15
15
  C --> D["ccqa run\n(deterministic replay)"]
16
16
  ```
@@ -29,24 +29,22 @@ Requires Node.js **20+**. [agent-browser](https://github.com/vercel-labs/agent-b
29
29
 
30
30
  **1. Write a spec** — by hand, or interactively with [`ccqa draft`](./docs/draft.md)
31
31
 
32
- ```markdown
33
- <!-- .ccqa/features/tasks/test-cases/create-and-complete/test-spec.md -->
34
- ---
32
+ ```yaml
33
+ # .ccqa/features/tasks/test-cases/create-and-complete/spec.yaml
35
34
  title: Create a task and mark it complete
36
- baseUrl: http://localhost:3000
37
- ---
38
35
 
39
- ## Steps
36
+ steps:
37
+ - instruction: |
38
+ Open ${APP_URL}/login. Fill in email and password, submit the form.
39
+ expected: Redirected to /dashboard, user avatar visible in the header
40
40
 
41
- ### Step 1: Log in
42
- - **Instruction**: Fill in email and password, submit the form
43
- - **Expected**: Redirected to /dashboard, user avatar visible in the header
44
-
45
- ### Step 2: Create a new task
46
- - **Instruction**: Click "New Task", fill in the title "Fix login bug", set priority to High, save
47
- - **Expected**: Task appears in the task list with status "Open"
41
+ - instruction: |
42
+ Click "New Task", fill in the title "Fix login bug", set priority to High, save.
43
+ expected: Task appears in the task list with status "Open"
48
44
  ```
49
45
 
46
+ URLs live inside `instruction` strings — either verbatim or via `${ENV_VAR}` references for environment-specific values.
47
+
50
48
  **2. Trace** — Claude drives the browser and records every action
51
49
 
52
50
  ```bash
@@ -65,12 +63,18 @@ ccqa generate tasks/create-and-complete
65
63
  ccqa run tasks/create-and-complete
66
64
  ```
67
65
 
66
+ In CI you can opt in to drift analysis on test failures by passing `--drift` — Claude will explain the failure by comparing the spec against the current codebase. Requires `ANTHROPIC_API_KEY` or a local Claude login.
67
+
68
+ ```bash
69
+ ccqa run tasks/create-and-complete --drift --format github
70
+ ```
71
+
68
72
  ## Features
69
73
 
70
74
  | Feature | Docs |
71
75
  |---|---|
72
76
  | Write specs interactively with Claude | [Draft](./docs/draft.md) |
73
- | Reuse login and other setup steps | [Setup Specs](./docs/setup-specs.md) |
77
+ | Reuse login and other shared step sequences | [Blocks](./docs/blocks.md) |
74
78
  | Assertion helper functions | [Assertions](./docs/assertions.md) |
75
79
  | Auto-fix failing tests | [Auto-fix](./docs/auto-fix.md) |
76
80
  | Detect spec/code drift in CI | [Drift](./docs/drift.md) |
@@ -79,15 +83,13 @@ ccqa run tasks/create-and-complete
79
83
 
80
84
  ```
81
85
  ccqa draft [feature/spec] Co-author a test spec with Claude
82
- ccqa drift [feature/spec] Check spec codebase drift (CI-friendly)
83
- ccqa trace <feature/spec> Record browser actions
86
+ ccqa trace <feature/spec> Record browser actions for a spec (inlines any included blocks)
84
87
  ccqa generate <feature/spec> Generate test script from recorded actions
85
- ccqa run [feature/spec] Execute generated test scripts
86
- ccqa trace-setup <name> Record actions for a setup spec
87
- ccqa generate-setup <name> Generate and validate setup test script
88
+ ccqa run [feature/spec] Execute generated test scripts (add --drift to analyze failures)
89
+ ccqa drift [feature/spec] Standalone spec ↔ codebase drift audit (for scheduled jobs)
88
90
  ```
89
91
 
90
- All Claude-driven commands accept `-m, --model <name>` (alias `sonnet` | `opus` | `haiku`, or a full model ID). The flag overrides `CCQA_MODEL`; when both are unset, the Claude Code CLI default is used. Interactive commands authenticate via your local Claude Code login; `ccqa drift` additionally honors `ANTHROPIC_API_KEY` for CI.
92
+ All Claude-driven commands accept `-m, --model <name>` (alias `sonnet` | `opus` | `haiku`, or a full model ID). The flag overrides `CCQA_MODEL`; when both are unset, the Claude Code CLI default is used. Interactive commands authenticate via your local Claude Code login; commands that talk to Claude in CI (`ccqa run --drift`, `ccqa drift`) additionally honor `ANTHROPIC_API_KEY`.
91
93
 
92
94
  `<feature/spec>` is a 2-segment alias for the on-disk path `.ccqa/features/<feature>/test-cases/<spec>/`.
93
95
 
@@ -95,15 +97,14 @@ All Claude-driven commands accept `-m, --model <name>` (alias `sonnet` | `opus`
95
97
 
96
98
  ```
97
99
  .ccqa/
98
- setups/
100
+ blocks/
99
101
  login/
100
- setup-spec.md # Setup definition with placeholders
101
- test.spec.ts # Generated setup script
102
+ spec.yaml # Reusable block (params + steps)
102
103
  features/
103
104
  tasks/
104
105
  test-cases/
105
106
  create-and-complete/
106
- test-spec.md # Test definition
107
+ spec.yaml # Test definition
107
108
  actions.json # Recorded actions from trace
108
109
  test.spec.ts # Generated test script
109
110
  ```