@biggora/claude-plugins 1.1.1 → 1.2.2

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.
Files changed (104) hide show
  1. package/.claude/settings.local.json +3 -1
  2. package/README.md +24 -17
  3. package/package.json +1 -1
  4. package/registry/registry.json +319 -244
  5. package/specs/coding.md +24 -0
  6. package/specs/pod.md +2 -0
  7. package/src/skills/captcha/README.md +221 -0
  8. package/src/skills/captcha/SKILL.md +355 -0
  9. package/src/skills/captcha/references/captcha-types.md +254 -0
  10. package/src/skills/captcha/references/services.md +172 -0
  11. package/src/skills/captcha/references/stealth.md +238 -0
  12. package/src/skills/captcha/scripts/solve_captcha.py +323 -0
  13. package/src/skills/captcha/scripts/solve_image_grid.py +350 -0
  14. package/src/skills/codex-cli/SKILL.md +21 -11
  15. package/src/skills/gemini-cli/SKILL.md +27 -13
  16. package/src/skills/gemini-cli/references/commands.md +21 -14
  17. package/src/skills/gemini-cli/references/configuration.md +23 -18
  18. package/src/skills/gemini-cli/references/headless-and-scripting.md +7 -17
  19. package/src/skills/gemini-cli/references/mcp-and-extensions.md +12 -6
  20. package/src/skills/google-merchant-api/SKILL.md +581 -0
  21. package/src/skills/google-merchant-api/references/accounts.md +247 -0
  22. package/src/skills/google-merchant-api/references/content-api-legacy.md +216 -0
  23. package/src/skills/google-merchant-api/references/datasources.md +233 -0
  24. package/src/skills/google-merchant-api/references/inventories.md +201 -0
  25. package/src/skills/google-merchant-api/references/migration.md +267 -0
  26. package/src/skills/google-merchant-api/references/products.md +316 -0
  27. package/src/skills/google-merchant-api/references/promotions.md +201 -0
  28. package/src/skills/google-merchant-api/references/reports.md +240 -0
  29. package/src/skills/lv-aggregators-api/SKILL.md +113 -0
  30. package/src/skills/lv-aggregators-api/references/integration-guide.md +368 -0
  31. package/src/skills/lv-aggregators-api/references/kurpirkt.md +103 -0
  32. package/src/skills/lv-aggregators-api/references/salidzini.md +122 -0
  33. package/src/skills/notebook-lm/SKILL.md +1 -1
  34. package/src/skills/screen-recording/SKILL.md +243 -213
  35. package/src/skills/screen-recording/references/design-patterns.md +4 -2
  36. package/src/skills/screen-recording/references/ffmpeg-recording.md +473 -0
  37. package/src/skills/screen-recording/references/{approach1-programmatic.md → programmatic-generation.md} +45 -22
  38. package/src/skills/screen-recording/references/python-fallback.md +222 -0
  39. package/src/skills/tailwindcss-best-practices/SKILL.md +180 -0
  40. package/src/skills/tailwindcss-best-practices/references/best-practices-utility-patterns.md +87 -0
  41. package/src/skills/tailwindcss-best-practices/references/core-installation.md +109 -0
  42. package/src/skills/tailwindcss-best-practices/references/core-preflight.md +200 -0
  43. package/src/skills/tailwindcss-best-practices/references/core-responsive.md +163 -0
  44. package/src/skills/tailwindcss-best-practices/references/core-source-detection.md +114 -0
  45. package/src/skills/tailwindcss-best-practices/references/core-theme.md +108 -0
  46. package/src/skills/tailwindcss-best-practices/references/core-utility-classes.md +59 -0
  47. package/src/skills/tailwindcss-best-practices/references/core-variants.md +204 -0
  48. package/src/skills/tailwindcss-best-practices/references/effects-form-controls.md +76 -0
  49. package/src/skills/tailwindcss-best-practices/references/effects-mask.md +91 -0
  50. package/src/skills/tailwindcss-best-practices/references/effects-scroll-snap.md +59 -0
  51. package/src/skills/tailwindcss-best-practices/references/effects-text-shadow.md +78 -0
  52. package/src/skills/tailwindcss-best-practices/references/effects-transition-animation.md +80 -0
  53. package/src/skills/tailwindcss-best-practices/references/effects-visibility-interactivity.md +82 -0
  54. package/src/skills/tailwindcss-best-practices/references/features-content-detection.md +175 -0
  55. package/src/skills/tailwindcss-best-practices/references/features-custom-styles.md +203 -0
  56. package/src/skills/tailwindcss-best-practices/references/features-dark-mode.md +137 -0
  57. package/src/skills/tailwindcss-best-practices/references/features-functions-directives.md +241 -0
  58. package/src/skills/tailwindcss-best-practices/references/features-upgrade.md +160 -0
  59. package/src/skills/tailwindcss-best-practices/references/layout-aspect-ratio.md +39 -0
  60. package/src/skills/tailwindcss-best-practices/references/layout-columns.md +80 -0
  61. package/src/skills/tailwindcss-best-practices/references/layout-display.md +110 -0
  62. package/src/skills/tailwindcss-best-practices/references/layout-flexbox.md +112 -0
  63. package/src/skills/tailwindcss-best-practices/references/layout-grid.md +87 -0
  64. package/src/skills/tailwindcss-best-practices/references/layout-height.md +97 -0
  65. package/src/skills/tailwindcss-best-practices/references/layout-inset.md +103 -0
  66. package/src/skills/tailwindcss-best-practices/references/layout-logical-properties.md +92 -0
  67. package/src/skills/tailwindcss-best-practices/references/layout-margin.md +126 -0
  68. package/src/skills/tailwindcss-best-practices/references/layout-min-max-sizing.md +63 -0
  69. package/src/skills/tailwindcss-best-practices/references/layout-object-fit-position.md +64 -0
  70. package/src/skills/tailwindcss-best-practices/references/layout-overflow.md +57 -0
  71. package/src/skills/tailwindcss-best-practices/references/layout-padding.md +77 -0
  72. package/src/skills/tailwindcss-best-practices/references/layout-position.md +85 -0
  73. package/src/skills/tailwindcss-best-practices/references/layout-tables.md +67 -0
  74. package/src/skills/tailwindcss-best-practices/references/layout-width.md +102 -0
  75. package/src/skills/tailwindcss-best-practices/references/transform-base.md +68 -0
  76. package/src/skills/tailwindcss-best-practices/references/transform-rotate.md +70 -0
  77. package/src/skills/tailwindcss-best-practices/references/transform-scale.md +83 -0
  78. package/src/skills/tailwindcss-best-practices/references/transform-skew.md +62 -0
  79. package/src/skills/tailwindcss-best-practices/references/transform-translate.md +77 -0
  80. package/src/skills/tailwindcss-best-practices/references/typography-font-text.md +142 -0
  81. package/src/skills/tailwindcss-best-practices/references/typography-list-style.md +65 -0
  82. package/src/skills/tailwindcss-best-practices/references/typography-text-align.md +60 -0
  83. package/src/skills/tailwindcss-best-practices/references/visual-background.md +76 -0
  84. package/src/skills/tailwindcss-best-practices/references/visual-border.md +108 -0
  85. package/src/skills/tailwindcss-best-practices/references/visual-effects.md +111 -0
  86. package/src/skills/tailwindcss-best-practices/references/visual-svg.md +82 -0
  87. package/src/skills/test-mobile-app/SKILL.md +11 -6
  88. package/src/skills/test-mobile-app/scripts/analyze_apk.py +15 -4
  89. package/src/skills/test-mobile-app/scripts/check_environment.py +5 -5
  90. package/src/skills/test-mobile-app/scripts/run_tests.py +1 -1
  91. package/src/skills/test-web-ui/SKILL.md +264 -84
  92. package/src/skills/test-web-ui/scripts/discover.py +25 -12
  93. package/src/skills/test-web-ui/scripts/run_tests.py +3 -2
  94. package/src/skills/tm-search/SKILL.md +242 -106
  95. package/src/skills/tm-search/references/scraping-fallback.md +60 -95
  96. package/src/skills/tm-search/scripts/tm_search.py +453 -375
  97. package/src/skills/vite-best-practices/SKILL.md +115 -0
  98. package/src/skills/vite-best-practices/references/build-and-ssr.md +255 -0
  99. package/src/skills/vite-best-practices/references/core-config.md +231 -0
  100. package/src/skills/vite-best-practices/references/core-features.md +222 -0
  101. package/src/skills/vite-best-practices/references/core-plugin-api.md +294 -0
  102. package/src/skills/vite-best-practices/references/environment-api.md +108 -0
  103. package/src/skills/vite-best-practices/references/rolldown-migration.md +242 -0
  104. package/src/skills/screen-recording/references/approach2-xvfb.md +0 -232
