ワンクリックで
ワンクリックで
| name | eh-test |
| description | Execute end-to-end testing for eHunter on EH platform (exhentai.org) |
| license | MIT |
| compatibility | opencode |
| metadata | {"platform":"exhentai","type":"e2e-test"} |
I automate the complete testing workflow for eHunter userscript on the EH platform:
npm run build-prod and verify successchrome-devtools-mcp_list_console_messagesehunter-app element exists using chrome-devtools-mcp_take_snapshotUse this skill when:
Before running this skill, ensure:
vite.config.prod.ts) is validImportant - Dynamic Script Loading:
The Tampermonkey script is configured to dynamically load dist/ehunter.iife.js from the local build output. This means:
npm run build-prod, simply refresh the image page to see changes/s/ pattern like https://exhentai.org/s/80813c92df/3482416-1)/g/ URLs) will NOT trigger the script injectionBefore running the full test, you can verify Tampermonkey is properly configured:
Using chrome-devtools-mcp_evaluate_script:
() => {
return {
hasTampermonkey: typeof GM_info !== 'undefined',
tampermonkeyVersion: typeof GM_info !== 'undefined' ? GM_info.version : null,
scriptsRunning: typeof GM_info !== 'undefined' ? GM_info.scriptHandler : null
}
}
Expected Result: hasTampermonkey: true indicates Tampermonkey is active.
npm run build-prod
I will:
dist/ehunter.iife.js exists and has contentNote: The Tampermonkey script will automatically load this file on the next page refresh.
I will use chrome-devtools-mcp to:
https://exhentai.org/s/80813c92df/3482416-1/s/ URL (image page), NOT /g/ URL (gallery list page)Why image page? The Tampermonkey script only injects on image pages where the reader UI is displayed. Gallery list pages (/g/ URLs) will not trigger the script.
After building, I will:
chrome-devtools-mcp_navigate_page with type: "reload" and ignoreCache: truedist/ehunter.iife.jsWhat happens during injection:
dist/ehunter.iife.js dynamically#ehunter-app elementImportant: After waiting, console logs may not appear immediately in the current navigation context. Use includePreservedMessages: true when calling chrome-devtools-mcp_list_console_messages to retrieve logs across recent navigations.
Using chrome-devtools-mcp_list_console_messages:
includePreservedMessages: true parameter to retrieve logs across recent navigationstypes: ["error"] to find errorstypes: ["log", "info"] to verify eHunter initializationExample Usage:
chrome-devtools-mcp_list_console_messages({
includePreservedMessages: true,
types: ["log", "info", "error"]
})
Expected Console Logs:
"eHunter: Platform detected: EH" - Platform detection successful"[EH Platform] initialized successfully" - Initialization completeWhy includePreservedMessages: true is required:
list_console_messages() only returns messages from the current navigationincludePreservedMessages: true retrieves logs across the last 3 navigationsUsing chrome-devtools-mcp_take_snapshot:
id="ehunter-app"Expected Behavior: Since Tampermonkey is pre-configured, the ehunter-app element should be present in the DOM with child elements rendered by Vue. If the element is empty or missing, this indicates an initialization failure.
Execute these default test cases:
Core Functionality:
User can specify custom tests via arguments:
Use skill eh-test with tests: book-mode, scroll-mode, thumbnail-expand
I will generate a structured report:
## eHunter EH Platform Test Report
**Timestamp:** [ISO 8601 timestamp]
**Test URL:** https://exhentai.org/g/3482416/a3e66d7d79/
### Build Status
✅ Success / ❌ Failed
[Build output summary]
### Page Load
✅ Success / ❌ Failed / ⚠️ Timeout
[Load time, status code]
### Console Errors
Found X errors:
- [Error 1 details]
- [Error 2 details]
### DOM Mounting
✅ Mounted / ❌ Not Found
Element ID: ehunter-app
Children count: X
### Functional Tests
Passed: X/Y
- ✅ Album metadata loaded
- ✅ Thumbnail grid rendered
- ❌ Reader mode failed to open
- ...
### Screenshots
[Attach relevant screenshots at key steps]
### Recommendations
[Actionable suggestions based on failures]
| Error Type | Action |
|---|---|
| Build failure | Stop immediately, report build errors with full output |
| Page load timeout | Retry once with 10s timeout, then report failure |
| Authentication required | Prompt user to check exhentai cookies |
| DOM not found | Check if script was injected, verify userscript manager is active |
| Console errors | Distinguish between eHunter errors and page errors, prioritize eHunter errors |
Use skill eh-test
Use skill eh-test with url: https://exhentai.org/g/1234567/abcdef1234/
Use skill eh-test with tests: reader-open, image-load, settings-panel
Use skill eh-test with mode: quick
AGENTS.md.opencode/test-reports/eh-test-[timestamp].mdBuild fails with TypeScript errors:
npm run type-check first to identify issuestsconfig.json and vite.config.prod.tsTampermonkey script auto-updates:
dist/ehunter.iife.js on each page loadnpm run build-prod, simply refresh the gallery pageScript only loads on image pages:
https://exhentai.org/s/[token]/[id]-[page] ✅https://exhentai.org/g/[id]/[token]/ ❌Page shows "Sad Panda" (403 error):
DOM element not found:
/s/ URL, not /g/ URL)dist/ehunter.iife.js exists and was built successfullyConsole shows "GM_ is not defined":*
@grant directives in script headerCannot see console logs / logs appear empty:
includePreservedMessages: true when calling chrome-devtools-mcp_list_console_messageschrome-devtools-mcp_list_console_messages({ includePreservedMessages: true })