evizi-kit 1.0.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 +506 -0
- package/kits/agent/.agent/skills/claude-code-subagent-creator/SKILL.md +292 -0
- package/kits/agent/.agent/skills/claude-code-subagent-creator/references/claude-code-subagent-configuration.md +158 -0
- package/kits/agent/.agent/skills/claude-code-subagent-creator/templates/subagent-profile.template.md +26 -0
- package/kits/agent/.agent/skills/skill-creator/LICENSE.txt +202 -0
- package/kits/agent/.agent/skills/skill-creator/SKILL.md +485 -0
- package/kits/agent/.agent/skills/skill-creator/agents/analyzer.md +274 -0
- package/kits/agent/.agent/skills/skill-creator/agents/comparator.md +202 -0
- package/kits/agent/.agent/skills/skill-creator/agents/grader.md +223 -0
- package/kits/agent/.agent/skills/skill-creator/assets/eval_review.html +146 -0
- package/kits/agent/.agent/skills/skill-creator/eval-viewer/generate_review.py +471 -0
- package/kits/agent/.agent/skills/skill-creator/eval-viewer/viewer.html +1325 -0
- package/kits/agent/.agent/skills/skill-creator/references/schemas.md +430 -0
- package/kits/agent/.agent/skills/skill-creator/scripts/__init__.py +0 -0
- package/kits/agent/.agent/skills/skill-creator/scripts/aggregate_benchmark.py +401 -0
- package/kits/agent/.agent/skills/skill-creator/scripts/generate_report.py +326 -0
- package/kits/agent/.agent/skills/skill-creator/scripts/improve_description.py +247 -0
- package/kits/agent/.agent/skills/skill-creator/scripts/package_skill.py +136 -0
- package/kits/agent/.agent/skills/skill-creator/scripts/quick_validate.py +103 -0
- package/kits/agent/.agent/skills/skill-creator/scripts/run_eval.py +310 -0
- package/kits/agent/.agent/skills/skill-creator/scripts/run_loop.py +328 -0
- package/kits/agent/.agent/skills/skill-creator/scripts/utils.py +47 -0
- package/kits/agent/manifest.json +10 -0
- package/kits/claude/.claude/agents/code-pusher.md +46 -0
- package/kits/claude/.claude/agents/feature-document-updater.md +37 -0
- package/kits/claude/.claude/agents/self-reviewer.md +32 -0
- package/kits/claude/.claude/agents/web-auto-agentic-workflow-initializer.md +42 -0
- package/kits/claude/.claude/agents/web-auto-assisted-fix-and-runner.md +36 -0
- package/kits/claude/.claude/agents/web-auto-chrome-devtools-selector-extractor.md +36 -0
- package/kits/claude/.claude/agents/web-auto-coder.md +33 -0
- package/kits/claude/.claude/agents/web-auto-fe-selector-extractor.md +31 -0
- package/kits/claude/.claude/agents/web-auto-fix-and-runner.md +35 -0
- package/kits/claude/.claude/agents/web-auto-lessons-learned-extractor.md +34 -0
- package/kits/claude/.claude/agents/web-auto-playwright-mcp-selector-extractor.md +37 -0
- package/kits/claude/.claude/agents/web-auto-source-instructions-updater.md +43 -0
- package/kits/claude/.claude/agents/web-auto-test-cases-generator.md +29 -0
- package/kits/claude/.claude/agents/web-auto-ticket-designer.md +35 -0
- package/kits/claude/.claude/agents/web-auto-ticket-playbook-planner.md +36 -0
- package/kits/claude/.claude/agents/web-auto.md +382 -0
- package/kits/claude/.claude/skills/claude-code-subagent-creator/SKILL.md +292 -0
- package/kits/claude/.claude/skills/claude-code-subagent-creator/references/claude-code-subagent-configuration.md +158 -0
- package/kits/claude/.claude/skills/claude-code-subagent-creator/templates/subagent-profile.template.md +26 -0
- package/kits/claude/.claude/skills/skill-creator/LICENSE.txt +202 -0
- package/kits/claude/.claude/skills/skill-creator/SKILL.md +485 -0
- package/kits/claude/.claude/skills/skill-creator/agents/analyzer.md +274 -0
- package/kits/claude/.claude/skills/skill-creator/agents/comparator.md +202 -0
- package/kits/claude/.claude/skills/skill-creator/agents/grader.md +223 -0
- package/kits/claude/.claude/skills/skill-creator/assets/eval_review.html +146 -0
- package/kits/claude/.claude/skills/skill-creator/eval-viewer/generate_review.py +471 -0
- package/kits/claude/.claude/skills/skill-creator/eval-viewer/viewer.html +1325 -0
- package/kits/claude/.claude/skills/skill-creator/references/schemas.md +430 -0
- package/kits/claude/.claude/skills/skill-creator/scripts/__init__.py +0 -0
- package/kits/claude/.claude/skills/skill-creator/scripts/aggregate_benchmark.py +401 -0
- package/kits/claude/.claude/skills/skill-creator/scripts/generate_report.py +326 -0
- package/kits/claude/.claude/skills/skill-creator/scripts/improve_description.py +247 -0
- package/kits/claude/.claude/skills/skill-creator/scripts/package_skill.py +136 -0
- package/kits/claude/.claude/skills/skill-creator/scripts/quick_validate.py +103 -0
- package/kits/claude/.claude/skills/skill-creator/scripts/run_eval.py +310 -0
- package/kits/claude/.claude/skills/skill-creator/scripts/run_loop.py +328 -0
- package/kits/claude/.claude/skills/skill-creator/scripts/utils.py +47 -0
- package/kits/claude/manifest.json +10 -0
- package/kits/cursor/.cursor/agents/code-pusher.agent.md +43 -0
- package/kits/cursor/.cursor/agents/feature-document-updater.agent.md +34 -0
- package/kits/cursor/.cursor/agents/self-reviewer.agent.md +29 -0
- package/kits/cursor/.cursor/agents/web-auto-agentic-workflow-initializer.agent.md +37 -0
- package/kits/cursor/.cursor/agents/web-auto-assisted-fix-and-runner.agent.md +33 -0
- package/kits/cursor/.cursor/agents/web-auto-chrome-devtools-selector-extractor.agent.md +31 -0
- package/kits/cursor/.cursor/agents/web-auto-coder.agent.md +30 -0
- package/kits/cursor/.cursor/agents/web-auto-fe-selector-extractor.agent.md +28 -0
- package/kits/cursor/.cursor/agents/web-auto-fix-and-runner.agent.md +32 -0
- package/kits/cursor/.cursor/agents/web-auto-lessons-learned-extractor.agent.md +31 -0
- package/kits/cursor/.cursor/agents/web-auto-playwright-mcp-selector-extractor.agent.md +32 -0
- package/kits/cursor/.cursor/agents/web-auto-source-instructions-updater.agent.md +40 -0
- package/kits/cursor/.cursor/agents/web-auto-test-cases-generator.agent.md +26 -0
- package/kits/cursor/.cursor/agents/web-auto-ticket-designer.agent.md +32 -0
- package/kits/cursor/.cursor/agents/web-auto-ticket-playbook-planner.agent.md +33 -0
- package/kits/cursor/.cursor/agents/web-auto.agent.md +379 -0
- package/kits/cursor/.cursor/skills/claude-code-subagent-creator/SKILL.md +292 -0
- package/kits/cursor/.cursor/skills/claude-code-subagent-creator/references/claude-code-subagent-configuration.md +158 -0
- package/kits/cursor/.cursor/skills/claude-code-subagent-creator/templates/subagent-profile.template.md +26 -0
- package/kits/cursor/.cursor/skills/skill-creator/LICENSE.txt +202 -0
- package/kits/cursor/.cursor/skills/skill-creator/SKILL.md +485 -0
- package/kits/cursor/.cursor/skills/skill-creator/agents/analyzer.md +274 -0
- package/kits/cursor/.cursor/skills/skill-creator/agents/comparator.md +202 -0
- package/kits/cursor/.cursor/skills/skill-creator/agents/grader.md +223 -0
- package/kits/cursor/.cursor/skills/skill-creator/assets/eval_review.html +146 -0
- package/kits/cursor/.cursor/skills/skill-creator/eval-viewer/generate_review.py +471 -0
- package/kits/cursor/.cursor/skills/skill-creator/eval-viewer/viewer.html +1325 -0
- package/kits/cursor/.cursor/skills/skill-creator/references/schemas.md +430 -0
- package/kits/cursor/.cursor/skills/skill-creator/scripts/__init__.py +0 -0
- package/kits/cursor/.cursor/skills/skill-creator/scripts/aggregate_benchmark.py +401 -0
- package/kits/cursor/.cursor/skills/skill-creator/scripts/generate_report.py +326 -0
- package/kits/cursor/.cursor/skills/skill-creator/scripts/improve_description.py +247 -0
- package/kits/cursor/.cursor/skills/skill-creator/scripts/package_skill.py +136 -0
- package/kits/cursor/.cursor/skills/skill-creator/scripts/quick_validate.py +103 -0
- package/kits/cursor/.cursor/skills/skill-creator/scripts/run_eval.py +310 -0
- package/kits/cursor/.cursor/skills/skill-creator/scripts/run_loop.py +328 -0
- package/kits/cursor/.cursor/skills/skill-creator/scripts/utils.py +47 -0
- package/kits/cursor/manifest.json +10 -0
- package/kits/github/.github/agents/code-pusher.agent.md +45 -0
- package/kits/github/.github/agents/feature-document-updater.agent.md +36 -0
- package/kits/github/.github/agents/self-reviewer.agent.md +31 -0
- package/kits/github/.github/agents/web-auto-agentic-workflow-initializer.agent.md +39 -0
- package/kits/github/.github/agents/web-auto-assisted-fix-and-runner.agent.md +35 -0
- package/kits/github/.github/agents/web-auto-chrome-devtools-selector-extractor.agent.md +33 -0
- package/kits/github/.github/agents/web-auto-coder.agent.md +32 -0
- package/kits/github/.github/agents/web-auto-fe-selector-extractor.agent.md +30 -0
- package/kits/github/.github/agents/web-auto-fix-and-runner.agent.md +34 -0
- package/kits/github/.github/agents/web-auto-lessons-learned-extractor.agent.md +33 -0
- package/kits/github/.github/agents/web-auto-playwright-mcp-selector-extractor.agent.md +34 -0
- package/kits/github/.github/agents/web-auto-source-instructions-updater.agent.md +42 -0
- package/kits/github/.github/agents/web-auto-test-cases-generator.agent.md +28 -0
- package/kits/github/.github/agents/web-auto-ticket-designer.agent.md +34 -0
- package/kits/github/.github/agents/web-auto-ticket-playbook-creator.agent.md +35 -0
- package/kits/github/.github/agents/web-auto.agent.md +382 -0
- package/kits/github/.github/skills/claude-code-subagent-creator/SKILL.md +310 -0
- package/kits/github/.github/skills/claude-code-subagent-creator/references/claude-code-subagent-configuration.md +158 -0
- package/kits/github/.github/skills/claude-code-subagent-creator/templates/subagent-profile.template.md +37 -0
- package/kits/github/.github/skills/skill-creator/LICENSE.txt +202 -0
- package/kits/github/.github/skills/skill-creator/SKILL.md +485 -0
- package/kits/github/.github/skills/skill-creator/agents/analyzer.md +274 -0
- package/kits/github/.github/skills/skill-creator/agents/comparator.md +202 -0
- package/kits/github/.github/skills/skill-creator/agents/grader.md +223 -0
- package/kits/github/.github/skills/skill-creator/assets/eval_review.html +146 -0
- package/kits/github/.github/skills/skill-creator/eval-viewer/generate_review.py +471 -0
- package/kits/github/.github/skills/skill-creator/eval-viewer/viewer.html +1325 -0
- package/kits/github/.github/skills/skill-creator/references/schemas.md +430 -0
- package/kits/github/.github/skills/skill-creator/scripts/__init__.py +0 -0
- package/kits/github/.github/skills/skill-creator/scripts/aggregate_benchmark.py +401 -0
- package/kits/github/.github/skills/skill-creator/scripts/generate_report.py +326 -0
- package/kits/github/.github/skills/skill-creator/scripts/improve_description.py +247 -0
- package/kits/github/.github/skills/skill-creator/scripts/package_skill.py +136 -0
- package/kits/github/.github/skills/skill-creator/scripts/quick_validate.py +103 -0
- package/kits/github/.github/skills/skill-creator/scripts/run_eval.py +310 -0
- package/kits/github/.github/skills/skill-creator/scripts/run_loop.py +328 -0
- package/kits/github/.github/skills/skill-creator/scripts/utils.py +47 -0
- package/kits/github/manifest.json +10 -0
- package/kits/shared/docs/ai-code-review.md +440 -0
- package/kits/shared/docs/increase-unit-test-coverage.md +77 -0
- package/kits/shared/docs/pr-review-agent.md +501 -0
- package/kits/shared/docs/self-review-agent.md +246 -0
- package/kits/shared/docs/web-auto-agentic-workflow.md +506 -0
- package/kits/shared/manifest.json +11 -0
- package/kits/shared/skills/fix-automation-tests/SKILL.md +280 -0
- package/kits/shared/skills/fix-automation-tests/scripts/fetch_pr_changes.py +300 -0
- package/kits/shared/skills/fix-automation-tests/templates/impact-report.template.md +42 -0
- package/kits/shared/skills/increase-unit-test-coverage/SKILL.md +117 -0
- package/kits/shared/skills/increase-unit-test-coverage/scripts/filter_low_coverage.py +447 -0
- package/kits/shared/skills/pr-review/SKILL.md +200 -0
- package/kits/shared/skills/pr-review/references/automation.md +62 -0
- package/kits/shared/skills/pr-review/references/backend.md +95 -0
- package/kits/shared/skills/pr-review/references/frontend.md +103 -0
- package/kits/shared/skills/pr-review/references/mobile.md +108 -0
- package/kits/shared/skills/pr-review/references/output-schema.md +130 -0
- package/kits/shared/skills/pr-review/scripts/post-review.py +1395 -0
- package/kits/shared/skills/push-code/SKILL.md +176 -0
- package/kits/shared/skills/self-review/SKILL.md +234 -0
- package/kits/shared/skills/self-review/evals/evals.json +23 -0
- package/kits/shared/skills/self-review/references/automation.md +62 -0
- package/kits/shared/skills/self-review/references/backend.md +95 -0
- package/kits/shared/skills/self-review/references/frontend.md +103 -0
- package/kits/shared/skills/self-review/references/mobile.md +108 -0
- package/kits/shared/skills/self-review/templates/issues.template.md +72 -0
- package/kits/shared/skills/update-feature-document/SKILL.md +156 -0
- package/kits/shared/skills/update-feature-document/templates/delta.template.yaml +58 -0
- package/kits/shared/skills/update-feature-document/templates/feature.template.md +25 -0
- package/kits/shared/skills/web-auto-assisted-fix-and-run/SKILL.md +130 -0
- package/kits/shared/skills/web-auto-assisted-fix-and-run/references/resolve-api-error.md +108 -0
- package/kits/shared/skills/web-auto-assisted-fix-and-run/references/resolve-selector.md +60 -0
- package/kits/shared/skills/web-auto-assisted-fix-and-run/templates/issues-resolution-report-append.template.md +54 -0
- package/kits/shared/skills/web-auto-chrome-devtools-mcp-extract-selectors/SKILL.md +284 -0
- package/kits/shared/skills/web-auto-coding/SKILL.md +152 -0
- package/kits/shared/skills/web-auto-extract-lessons-learned/SKILL.md +168 -0
- package/kits/shared/skills/web-auto-extract-lessons-learned/templates/lessons-learned.template.md +115 -0
- package/kits/shared/skills/web-auto-fe-extract-selectors/SKILL.md +282 -0
- package/kits/shared/skills/web-auto-fe-extract-selectors/evals/evals.json +23 -0
- package/kits/shared/skills/web-auto-fix-and-run-test/SKILL.md +183 -0
- package/kits/shared/skills/web-auto-fix-and-run-test/templates/issues-resolution-report.template.md +77 -0
- package/kits/shared/skills/web-auto-generate-best-practices/SKILL.md +123 -0
- package/kits/shared/skills/web-auto-generate-instructions/SKILL.md +200 -0
- package/kits/shared/skills/web-auto-generate-instructions/evals/evals.json +23 -0
- package/kits/shared/skills/web-auto-generate-instructions/references/analysis-guide.md +145 -0
- package/kits/shared/skills/web-auto-generate-instructions/templates/web-auto-instructions.template.md +184 -0
- package/kits/shared/skills/web-auto-generate-project-blueprint/SKILL.md +181 -0
- package/kits/shared/skills/web-auto-generate-project-blueprint/evals/evals.json +57 -0
- package/kits/shared/skills/web-auto-generate-project-blueprint/templates/web-auto-project-blueprint.template.md +161 -0
- package/kits/shared/skills/web-auto-playwright-mcp-extract-selectors/SKILL.md +293 -0
- package/kits/shared/skills/web-auto-test-cases/SKILL.md +138 -0
- package/kits/shared/skills/web-auto-test-cases/evals/evals.json +129 -0
- package/kits/shared/skills/web-auto-test-cases/templates/test-cases.template.md +53 -0
- package/kits/shared/skills/web-auto-ticket-design/SKILL.md +199 -0
- package/kits/shared/skills/web-auto-ticket-design/templates/ticket-design.template.md +138 -0
- package/kits/shared/skills/web-auto-ticket-playbook/SKILL.md +218 -0
- package/kits/shared/skills/web-auto-ticket-playbook/evals/evals.json +23 -0
- package/kits/shared/skills/web-auto-ticket-playbook/templates/ticket-playbook.template.md +148 -0
- package/kits/shared/skills/web-auto-update-source-instructions/SKILL.md +156 -0
- package/kits/shared/skills/web-auto-update-source-instructions/evals/evals.json +22 -0
- package/kits/shared/skills/workspace-ai-nav-creator/SKILL.md +168 -0
- package/kits/shared/skills/workspace-ai-nav-creator/templates/agents-md.template.md +112 -0
- package/kits/shared/skills/workspace-ai-nav-creator/templates/claude-md.template.md +86 -0
- package/package.json +16 -0
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
# Web Automation Project Blueprint
|
|
2
|
+
|
|
3
|
+
> **Purpose**: Describes what this automation project is — its tech stack, directory structure, naming conventions, selector strategy, configuration, global setup, integrations, and CI/CD pipeline. This is the foundational reference for understanding the project before writing any tests.
|
|
4
|
+
>
|
|
5
|
+
> **Related documents**:
|
|
6
|
+
> - `.documents-design/web-auto-best-practices.md` — coding standards, rules, and anti-patterns
|
|
7
|
+
> - `.documents-design/web-auto-instructions.md` — copy-paste code templates from the actual codebase
|
|
8
|
+
|
|
9
|
+
## 1. Tech Stack
|
|
10
|
+
|
|
11
|
+
| Aspect | Value |
|
|
12
|
+
|--------|-------|
|
|
13
|
+
| Framework | [framework name and version] |
|
|
14
|
+
| Language | [language and version] |
|
|
15
|
+
| Test runner | [test runner name] |
|
|
16
|
+
| Assertion library | [assertion library name] |
|
|
17
|
+
| Reporter | [reporter name, e.g., Allure, HTML, JUnit XML] |
|
|
18
|
+
| Package manager | [e.g., npm, yarn, pip, Maven] |
|
|
19
|
+
|
|
20
|
+
### Multiple Frameworks
|
|
21
|
+
|
|
22
|
+
[If the project uses more than one test framework (e.g., Cypress for component tests + Playwright for E2E), document each one here with its scope. Remove this subsection if only one framework is used.]
|
|
23
|
+
|
|
24
|
+
| Framework | Scope | Config File |
|
|
25
|
+
|-----------|-------|-------------|
|
|
26
|
+
| [framework 1] | [e.g., E2E tests] | [config path] |
|
|
27
|
+
| [framework 2] | [e.g., component tests] | [config path] |
|
|
28
|
+
|
|
29
|
+
## 2. Key Configuration
|
|
30
|
+
|
|
31
|
+
Source: `[config file path]`
|
|
32
|
+
|
|
33
|
+
| Setting | Value |
|
|
34
|
+
|---------|-------|
|
|
35
|
+
| Base URL | [value] |
|
|
36
|
+
| Test directory | [path] |
|
|
37
|
+
| Global timeout | [value] |
|
|
38
|
+
| Retries | [value] |
|
|
39
|
+
| Workers / parallelism | [value] |
|
|
40
|
+
| Browsers / devices | [list] |
|
|
41
|
+
| Headless | [yes / no / env-controlled] |
|
|
42
|
+
| Screenshots | [when captured] |
|
|
43
|
+
| Video / trace | [when captured] |
|
|
44
|
+
|
|
45
|
+
### Environment Variables
|
|
46
|
+
|
|
47
|
+
| Variable | Purpose |
|
|
48
|
+
|----------|---------|
|
|
49
|
+
| [variable name] | [what it controls] |
|
|
50
|
+
|
|
51
|
+
## 3. Global Setup, Fixtures, and Auth
|
|
52
|
+
|
|
53
|
+
### Global Setup / Teardown
|
|
54
|
+
|
|
55
|
+
| Mechanism | File | Purpose |
|
|
56
|
+
|-----------|------|---------|
|
|
57
|
+
| [e.g., globalSetup] | [file path] | [what it does] |
|
|
58
|
+
|
|
59
|
+
### Authentication Strategy
|
|
60
|
+
|
|
61
|
+
[Describe how the project handles login for tests — e.g., stored `storageState` from a setup project, API-based auth in `beforeAll`, environment-based credentials, etc.]
|
|
62
|
+
|
|
63
|
+
### Shared Fixtures / Test Data
|
|
64
|
+
|
|
65
|
+
| Fixture Type | Location | Description |
|
|
66
|
+
|--------------|----------|-------------|
|
|
67
|
+
| [e.g., auth state] | [path] | [what it provides] |
|
|
68
|
+
| [e.g., test data factory] | [path] | [what it provides] |
|
|
69
|
+
|
|
70
|
+
### Custom Test Abstractions
|
|
71
|
+
|
|
72
|
+
| Abstraction | File | Purpose |
|
|
73
|
+
|-------------|------|---------|
|
|
74
|
+
| [e.g., BasePage class] | [path] | [what it provides to subclasses] |
|
|
75
|
+
| [e.g., custom test wrapper] | [path] | [what it adds to the base test runner] |
|
|
76
|
+
|
|
77
|
+
## 4. Directory Structure
|
|
78
|
+
|
|
79
|
+
```
|
|
80
|
+
[Full test-related directory tree from the project root]
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
## 5. File & Naming Conventions
|
|
84
|
+
|
|
85
|
+
| File Type | Location | Naming Pattern | Example |
|
|
86
|
+
|-----------|----------|----------------|---------|
|
|
87
|
+
| Test spec | [path] | [pattern] | [real example] |
|
|
88
|
+
| Page Object | [path] | [pattern] | [real example] |
|
|
89
|
+
| Test data / fixture | [path] | [pattern] | [real example] |
|
|
90
|
+
| API / backend helper | [path] | [pattern] | [real example] |
|
|
91
|
+
| Type definition / model | [path] | [pattern] | [real example] |
|
|
92
|
+
| Utility / helper | [path] | [pattern] | [real example] |
|
|
93
|
+
|
|
94
|
+
### Class & Module Naming
|
|
95
|
+
|
|
96
|
+
| Type | Convention | Example |
|
|
97
|
+
|------|------------|---------|
|
|
98
|
+
| Page Object class | [pattern] | [real example] |
|
|
99
|
+
| Helper module | [pattern] | [real example] |
|
|
100
|
+
| Test data constant | [pattern] | [real example] |
|
|
101
|
+
|
|
102
|
+
### Test ID Scheme
|
|
103
|
+
|
|
104
|
+
[Describe the test ID convention used, e.g., `[ABBR]-[NUM]: Description` where ABBR is a 2-4 letter feature abbreviation. Omit this subsection if no test ID scheme exists.]
|
|
105
|
+
|
|
106
|
+
## 6. Selector Strategy
|
|
107
|
+
|
|
108
|
+
> This defines the priority order for locating elements. Follow this order when writing new selectors.
|
|
109
|
+
|
|
110
|
+
| Priority | Strategy | Real Example from This Project |
|
|
111
|
+
|----------|----------|-------------------------------|
|
|
112
|
+
| 1 | [highest priority — e.g., `data-testid`] | [real selector] |
|
|
113
|
+
| 2 | [second priority — e.g., ARIA role] | [real selector] |
|
|
114
|
+
| 3 | [third priority — e.g., semantic CSS] | [real selector] |
|
|
115
|
+
| 4 | [last resort — e.g., XPath] | [real selector] |
|
|
116
|
+
|
|
117
|
+
### Framework-Specific Selector Constraints
|
|
118
|
+
|
|
119
|
+
[Document any constraints imposed by the framework on how selectors must be declared — e.g., sync vs async rules, locator API usage. Omit if none.]
|
|
120
|
+
|
|
121
|
+
## 7. Third-Party Integrations
|
|
122
|
+
|
|
123
|
+
| Category | Library | Purpose |
|
|
124
|
+
|----------|---------|---------|
|
|
125
|
+
| [e.g., API mocking] | [library name] | [what it's used for in this project] |
|
|
126
|
+
| [e.g., Visual testing] | [library name] | [what it's used for] |
|
|
127
|
+
| [e.g., Accessibility] | [library name] | [what it's used for] |
|
|
128
|
+
| [e.g., BDD] | [library name] | [what it's used for] |
|
|
129
|
+
|
|
130
|
+
## 8. CI/CD Pipeline
|
|
131
|
+
|
|
132
|
+
| Aspect | Value |
|
|
133
|
+
|--------|-------|
|
|
134
|
+
| Platform | [e.g., GitHub Actions, GitLab CI, Jenkins] |
|
|
135
|
+
| Config file | [path to CI config] |
|
|
136
|
+
| Trigger events | [e.g., push to main, PR, nightly schedule] |
|
|
137
|
+
|
|
138
|
+
### Pipeline Steps (test-related)
|
|
139
|
+
|
|
140
|
+
| Step | Description |
|
|
141
|
+
|------|-------------|
|
|
142
|
+
| [step name] | [what it does] |
|
|
143
|
+
|
|
144
|
+
### CI Environment
|
|
145
|
+
|
|
146
|
+
| Variable / Secret | Purpose |
|
|
147
|
+
|-------------------|---------|
|
|
148
|
+
| [variable name] | [what it controls] |
|
|
149
|
+
|
|
150
|
+
## 9. Test Execution Commands
|
|
151
|
+
|
|
152
|
+
| Action | Command |
|
|
153
|
+
|--------|---------|
|
|
154
|
+
| Run all tests | [command] |
|
|
155
|
+
| Run a specific file | [command] |
|
|
156
|
+
| Run by tag / suite | [command] |
|
|
157
|
+
| Run in headed mode | [command, if applicable] |
|
|
158
|
+
| Debug a test | [command, if applicable] |
|
|
159
|
+
| View report | [command, if applicable] |
|
|
160
|
+
| Lint / format | [command] |
|
|
161
|
+
| Type / static check | [command, if applicable] |
|
|
@@ -0,0 +1,293 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: web-auto-playwright-mcp-extract-selectors
|
|
3
|
+
description: Update placeholder selectors in a ticket-design.md file by using a Playwright MCP server to navigate the running application and extract actual selectors from the live DOM. Reads ticket-design.md, finds all steps with "Update selector for this element" placeholders, operates the test case steps via the Playwright MCP browser, takes accessibility-tree snapshots to identify elements, and replaces each placeholder with the real selector. Use this skill whenever someone asks to update selectors using Playwright MCP, fill in missing selectors via Playwright, resolve placeholder selectors by browsing the app, extract real selectors from a running app via Playwright, or navigate the live page to find element locators — even if phrased casually like "open the app and grab the selectors", "use Playwright to find the test IDs", or "browse and fill in selectors". Triggers on requests like "update selectors via MCP for TKT-001", "fill in selectors using Playwright for ABC-123", "resolve missing selectors by browsing for ticket fe-2026", "use playwright to extract selectors", "browse the app and find selectors for ticket X".
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Web Automation Update Selectors (Playwright MCP)
|
|
7
|
+
|
|
8
|
+
Read a `ticket-design.md` file for a given ticket ID, find all steps that contain the `<-- Update selector for this element -->` placeholder, use a Playwright MCP server to navigate through the application following the test case steps, extract actual selectors from the live DOM, and update the ticket design in place.
|
|
9
|
+
|
|
10
|
+
## Input Parameters
|
|
11
|
+
|
|
12
|
+
| Parameter | Type | Required | Description |
|
|
13
|
+
|-----------|------|----------|-------------|
|
|
14
|
+
| `TICKET_ID` | string | Yes | The ticket identifier (e.g., TKT-001, ABC-123) |
|
|
15
|
+
|
|
16
|
+
**If `TICKET_ID` is not provided:** Ask the user for the ticket ID before proceeding.
|
|
17
|
+
|
|
18
|
+
## Prerequisites
|
|
19
|
+
|
|
20
|
+
- A Playwright MCP server must be available and configured in the agent profile
|
|
21
|
+
- The application under test must be running and accessible in a browser
|
|
22
|
+
|
|
23
|
+
## Playwright MCP Tool Reference
|
|
24
|
+
|
|
25
|
+
This skill uses the Playwright MCP server. The key tools and their signatures are:
|
|
26
|
+
|
|
27
|
+
| Tool | Purpose | Key Parameters |
|
|
28
|
+
|------|---------|----------------|
|
|
29
|
+
| `browser_navigate` | Navigate to a URL | `url` (required) |
|
|
30
|
+
| `browser_snapshot` | Capture the page's accessibility tree with element references | — |
|
|
31
|
+
| `browser_click` | Click on an element identified by its `ref` from snapshot | `element` (human-readable description), `ref` (element reference from snapshot) |
|
|
32
|
+
| `browser_type` | Type text into an input element | `element` (description), `ref` (element reference), `text` (value to type), `submit` (optional, press Enter after) |
|
|
33
|
+
| `browser_select_option` | Select an option from a `<select>` element | `element` (description), `ref` (element reference), `values` (array of option values) |
|
|
34
|
+
| `browser_hover` | Hover over an element | `element` (description), `ref` (element reference) |
|
|
35
|
+
| `browser_drag` | Drag an element to a target location | `startElement` (description), `startRef`, `endElement`, `endRef` |
|
|
36
|
+
| `browser_press_key` | Press a key or key combination | `key` (e.g., `"Enter"`, `"Control+A"`) |
|
|
37
|
+
| `browser_run_javascript` | Execute JavaScript in the browser context | `code` (JavaScript code string) |
|
|
38
|
+
| `browser_tab_list` | List all open browser tabs | — |
|
|
39
|
+
| `browser_tab_new` | Open a new tab | `url` (optional) |
|
|
40
|
+
| `browser_tab_select` | Select a tab by index | `index` (required) |
|
|
41
|
+
| `browser_tab_close` | Close a tab | `index` (optional, defaults to current) |
|
|
42
|
+
| `browser_file_upload` | Upload files to a file input | `paths` (array of file paths) |
|
|
43
|
+
| `browser_pdf_save` | Save the current page as PDF | — |
|
|
44
|
+
| `browser_wait` | Wait for a specified duration | `time` (seconds, max 10) |
|
|
45
|
+
| `browser_close` | Close the browser | — |
|
|
46
|
+
| `browser_resize` | Resize the browser window | `width`, `height` |
|
|
47
|
+
|
|
48
|
+
**Critical concept:** Playwright MCP operates through an **accessibility-tree snapshot** model. Every `browser_snapshot` call returns a tree of elements, each with a unique `ref`. All interaction tools (`browser_click`, `browser_type`, `browser_hover`, etc.) require both a human-readable `element` description and the `ref` from the **most recent snapshot**. Always take a fresh snapshot before interacting with elements.
|
|
49
|
+
|
|
50
|
+
## Workflow
|
|
51
|
+
|
|
52
|
+
### Step 1: Locate and Read Ticket Design
|
|
53
|
+
|
|
54
|
+
Search for the ticket design file using this glob pattern:
|
|
55
|
+
|
|
56
|
+
```
|
|
57
|
+
.tickets/{TICKET_ID}/ticket-design.md
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
**If not found:** Inform the user and stop:
|
|
61
|
+
|
|
62
|
+
```
|
|
63
|
+
Error: ticket-design.md not found for ticket {TICKET_ID}.
|
|
64
|
+
Run the web-auto-ticket-design skill first to create it.
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
**If found:** Read the full file. For each test case, collect:
|
|
68
|
+
- **All steps in order** — to replay them in the browser
|
|
69
|
+
- **Steps with placeholders** — steps containing `- Selector: <-- Update selector for this element -->` and their element names, descriptions, and action context
|
|
70
|
+
|
|
71
|
+
If no placeholder selectors are found, inform the user and stop:
|
|
72
|
+
|
|
73
|
+
```
|
|
74
|
+
No placeholder selectors found in ticket-design.md for ticket {TICKET_ID}.
|
|
75
|
+
All selectors are already populated.
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### Step 2: Read Project Locator Strategy
|
|
79
|
+
|
|
80
|
+
Before extracting selectors, read the project's selector strategy from the source instructions.
|
|
81
|
+
|
|
82
|
+
**Locate the instructions file:**
|
|
83
|
+
|
|
84
|
+
`.documents-design/web-auto-project-blueprint.md`
|
|
85
|
+
|
|
86
|
+
**If found:** Read the **Selector Strategy** section. Extract:
|
|
87
|
+
- The priority order of locator types (e.g., `data-testid` first, then ARIA roles, etc.)
|
|
88
|
+
- The locator format examples from the codebase
|
|
89
|
+
- Any project-specific conventions or exceptions
|
|
90
|
+
|
|
91
|
+
Use this strategy for all selector extraction in subsequent steps.
|
|
92
|
+
|
|
93
|
+
**If not found:** Fall back to this default priority: `data-testid` > `role` + name > `aria-label` > CSS selectors.
|
|
94
|
+
|
|
95
|
+
### Step 3: Verify Playwright MCP Connection
|
|
96
|
+
|
|
97
|
+
Before starting the test run, verify the Playwright MCP server is available:
|
|
98
|
+
|
|
99
|
+
1. Call `browser_navigate` with `url: "about:blank"` to check that the browser is connected
|
|
100
|
+
2. If the call fails → report error and **stop**:
|
|
101
|
+
```
|
|
102
|
+
Error: Playwright MCP server is not available.
|
|
103
|
+
Ensure the Playwright MCP server is running and the browser is connected.
|
|
104
|
+
```
|
|
105
|
+
3. If successful, the browser is ready for use
|
|
106
|
+
|
|
107
|
+
### Step 4: Navigate and Extract Selectors
|
|
108
|
+
|
|
109
|
+
Process **one test case at a time** — complete all steps of one test case before moving to the next. Browser state is cumulative (logged-in sessions, navigation history, form data), so jumping between test cases would corrupt the application state.
|
|
110
|
+
|
|
111
|
+
**4.1 — Navigate to the starting point**
|
|
112
|
+
|
|
113
|
+
Use `browser_navigate` with the application URL to navigate to the page where the test case begins (using the first step's action context — typically a navigation action).
|
|
114
|
+
|
|
115
|
+
After navigation, call `browser_snapshot` to verify the page has loaded and capture the initial accessibility tree. If the snapshot doesn't show the expected content, use `browser_wait` briefly and re-snapshot. If the page still doesn't match expectations, use `browser_run_javascript` to check the current URL and document title for diagnosis before proceeding.
|
|
116
|
+
|
|
117
|
+
**4.2 — Walk through each step**
|
|
118
|
+
|
|
119
|
+
Process each step in the test case sequentially. Before interacting with any element, **always take a fresh snapshot** using `browser_snapshot` to get current element `ref`s.
|
|
120
|
+
|
|
121
|
+
- **Steps with existing selectors or actions** — execute the action in the browser to advance the application state:
|
|
122
|
+
- **Click** → identify the element in the snapshot by matching its description, then call `browser_click` with the element's `ref` and a human-readable `element` description
|
|
123
|
+
- **Type/Fill** → identify the input element, then call `browser_type` with the element's `ref`, `element` description, and `text` value
|
|
124
|
+
- **Select option** → call `browser_select_option` with the element's `ref` and the option `values`
|
|
125
|
+
- **Navigate** → call `browser_navigate` with the target URL
|
|
126
|
+
- **Key press** → call `browser_press_key` with the key combination
|
|
127
|
+
- **Hover** → call `browser_hover` with the element's `ref` (useful for revealing tooltips, dropdowns)
|
|
128
|
+
- **Wait** → call `browser_wait` with a duration if explicit wait is needed
|
|
129
|
+
|
|
130
|
+
This ensures the page is in the correct state for subsequent steps.
|
|
131
|
+
|
|
132
|
+
- **Steps with placeholder selectors** — before executing, pause and extract the selector:
|
|
133
|
+
|
|
134
|
+
1. **Take a snapshot** — call `browser_snapshot` to capture the current page accessibility tree
|
|
135
|
+
2. **Identify the target element** — match the element from the ticket design to a node in the accessibility tree using these heuristics (in order):
|
|
136
|
+
- **Role + name match** — the ticket says "Login button" → look for a node with `role: button` and name containing "Login"
|
|
137
|
+
- **Label match** — the ticket says "Email input" → look for a node with label/placeholder "Email"
|
|
138
|
+
- **Text match** — the ticket says "Submit link" → look for a link node with text "Submit"
|
|
139
|
+
- **Structural match** — the ticket says "First name in the form" → find the form section in the tree, then locate the input that corresponds structurally
|
|
140
|
+
- When multiple nodes match, use the page context from the test case (which section, which modal, which form) to disambiguate
|
|
141
|
+
3. **Extract selector attributes** — once the element is identified from the snapshot, use `browser_run_javascript` to extract all attributes that could be used to build a selector. Use the element's accessible name, role, or a known stable attribute from the snapshot to locate it in the DOM:
|
|
142
|
+
```javascript
|
|
143
|
+
const el = document.querySelector('[data-testid="..."]')
|
|
144
|
+
|| document.querySelector('[name="..."]')
|
|
145
|
+
|| document.querySelector('[role="..."][aria-label="..."]');
|
|
146
|
+
if (el) {
|
|
147
|
+
JSON.stringify({
|
|
148
|
+
tag: el.tagName.toLowerCase(),
|
|
149
|
+
id: el.id,
|
|
150
|
+
testId: el.getAttribute('data-testid'),
|
|
151
|
+
dataCy: el.getAttribute('data-cy'),
|
|
152
|
+
dataTest: el.getAttribute('data-test'),
|
|
153
|
+
role: el.getAttribute('role'),
|
|
154
|
+
name: el.getAttribute('name'),
|
|
155
|
+
type: el.getAttribute('type'),
|
|
156
|
+
ariaLabel: el.getAttribute('aria-label'),
|
|
157
|
+
ariaLabelledBy: el.getAttribute('aria-labelledby'),
|
|
158
|
+
placeholder: el.getAttribute('placeholder'),
|
|
159
|
+
href: el.getAttribute('href'),
|
|
160
|
+
classes: el.className,
|
|
161
|
+
text: el.textContent?.trim().substring(0, 100)
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
```
|
|
165
|
+
4. **Choose the best selector** — select the highest-priority attribute per the project's locator strategy from Step 2
|
|
166
|
+
5. **Record the resolved selector** — store it for updating the ticket design later
|
|
167
|
+
6. **Execute the step** — after extracting the selector, execute the action (click, type, etc.) to advance the app state for subsequent steps
|
|
168
|
+
|
|
169
|
+
**4.3 — Handle multi-state elements**
|
|
170
|
+
|
|
171
|
+
Some elements only appear after certain interactions (dropdowns, modals, tooltips). When a placeholder element is not visible in the current snapshot:
|
|
172
|
+
|
|
173
|
+
1. Check if a preceding action would reveal it (e.g., clicking a dropdown trigger)
|
|
174
|
+
2. Execute that action (e.g., `browser_click` on the trigger, or `browser_hover` over a menu item), then call `browser_snapshot` again to get updated `ref`s
|
|
175
|
+
3. Use `browser_wait` if dynamic content needs time to appear, then re-snapshot
|
|
176
|
+
4. If the element still cannot be found after revealing interactions, use `browser_run_javascript` to inspect the DOM and confirm the element truly isn't present (e.g., check if the expected container exists but the child element is missing)
|
|
177
|
+
5. If still not found, mark it as unresolved with a reason
|
|
178
|
+
|
|
179
|
+
**4.4 — Handle page transitions and loading**
|
|
180
|
+
|
|
181
|
+
After actions that cause page navigation or significant DOM changes:
|
|
182
|
+
|
|
183
|
+
1. Call `browser_snapshot` to verify the new page has loaded — check for expected content in the accessibility tree
|
|
184
|
+
2. If the page shows a loading spinner or skeleton, use `browser_wait` then re-snapshot
|
|
185
|
+
3. Always take a **new snapshot** after any navigation — previous `ref`s become stale
|
|
186
|
+
|
|
187
|
+
**4.5 — Retry on interaction failures**
|
|
188
|
+
|
|
189
|
+
Browser interactions can fail due to loading delays, animations, or elements not yet interactive. When a `browser_click`, `browser_type`, or other interaction fails:
|
|
190
|
+
|
|
191
|
+
1. Wait briefly (use `browser_wait` for the element to settle)
|
|
192
|
+
2. Take a fresh snapshot — the element's `ref` may have changed due to DOM re-render
|
|
193
|
+
3. Re-identify the element and retry the interaction once
|
|
194
|
+
4. If it fails again, use `browser_run_javascript` to inspect the element's state (visibility, disabled attribute, z-index overlap) and mark the step as problematic in the summary
|
|
195
|
+
|
|
196
|
+
**4.6 — Detect design gaps**
|
|
197
|
+
|
|
198
|
+
While walking through steps, watch for situations where the ticket design doesn't match reality:
|
|
199
|
+
- A navigation step is missing (the app shows a different page than expected)
|
|
200
|
+
- A prerequisite action isn't described (e.g., need to dismiss a cookie banner or accept terms first)
|
|
201
|
+
- An element described in the design doesn't exist on the actual page
|
|
202
|
+
- The step order doesn't match the actual user flow
|
|
203
|
+
|
|
204
|
+
Record these gaps — they'll be reported in Step 7 so the ticket designer can fix them. Do not modify `ticket-design.md` to fix gaps; only replace placeholder selectors.
|
|
205
|
+
|
|
206
|
+
### Step 5: Build Selector Values
|
|
207
|
+
|
|
208
|
+
For each placeholder, apply the project's locator priority in strict order — use the first attribute that is present and stable:
|
|
209
|
+
|
|
210
|
+
| Priority | Condition | Selector format |
|
|
211
|
+
|----------|-----------|-----------------|
|
|
212
|
+
| 1 | `testId` is present | `[data-testid="<value>"]` |
|
|
213
|
+
| 2 | `name` is present on an input/select/textarea | `<tag>[name="<value>"]` (e.g. `input[name="email"]`) |
|
|
214
|
+
| 3 | `role` + `ariaLabel` are both present | `[role="<value>"][aria-label="<value>"]` |
|
|
215
|
+
| 4 | None of the above — use relative XPath | `//tag[contains(@class,"...") and text()="..."]` |
|
|
216
|
+
| — | Element not found | Keep `<-- Update selector for this element -->` unchanged |
|
|
217
|
+
|
|
218
|
+
**Avoid these anti-patterns** because they produce brittle, flaky selectors that break on routine code changes:
|
|
219
|
+
- **`id`** — often auto-generated by frameworks (e.g., `#radix-12`, `#mui-input-3`) and changes across renders
|
|
220
|
+
- **CSS class names** — typically generated by CSS-in-JS or build tools (e.g., `.styles_button__a1b2c`) and change on every build
|
|
221
|
+
- **Absolute XPath** — encodes the full DOM path (e.g., `/html/body/div[2]/main/form/button`), breaks when any ancestor element changes
|
|
222
|
+
- **Index-based selectors** — depend on element ordering (e.g., `button:nth-child(3)`) which changes when elements are added or reordered
|
|
223
|
+
- **Text-only selectors** — break when copy is updated, translated, or A/B tested
|
|
224
|
+
|
|
225
|
+
### Step 6: Update Ticket Design
|
|
226
|
+
|
|
227
|
+
For each placeholder that has a resolved selector, update the `ticket-design.md` file in place:
|
|
228
|
+
|
|
229
|
+
**Replace:**
|
|
230
|
+
```
|
|
231
|
+
- Selector: <-- Update selector for this element -->
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
**With:**
|
|
235
|
+
```
|
|
236
|
+
- Selector: [resolved-selector]
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
Do not modify any other lines in the step (`- Element:`, `- Action:`, `- Expected Result:`, `- Note:`). The `- Note: New element/action - needs to be implemented` line must remain — this skill only resolves selectors, not implement the automation code.
|
|
240
|
+
|
|
241
|
+
Save the updated file at its original location.
|
|
242
|
+
|
|
243
|
+
### Step 7: Summary
|
|
244
|
+
|
|
245
|
+
Display the result to the user:
|
|
246
|
+
|
|
247
|
+
```
|
|
248
|
+
Selectors updated for ticket {TICKET_ID}.
|
|
249
|
+
|
|
250
|
+
Updated:
|
|
251
|
+
- .tickets/{TICKET_ID}/ticket-design.md
|
|
252
|
+
|
|
253
|
+
Summary:
|
|
254
|
+
- Selectors resolved: {resolved_count}
|
|
255
|
+
- Selectors still pending: {pending_count}
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
If any selectors remain unresolved, add:
|
|
259
|
+
|
|
260
|
+
```
|
|
261
|
+
Unresolved elements:
|
|
262
|
+
- [Test Case ID] Step [N]: [Element name] — [reason: not found in snapshot / element not visible / page state unclear]
|
|
263
|
+
|
|
264
|
+
Note: These elements could not be identified in the live application.
|
|
265
|
+
You can update them manually or try the FE source code approach.
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
If any design gaps were detected during navigation (Step 4.6), add:
|
|
269
|
+
|
|
270
|
+
```
|
|
271
|
+
⚠️ Design gaps detected — ticket-design.md was NOT modified for these:
|
|
272
|
+
- [Test Case ID] Step [N]: [description of the gap]
|
|
273
|
+
Suggested fix: [what step or action is missing]
|
|
274
|
+
|
|
275
|
+
Re-run the web-auto-ticket-designer agent to address these gaps before proceeding.
|
|
276
|
+
```
|
|
277
|
+
|
|
278
|
+
## Important Rules
|
|
279
|
+
|
|
280
|
+
- **Follow project locator strategy** — always read and follow the Selector Strategy from the project blueprint; only use the default fallback when no blueprint is found
|
|
281
|
+
- **Execute steps in order** — follow the test case step sequence to ensure the application is in the correct state before extracting each selector; skipping or reordering steps corrupts browser state
|
|
282
|
+
- **One test case at a time** — complete all steps of one test case before moving to the next to maintain correct application state
|
|
283
|
+
- **Extract from live DOM only** — selectors must come from actual page snapshots and `browser_run_javascript` calls; never fabricate or guess selector values
|
|
284
|
+
- **Always use fresh snapshots** — before interacting with any element, take a new `browser_snapshot`; previous `ref`s become invalid after DOM changes or navigation
|
|
285
|
+
- **Use `ref` + `element` for all interactions** — Playwright MCP requires the `ref` from the latest snapshot for `browser_click`, `browser_type`, `browser_hover`, and other interaction tools; always include a human-readable `element` description alongside the `ref`
|
|
286
|
+
- **Use `browser_run_javascript` for attribute extraction** — execute JavaScript in the browser context to extract DOM attributes from identified elements; use known stable attributes from the snapshot to locate the element in the DOM
|
|
287
|
+
- **Use JS inspection for debugging** — when an element can't be found or page state is unexpected, use `browser_run_javascript` to check the current URL, document title, or DOM structure before marking as unresolved
|
|
288
|
+
- **Preserve file structure** — only modify `- Selector:` lines; do not alter step numbers, descriptions, actions, expected results, or notes
|
|
289
|
+
- **Report design gaps, never fix them** — if a missing navigation step, prerequisite action, or undescribed interaction is detected, report it in the summary under "Design gaps detected"; do not add, remove, or reorder steps in `ticket-design.md`
|
|
290
|
+
- **Keep analysis internal** — do not output snapshot data or candidate lists to the user
|
|
291
|
+
- **Handle failures gracefully** — if the MCP server is unavailable or the app is not running, inform the user and stop before making any changes
|
|
292
|
+
- **Wait for page stability** — use `browser_wait` and re-snapshot after navigations and actions that trigger loading states
|
|
293
|
+
- **File update failure** — report the error and ask how to proceed
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: web-auto-test-cases
|
|
3
|
+
description: Generate BDD Gherkin test cases from raw ticket content. Receives the ticket ID and raw ticket content, extracts the feature path, creates the ticket directory, generates comprehensive Gherkin scenarios, and saves them as test-cases.md. Always use this skill when asked to generate test cases, create BDD scenarios, or write Gherkin for a ticket — even if the request seems simple or comes from an orchestrator. Triggers on requests like "create test cases for ticket TKT-001", "generate BDD scenarios for ABC-123", "write Gherkin test cases for ticket fe-2026", "generate test cases for this ticket", or "create scenarios from these instructions".
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Web Automation Test Cases
|
|
7
|
+
|
|
8
|
+
Given a ticket ID and its raw content, extract the feature path, create the ticket directory, systematically analyze every test case, and generate comprehensive BDD Gherkin scenarios saved to `test-cases.md`.
|
|
9
|
+
|
|
10
|
+
The goal is completeness and accuracy: every test case in the ticket becomes exactly one Gherkin scenario — no more, no less — with its original test case ID preserved as a tag, so the test suite stays fully traceable to the source ticket.
|
|
11
|
+
|
|
12
|
+
## Input Parameters
|
|
13
|
+
|
|
14
|
+
| Parameter | Type | Required | Description |
|
|
15
|
+
|-----------|------|----------|-------------|
|
|
16
|
+
| `TICKET_ID` | string | Yes | The ticket identifier (e.g., TKT-001, ABC-123) |
|
|
17
|
+
| `TICKET_CONTENT` | string | Yes | Raw ticket content (instructions, test cases, acceptance criteria) |
|
|
18
|
+
|
|
19
|
+
If either parameter is missing, ask the user before proceeding.
|
|
20
|
+
|
|
21
|
+
## Workflow
|
|
22
|
+
|
|
23
|
+
### Step 1: Extract Feature Path
|
|
24
|
+
|
|
25
|
+
Parse `TICKET_CONTENT` to find the **Feature** field and extract `PARENT_FEATURE` and `CHILD_FEATURE`.
|
|
26
|
+
|
|
27
|
+
**Expected format in the ticket content:**
|
|
28
|
+
```
|
|
29
|
+
- Feature: {PARENT_FEATURE} - {CHILD_FEATURE}
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
**Extraction rules:**
|
|
33
|
+
- Split the Feature value on ` - ` (space-dash-space)
|
|
34
|
+
- First part → `PARENT_FEATURE`, second part → `CHILD_FEATURE`
|
|
35
|
+
- Convert both to lowercase kebab-case (e.g., `Administration` → `administration`, `Users Monitors` → `users-monitors`)
|
|
36
|
+
|
|
37
|
+
**Examples:**
|
|
38
|
+
|
|
39
|
+
| Feature field value | PARENT_FEATURE | CHILD_FEATURE |
|
|
40
|
+
|---------------------|----------------|---------------|
|
|
41
|
+
| `administration - users-monitors` | `administration` | `users-monitors` |
|
|
42
|
+
| `Reports - Monthly Sales` | `reports` | `monthly-sales` |
|
|
43
|
+
| `User Management - Role Permissions` | `user-management` | `role-permissions` |
|
|
44
|
+
|
|
45
|
+
**If the Feature field is missing or cannot be parsed:** Ask the user to provide the parent and child feature names.
|
|
46
|
+
|
|
47
|
+
### Step 2: Create Directory
|
|
48
|
+
|
|
49
|
+
Build the output path:
|
|
50
|
+
```
|
|
51
|
+
.tickets/{TICKET_ID}/
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Create the directory if it does not exist.
|
|
55
|
+
|
|
56
|
+
### Step 3: Analyze Ticket Content (internal)
|
|
57
|
+
|
|
58
|
+
Before generating any Gherkin, do a full analysis of the ticket. This step is entirely internal — don't output the analysis to the user. Its purpose is to ensure every test case is captured and nothing is missed.
|
|
59
|
+
|
|
60
|
+
**3.1 — Inventory test case IDs**
|
|
61
|
+
|
|
62
|
+
Find and list every Test Case ID in the ticket exactly as written. The count matters — you'll use this to verify at the end that every ID has a matching scenario.
|
|
63
|
+
|
|
64
|
+
**3.2 — Parse each test case**
|
|
65
|
+
|
|
66
|
+
For each test case, extract:
|
|
67
|
+
- Summary
|
|
68
|
+
- Preconditions
|
|
69
|
+
- Test Data
|
|
70
|
+
- Steps
|
|
71
|
+
- Expected Results
|
|
72
|
+
- Post-conditions (Cleanup)
|
|
73
|
+
|
|
74
|
+
**3.3 — Plan the scenario structure**
|
|
75
|
+
|
|
76
|
+
Decide:
|
|
77
|
+
- Which preconditions are shared across all scenarios → these go in `Background`
|
|
78
|
+
- Which preconditions are specific to one scenario → these go as `Given` steps in that scenario
|
|
79
|
+
- Which scenarios need `@cleanup` → based on their Post-conditions section
|
|
80
|
+
|
|
81
|
+
Create a 1:1 mapping: every test case ID → one Gherkin scenario. This is the core of the skill — a missed test case ID means a gap in test coverage that can't be easily detected later.
|
|
82
|
+
|
|
83
|
+
### Step 4: Generate Gherkin
|
|
84
|
+
|
|
85
|
+
Produce the complete Gherkin content following the template at [templates/test-cases.template.md](templates/test-cases.template.md).
|
|
86
|
+
|
|
87
|
+
**Tags and feature structure:**
|
|
88
|
+
|
|
89
|
+
| Element | Rule | Why |
|
|
90
|
+
|---------|------|-----|
|
|
91
|
+
| Feature tag | `@{TICKET_ID}` | Groups all scenarios for this ticket, making them runnable together |
|
|
92
|
+
| Related Feature tag | Include only if present and not "None" | Avoids polluting the tag namespace with empty values |
|
|
93
|
+
| Feature line | `Feature: {Parent} - {Child Feature}` | Mirrors the ticket's hierarchy |
|
|
94
|
+
| Background | Preconditions shared by all scenarios | Reduces repetition without hiding setup |
|
|
95
|
+
|
|
96
|
+
**Scenario structure:**
|
|
97
|
+
|
|
98
|
+
| Element | Rule | Why |
|
|
99
|
+
|---------|------|-----|
|
|
100
|
+
| Scenario tag | Exact Test Case ID (e.g., `@TC057`) | Keeps the suite traceable to ticket IDs |
|
|
101
|
+
| `@cleanup` tag | Only when Post-conditions require it | Makes test teardown explicit and opt-in |
|
|
102
|
+
| Scenario name | Derived from the test case Summary | Should read like a plain-English description of what's being verified |
|
|
103
|
+
|
|
104
|
+
**Step translation:**
|
|
105
|
+
|
|
106
|
+
| Source field | Gherkin keyword |
|
|
107
|
+
|--------------|----------------|
|
|
108
|
+
| Steps | `When` / `And` |
|
|
109
|
+
| Expected Results | `Then` / `And` |
|
|
110
|
+
| Unique preconditions | `Given` (within the scenario) |
|
|
111
|
+
|
|
112
|
+
**Data handling:** Enclose all variable data in double quotes — emails, usernames, messages, URLs, test data values. This keeps steps readable and makes data easy to spot for future parameterization.
|
|
113
|
+
|
|
114
|
+
**Edge cases:**
|
|
115
|
+
- If a test case has no preconditions of its own, skip `Given` and start with `When`
|
|
116
|
+
- If no preconditions are shared across scenarios, omit `Background` entirely
|
|
117
|
+
- If a scenario name from the Summary is ambiguous, expand it slightly for clarity
|
|
118
|
+
|
|
119
|
+
### Step 5: Save
|
|
120
|
+
|
|
121
|
+
Save the generated Gherkin content to:
|
|
122
|
+
|
|
123
|
+
```
|
|
124
|
+
.tickets/{TICKET_ID}/test-cases.md
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
If the file cannot be created, report the error and ask how to proceed.
|
|
128
|
+
|
|
129
|
+
### Step 6: Summary
|
|
130
|
+
|
|
131
|
+
```
|
|
132
|
+
Test cases created for ticket {TICKET_ID}.
|
|
133
|
+
|
|
134
|
+
Created:
|
|
135
|
+
- .tickets/{TICKET_ID}/test-cases.md
|
|
136
|
+
|
|
137
|
+
Scenarios: {count} ({list of test case IDs})
|
|
138
|
+
```
|