@@ -4,7 +4,7 @@ description: >
4
4
  Automated web QA skill: analyzes a website or project, generates end-user use cases,
5
5
  derives a structured test plan, executes tests via Playwright browser automation, and
6
6
  produces a full HTML/Markdown QA report with screenshots and pass/fail results.
7
-
7
+
8
8
  TRIGGER this skill whenever the user asks to: test a website, run QA on a web app,
9
9
  check if a site works, find bugs on a site, validate a web project, create a test plan
10
10
  for a website, run functional tests, check a landing page, audit a web app for issues,
@@ -15,7 +15,7 @@ description: >
15
15
 
16
16
  # Web Tester Skill
17
17
 
18
- Transforms any website or project description into a structured QA run:
18
+ Transforms any website or project into a structured QA run:
19
19
  **Discover → Plan → Execute → Report**
20
20
 
21
21
  ---
@@ -32,22 +32,136 @@ Phase 5 → REPORT : Compile HTML + Markdown report with all results
32
32
 
33
33
  ---
34
34
 
35
+ ## Choosing Your Execution Tool
36
+
37
+ Pick the first option that works in your environment:
38
+
39
+ ### Option 1: Playwright MCP Tools (recommended)
40
+
41
+ If Playwright MCP tools are available (e.g., `mcp__plugin_playwright_playwright__*`),
42
+ use them — they are the fastest and most token-efficient option (~2.8x faster than CLI,
43
+ fewer tool calls needed since each MCP call does more work):
44
+
45
+ ```
46
+ browser_navigate → navigate to URL
47
+ browser_snapshot → get page state and element refs
48
+ browser_take_screenshot → capture screenshots
49
+ browser_click → click elements
50
+ browser_type → type into inputs
51
+ browser_evaluate → run JS assertions
52
+ browser_resize → test mobile viewports
53
+ browser_console_messages → check for JS errors
54
+ ```
55
+
56
+ ### Option 2: Playwright CLI
57
+
58
+ The [`@playwright/cli`](https://github.com/microsoft/playwright-cli) is a CLI
59
+ designed for coding agents. Use it when MCP tools are not available.
60
+ Install if needed:
61
+
62
+ ```bash
63
+ npm install -g @playwright/cli@latest
64
+ ```
65
+
66
+ Key commands for QA testing:
67
+
68
+ ```bash
69
+ # Open a page
70
+ playwright-cli open https://example.com
71
+
72
+ # Take a snapshot (returns element refs for interaction)
73
+ playwright-cli snapshot
74
+
75
+ # Screenshot the page
76
+ playwright-cli screenshot
77
+
78
+ # Click, fill forms, type
79
+ playwright-cli click <ref>
80
+ playwright-cli fill <ref> "text value"
81
+ playwright-cli type "search query"
82
+ playwright-cli press Enter
83
+
84
+ # Mobile viewport testing — use a named session with mobile config
85
+ playwright-cli -s=mobile open https://example.com
86
+ # (configure viewport in .playwright/cli.config.json)
87
+
88
+ # Check console errors via snapshot output
89
+ playwright-cli snapshot
90
+
91
+ # Close when done
92
+ playwright-cli close
93
+ ```
94
+
95
+ Playwright CLI is headless by default. Add `--headed` to watch the browser visually.
96
+ Use `playwright-cli show` to open a dashboard of all active sessions.
97
+
98
+ ### Option 3: Python Playwright Scripts
99
+
100
+ If Python and Playwright are installed, use the bundled scripts in `scripts/`:
101
+
102
+ ```bash
103
+ # Install if needed
104
+ pip install playwright && playwright install chromium
105
+
106
+ # Run discovery
107
+ python scripts/discover.py --url <URL> --output discovery.json
108
+
109
+ # Run tests
110
+ python scripts/run_tests.py --url <URL> --test-plan test_plan.json --output test_results/
111
+
112
+ # Generate report
113
+ python scripts/generate_report.py --results test_results/results.json --output qa_report.html
114
+ ```
115
+
116
+ ### Option 4: Manual Testing
117
+
118
+ If none of the above are available, read the source code directly and perform
119
+ manual analysis. Use `curl` or `fetch` for basic HTTP checks.
120
+
121
+ ---
122
+
35
123
  ## Phase 1: Discovery
36
124
 
37
125
  ### What to gather
38
- - **URL** — if the user provides a live URL, use Playwright to crawl it
39
- - **Project files** — if no live URL, inspect source files in `/mnt/user-data/uploads/`
126
+ - **URL** — if the user provides a live URL, navigate to it and explore
127
+ - **Project files** — if no live URL, inspect source files in the project directory
40
128
  - **Purpose** — what does the site do? (landing page, e-commerce, dashboard, blog, etc.)
41
129
  - **Key pages** — home, auth, main feature pages, forms, checkout, etc.
42
130
  - **Tech stack** — optional but helpful for targeted checks
43
131
 
44
- ### Discovery script
45
- Run `scripts/discover.py` (see below) to auto-detect pages, links, forms, interactive elements.
132
+ ### Discovery with Playwright MCP
133
+ ```
134
+ 1. browser_navigate to the URL
135
+ 2. browser_snapshot to get the page structure
136
+ 3. browser_take_screenshot for visual reference
137
+ 4. Examine links, forms, headings, navigation from the snapshot
138
+ 5. Navigate to discovered subpages and repeat
139
+ ```
46
140
 
47
- **If no live URL is available** (e.g., network blocked or local project):
48
- - Read source files (HTML, JSX, Vue, etc.) in uploads directory
49
- - Extract routes, components, visible text, form fields, navigation links
50
- - Use Playwright with `page.set_content()` to render and inspect local HTML files
141
+ ### Discovery with Playwright CLI
142
+ ```bash
143
+ playwright-cli open <URL>
144
+ playwright-cli screenshot --name discovery_home
145
+ playwright-cli snapshot
146
+ # Examine snapshot output for links, forms, navigation, headings
147
+ # Follow important links to discover subpages
148
+ playwright-cli goto <subpage-url>
149
+ playwright-cli screenshot --name discovery_subpage
150
+ ```
151
+
152
+ ### Discovery with Python script
153
+ ```bash
154
+ python scripts/discover.py --url <URL> --max-pages 10 --output discovery.json
155
+ ```
156
+
157
+ ### Local project (no live URL)
158
+ When only source files are available:
159
+ 1. Start a local server: `python -m http.server 8080 --directory <project-path>`
160
+ (or `npx serve <project-path>` or any other static server)
161
+ 2. Run discovery against `http://localhost:8080`
162
+ 3. If the port is busy, try 8081, 8082, etc.
163
+
164
+ **Important:** `file://` URLs may be blocked by some tools. Always prefer HTTP serving.
51
165
 
52
166
  ---
53
167
 
@@ -71,6 +185,7 @@ UC-02: [Actor] can [action] so that [goal]
71
185
  - **Responsiveness** — works on mobile viewport
72
186
  - **Error handling** — 404 pages, empty states, invalid inputs
73
187
  - **Performance / visual** — no broken images, no console errors, reasonable load
188
+ - **Accessibility basics** — alt text on images, heading hierarchy, landmark elements
74
189
 
75
190
  Aim for **10–25 use cases** depending on site complexity.
76
191
 
@@ -101,110 +216,166 @@ TC-01 [UC-01]: Homepage Navigation
101
216
  | **Form validation** | Empty submit shows errors, valid submit succeeds |
102
217
  | **Responsiveness** | Mobile viewport renders without overflow |
103
218
  | **Console errors** | No JS errors on page load |
104
- | **Accessibility basics** | Images have alt text, headings hierarchy |
219
+ | **Accessibility basics** | Images have alt text, headings hierarchy, landmarks |
220
+
221
+ If using the Python scripts, save the test plan as `test_plan.json` — see
222
+ `references/test_case_schema.md` for the JSON schema.
105
223
 
106
224
  ---
107
225
 
108
226
  ## Phase 4: Test Execution
109
227
 
110
- ### Use the execution script
228
+ For each test case, follow this pattern regardless of which tool you use:
229
+
230
+ 1. **Navigate** to the target page
231
+ 2. **Capture a "before" screenshot**
232
+ 3. **Execute steps** — clicks, form fills, scrolling, waiting
233
+ 4. **Run assertions** — element presence, text content, console errors, image loading
234
+ 5. **Capture an "after" screenshot** if any interaction occurred
235
+ 6. **Record result** — PASS / FAIL / SKIP + error message + duration
236
+
237
+ ### Execution with Playwright MCP
238
+
239
+ ```
240
+ browser_navigate to target URL
241
+ browser_take_screenshot for "before" capture
242
+ browser_snapshot to check element presence
243
+ browser_evaluate to run JS assertions:
244
+ - document.title !== ''
245
+ - document.querySelectorAll('nav').length > 0
246
+ - document.querySelectorAll('img').filter(i => i.naturalWidth === 0).length
247
+ browser_click / browser_type for interactions
248
+ browser_take_screenshot for "after" capture
249
+ browser_console_messages to check for JS errors
250
+ browser_resize for mobile viewport testing
251
+ ```
252
+
253
+ ### Execution with Playwright CLI
254
+
111
255
  ```bash
112
- python3 /mnt/skills/user/web-tester/scripts/run_tests.py \
113
- --url <URL_OR_LOCAL_PATH> \
114
- --test-plan /home/claude/test_plan.json \
115
- --output /home/claude/test_results/
116
- ```
117
-
118
- ### What the script does
119
- 1. Launches headless Chromium (no-sandbox mode for container)
120
- 2. For each test case:
121
- - Navigates to the target page
122
- - Captures a **before screenshot**
123
- - Executes assertions (element presence, text content, clicks, form fills)
124
- - Captures an **after screenshot** if interaction occurred
125
- - Records PASS / FAIL / SKIP + error message
126
- 3. Saves all screenshots to `test_results/screenshots/`
127
- 4. Writes `test_results/results.json`
128
-
129
- ### Manual execution (when no URL — code project)
130
- If only source files are available:
131
- 1. Serve them locally: `python3 -m http.server 8080 --directory /home/claude/project/`
132
- 2. Run tests against `http://localhost:8080`
133
-
134
- ### Key Playwright patterns to use
135
-
136
- ```python
137
- # Launch
138
- from playwright.sync_api import sync_playwright
139
- browser = p.chromium.launch(args=['--no-sandbox', '--disable-dev-shm-usage'])
140
- context = browser.new_context(viewport={'width': 1280, 'height': 800})
141
- page = context.new_page()
142
-
143
- # Console error collection
144
- errors = []
145
- page.on('console', lambda msg: errors.append(msg.text) if msg.type == 'error' else None)
146
-
147
- # Mobile viewport test
148
- mobile = browser.new_context(viewport={'width': 390, 'height': 844}, is_mobile=True)
149
-
150
- # Screenshot
151
- page.screenshot(path='screenshots/tc01_home.png', full_page=True)
152
-
153
- # Assertions
154
- page.wait_for_load_state('networkidle')
155
- assert page.locator('nav').is_visible()
156
- assert page.title() != ''
157
- count = page.locator('a').count()
158
- text = page.locator('h1').text_content()
256
+ # Navigate and screenshot
257
+ playwright-cli goto <URL>
258
+ playwright-cli screenshot --name tc01_before
259
+
260
+ # Get page state for assertions
261
+ playwright-cli snapshot
262
+ # Parse snapshot output to verify elements exist, text content matches, etc.
263
+
264
+ # Interact
265
+ playwright-cli click <ref>
266
+ playwright-cli fill <ref> "test@example.com"
267
+ playwright-cli press Enter
268
+
269
+ # After screenshot
270
+ playwright-cli screenshot --name tc01_after
159
271
  ```
160
272
 
161
- ---
273
+ For **mobile viewport testing**, open a separate session with mobile dimensions
274
+ or resize the browser.
162
275
 
163
- ## Phase 5: Report Generation
276
+ For **status code testing** (e.g., checking that /404 returns 404): use
277
+ `playwright-cli` navigation — the tool reports HTTP status in its output. Note that
278
+ navigating to a 4xx/5xx page may throw an error in some tools; catch it gracefully
279
+ and record the status code from the error message.
164
280
 
165
- After execution, generate report using `scripts/generate_report.py`:
281
+ ### Execution with Python scripts
166
282
 
167
283
  ```bash
168
- python3 /mnt/skills/user/web-tester/scripts/generate_report.py \
169
- --results /home/claude/test_results/results.json \
170
- --screenshots /home/claude/test_results/screenshots/ \
171
- --output /mnt/user-data/outputs/qa_report.html
284
+ python scripts/run_tests.py \
285
+ --url <URL> \
286
+ --test-plan test_plan.json \
287
+ --output test_results/
172
288
  ```
173
289
 
290
+ ### Console error collection
291
+
292
+ Console errors are important signals. Collect them during each test:
293
+ - **Playwright MCP**: Use `browser_console_messages` or `browser_evaluate`
294
+ - **Playwright CLI**: Check snapshot output or use `playwright-cli` evaluation
295
+ - **Python scripts**: The script registers a console listener before navigation
296
+
297
+ ### Image loading checks
298
+
299
+ To detect broken images, run this JS on the page:
300
+ ```javascript
301
+ Array.from(document.images)
302
+ .filter(img => img.naturalWidth === 0 && img.src && !img.src.startsWith('data:'))
303
+ .map(img => img.src)
304
+ ```
305
+ An empty result means all images loaded. Otherwise, list the broken URLs.
306
+
307
+ ### Accessibility checks
308
+
309
+ Quick checks to run on each page:
310
+ ```javascript
311
+ // Images missing alt text
312
+ document.querySelectorAll('img:not([alt]), img[alt=""]').length
313
+
314
+ // Heading hierarchy (should have h1, not skip levels)
315
+ [...document.querySelectorAll('h1,h2,h3,h4,h5,h6')].map(h => h.tagName)
316
+
317
+ // Landmark elements
318
+ document.querySelectorAll('main, nav, header, footer, [role]').length
319
+ ```
320
+
321
+ ---
322
+
323
+ ## Phase 5: Report Generation
324
+
174
325
  ### Report contents
175
326
  - **Summary dashboard** — total tests, pass/fail/skip counts, pass rate %, tested URL, timestamp
176
327
  - **Use case list** with traceability to test cases
177
328
  - **Test results table** — TC ID, name, status badge, duration, error message
178
- - **Screenshot gallery** — inline base64 screenshots per test case
329
+ - **Screenshot gallery** — inline base64 screenshots per test case (or file paths)
179
330
  - **Console errors log** — any JS errors captured
180
331
  - **Recommendations** — auto-generated improvement suggestions based on failures
181
332
 
182
333
  ### Report format
183
- - Primary: **HTML** (self-contained, with embedded screenshots)
334
+ - Primary: **HTML** (self-contained, with embedded screenshots as base64)
184
335
  - Secondary: **Markdown** summary for quick reading
185
336
 
337
+ ### Using the Python report generator
338
+ ```bash
339
+ python scripts/generate_report.py \
340
+ --results test_results/results.json \
341
+ --screenshots test_results/screenshots/ \
342
+ --output qa_report.html
343
+ ```
344
+
345
+ ### Manual report generation
346
+ If the Python script is not available, generate the HTML report directly.
347
+ Build a self-contained HTML file with:
348
+ - A dark header with site name, URL, and timestamp
349
+ - Stat cards: total tests, passed, failed, skipped, pass rate
350
+ - A results table with status badges (green PASS, red FAIL, yellow SKIP)
351
+ - Embedded screenshots (base64-encoded PNGs)
352
+ - Recommendations section based on failures
353
+
354
+ Save the report in the current working directory or wherever the user specified.
355
+
186
356
  ---
187
357
 
188
358
  ## Workflow Summary (step-by-step)
189
359
 
190
360
  ```
191
361
  1. Receive URL or project files from user
192
- 2. Run discovery understand pages, structure, features
193
- 3. Generate use case list show to user, get approval or continue
194
- 4. Generate test plan JSON structured test cases
195
- 5. Run Playwright testscollect results + screenshots
196
- 6. Generate HTML report save to /mnt/user-data/outputs/
197
- 7. Present report to user using present_files tool
362
+ 2. Pick your execution tool (MCP > Playwright CLI > Python > Manual)
363
+ 3. Run discoveryunderstand pages, structure, features
364
+ 4. Generate use case list (10–25 use cases)
365
+ 5. Generate test planstructured test cases
366
+ 6. Run testscollect results + screenshots
367
+ 7. Generate HTML report
368
+ 8. Show the report path to the user
198
369
  ```
199
370
 
200
371
  ---
201
372
 
202
373
  ## Handling Common Situations
203
374
 
204
- **No internet access (container network restrictions)**
205
- Ask user to provide HTML files, or serve local project
206
- Use `page.set_content()` for static HTML testing
207
- Use `python3 -m http.server` for multi-page projects
375
+ **Local project without a live URL**
376
+ Serve files locally: `python -m http.server 8080` or `npx serve .`
377
+ Test against `http://localhost:8080`
378
+ Do NOT use `file://` URLs they may be blocked
208
379
 
209
380
  **Site requires authentication**
210
381
  → Ask user for test credentials OR
@@ -212,21 +383,30 @@ python3 /mnt/skills/user/web-tester/scripts/generate_report.py \
212
383
  → Mark auth-gated tests as SKIP with note
213
384
 
214
385
  **Single-page app (React/Vue/Angular)**
215
- → Wait for `networkidle` state
216
- → Use `page.wait_for_selector()` before asserting dynamic content
386
+ → Wait for page to fully render (networkidle or specific selectors)
217
387
  → Check that JS bundle loads without console errors
388
+ → Use snapshot/evaluate to verify dynamically rendered content
218
389
 
219
390
  **Large site (many pages)**
220
391
  → Focus on critical user paths first
221
392
  → Limit to top 5–10 most important flows
222
393
  → Mention in report which pages were NOT covered
223
394
 
395
+ **Status code testing (4xx/5xx pages)**
396
+ → Some tools throw errors on non-2xx responses
397
+ → Catch the error and extract the status code from it
398
+ → Or use JS `fetch()` to check status codes without navigation
399
+
400
+ **Mobile responsiveness testing**
401
+ → Resize viewport to 390×844 (iPhone) or 360×800 (Android)
402
+ → Check for horizontal overflow: `document.body.scrollWidth > window.innerWidth`
403
+ → Verify key elements are still visible and readable
404
+
224
405
  ---
225
406
 
226
407
  ## Reference Files
227
408
 
228
409
  - `references/test_case_schema.md` — JSON schema for test_plan.json
229
- - `references/report_template.md` — Report structure reference
230
- - `scripts/discover.py` — Site discovery automation
231
- - `scripts/run_tests.py` — Test execution engine
232
- - `scripts/generate_report.py` — HTML report generator
410
+ - `scripts/discover.py` — Site discovery automation (Python + Playwright)
411
+ - `scripts/run_tests.py` — Test execution engine (Python + Playwright)
412
+ - `scripts/generate_report.py` — HTML report generator (Python)
@@ -2,6 +2,10 @@
2
2
  """
3
3
  Web Tester - Site Discovery
4
4
  Auto-crawls a website to discover pages, forms, links, and interactive elements.
5
+
6
+ Usage:
7
+ python scripts/discover.py --url https://example.com --output discovery.json
8
+ python scripts/discover.py --url http://localhost:8080 --max-pages 20
5
9
  """
6
10
 
7
11
  import json
@@ -13,7 +17,8 @@ from urllib.parse import urljoin, urlparse
13
17
  try:
14
18
  from playwright.sync_api import sync_playwright
15
19
  except ImportError:
16
- print("ERROR: playwright not installed.")
20
+ print("ERROR: playwright not installed. Install with:")
21
+ print(" pip install playwright && playwright install chromium")
17
22
  sys.exit(1)
18
23
 
19
24
 
@@ -31,12 +36,20 @@ def discover_site(url, max_pages=10):
31
36
  context = browser.new_context(viewport={'width': 1280, 'height': 800})
32
37
  page = context.new_page()
33
38
 
39
+ # Register console listener BEFORE any navigation
40
+ # so we catch errors that occur during page load
41
+ console_errors = []
42
+ page.on('console', lambda msg: console_errors.append(msg.text) if msg.type == 'error' else None)
43
+
34
44
  while to_visit and len(visited) < max_pages:
35
45
  current_url = to_visit.pop(0)
36
46
  if current_url in visited:
37
47
  continue
38
48
  visited.add(current_url)
39
49
 
50
+ # Clear for each page
51
+ console_errors.clear()
52
+
40
53
  try:
41
54
  page.goto(current_url, wait_until='domcontentloaded', timeout=15000)
42
55
  page.wait_for_load_state('networkidle', timeout=8000)
@@ -51,15 +64,11 @@ def discover_site(url, max_pages=10):
51
64
  'links': [],
52
65
  'forms': [],
53
66
  'buttons': [],
54
- 'images': [],
67
+ 'images': {},
55
68
  'nav_items': [],
56
- 'console_errors': [],
69
+ 'console_errors': list(console_errors)[:5],
57
70
  }
