You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**Note:** The server watches source files, not template files. If you modify `.rhtml` templates or CSS in the template directory, restart the server to pick up those changes.
364
362
363
+
## Visual Testing with Playwright CLI
364
+
365
+
Use `npx playwright` to take screenshots of generated documentation — works with both the live-reload server and static `_site/` output.
For server-specific E2E testing (endpoint checks, live-reload verification, file change detection), use the `/test-server` skill.
383
+
365
384
## Notes for AI Agents
366
385
367
386
1.**Always run tests** after making changes: `bundle exec rake`
@@ -373,68 +392,3 @@ When making changes to theme CSS or templates (e.g., Darkfish or Aliki themes):
373
392
4.**Use `rake rerdoc`** to regenerate documentation (not just `rdoc`)
374
393
5.**Verify generated files** with `rake verify_generated`
375
394
6.**Don't edit generated files** directly (in `lib/rdoc/markdown/` and `lib/rdoc/rd/`)
376
-
377
-
## Playwright MCP for Testing Generated Documentation
378
-
379
-
The Playwright MCP server enables visual inspection and interaction with generated HTML documentation. This is useful for verifying CSS styling, layout issues, and overall appearance.
380
-
381
-
**MCP Server:**`@playwright/mcp` (Microsoft's official browser automation server)
382
-
383
-
### Setup
384
-
385
-
The Playwright MCP server can be used with any MCP-compatible AI tool (Claude Code, Cursor, GitHub Copilot, OpenAI Agents, etc.).
386
-
387
-
**Claude Code:**
388
-
389
-
```bash
390
-
/plugin playwright
391
-
```
392
-
393
-
**Other MCP-compatible tools:**
394
-
395
-
```bash
396
-
npx @playwright/mcp@latest
397
-
```
398
-
399
-
Configure your tool to connect to this MCP server. Playwright launches its own browser instance automatically - no manual browser setup or extensions required.
If you encounter `DevTools remote debugging is disallowed by the system admin`, Chrome's debugging is blocked by the machine's policy. Use Firefox instead:
404
-
405
-
```bash
406
-
# Install Firefox for Playwright
407
-
npx playwright install firefox
408
-
409
-
# Add Playwright MCP with Firefox to your project (creates/updates .mcp.json)
The easiest way to test documentation is with the live-reloading server:
418
-
419
-
```bash
420
-
bundle exec rdoc --server
421
-
# Or: bundle exec rake rdoc:server
422
-
```
423
-
424
-
This starts a server at `http://localhost:4000` that auto-refreshes on file changes.
425
-
426
-
Alternatively, for testing static output:
427
-
428
-
```bash
429
-
bundle exec rake rerdoc
430
-
cd _site && python3 -m http.server 8000
431
-
```
432
-
433
-
Then ask the AI assistant to inspect the documentation. It will use the appropriate Playwright tools (`browser_navigate`, `browser_snapshot`, `browser_take_screenshot`, etc.) based on your request.
434
-
435
-
**Example requests:**
436
-
437
-
- "Navigate to `http://localhost:4000` and take a screenshot"
438
-
- "Take a screenshot of the RDoc module page"
439
-
- "Check if code blocks are rendering properly on the Markup page"
440
-
- "Compare the index page before and after my CSS changes"
0 commit comments