58
71
 
59
- # Collect console errors
60
- console_errors = []
61
- page.on('console', lambda msg: console_errors.append(msg.text) if msg.type == 'error' else None)
62
-
63
72
  # Headings
64
73
  for tag in ['h1', 'h2', 'h3']:
65
74
  elements = page.locator(tag).all()
@@ -137,14 +146,18 @@ def discover_site(url, max_pages=10):
137
146
  # Images
138
147
  images = page.locator('img').all()
139
148
  broken = 0
149
+ missing_alt = 0
140
150
  for img in images:
141
151
  try:
142
152
  natural_w = img.evaluate('el => el.naturalWidth')
143
153
  if natural_w == 0:
144
154
  broken += 1
155
+ alt = img.get_attribute('alt')
156
+ if alt is None or alt.strip() == '':
157
+ missing_alt += 1
145
158
  except Exception:
146
159
  pass
147
- page_data['images'] = {'total': len(images), 'broken': broken}
160
+ page_data['images'] = {'total': len(images), 'broken': broken, 'missing_alt': missing_alt}
148
161
 
149
162
  page_data['console_errors'] = console_errors[:5]
150
163
  pages.append(page_data)
@@ -160,10 +173,10 @@ def discover_site(url, max_pages=10):
160
173
 
161
174
 
162
175
  if __name__ == '__main__':
163
- parser = argparse.ArgumentParser()
164
- parser.add_argument('--url', required=True)
165
- parser.add_argument('--max-pages', type=int, default=10)
166
- parser.add_argument('--output', default='/home/claude/discovery.json')
176
+ parser = argparse.ArgumentParser(description='Web Tester - Site Discovery')
177
+ parser.add_argument('--url', required=True, help='URL to crawl')
178
+ parser.add_argument('--max-pages', type=int, default=10, help='Max pages to visit')
179
+ parser.add_argument('--output', default='discovery.json', help='Output JSON path')
167
180
  args = parser.parse_args()
168
181
 
169
182
  print(f"\nDiscovering: {args.url}")
@@ -16,7 +16,8 @@ from pathlib import Path
16
16
  try:
17
17
  from playwright.sync_api import sync_playwright, TimeoutError as PlaywrightTimeout
18
18
  except ImportError:
19
- print("ERROR: playwright not installed. Run: pip install playwright --break-system-packages")
19
+ print("ERROR: playwright not installed. Install with:")
20
+ print(" pip install playwright && playwright install chromium")
20
21
  sys.exit(1)
21
22
 
22
23
 
@@ -290,7 +291,7 @@ if __name__ == '__main__':
290
291
  parser = argparse.ArgumentParser(description='Web Tester - Execution Engine')
291
292
  parser.add_argument('--url', required=True, help='Base URL to test')
292
293
  parser.add_argument('--test-plan', required=True, help='Path to test_plan.json')
293
- parser.add_argument('--output', default='/home/claude/test_results', help='Output directory')
294
+ parser.add_argument('--output', default='test_results', help='Output directory')
294
295
  args = parser.parse_args()
295
296
 
296
297
  run_tests(args.url, args.test_plan, args.output)