Agent skill · Audited from source
Js In Html Testing
skill · liaohch3/claude-tapMIT licenceAudited 12 Oct 2026 · source 4c2d422a35f5
Is it safe? Yes — SAFE, grade B (89/100). We read this skill's source at commit 4c2d422a35f5 and found no filesystem, network or shell access and no hard-coded secrets. What it does: Test JS logic embedded in HTML using two-layer strategy - Python unit tests + Playwright browser integration tests
Cite
Cite this page
ModelsAtlas. “Js In Html Testing (liaohch3/claude-tap)”. Retrieved 12 Oct 2026. https://modelsatlas.com/skills/liaohch3/js-in-html-testing
Trust audit
Audit 0.4.1 · source read 12 Oct 2026
SAFE means nothing in the source contradicts what the skill says it does. Grade B is shared by 17,406 of 18,389 audited skills.
What the source does
- FilesystemNone observedNo reads or writes in the source
- NetworkNone observedNo outbound calls in the source
- ShellNone observedNo commands run in the source
- DependenciesPinnedNothing floats
- SecretsNone foundNo keys in source
Five audit layers
| Layer | What we check | Result | Findings |
|---|---|---|---|
L0 Provenance | Repo owner, licence, archive status, activity | WARN | 1 |
L1 Static source | Secrets, path traversal, supply chain, hidden code | NA | 0 |
L2 Instructions | Prompt injection, authority framing, hidden directives | PASS | 0 |
L3 Inventory | The files and declarations match the source | PASS | 0 |
L4 Sandbox | Run in isolation and watch behaviour | SKIPPED why | 0 |
Gates applied: no behavioural pass.
Findings (1)
MEDIUMInventory / provenanceinv.symlink · .claude/skills
.claude/skills
- Why
- link not followed
- Fix
- —
Audit 0.4.1 · source sha 4c2d422a35f5 · 12 Oct 2026Report an issue or request a re-scan
Provenance
Who published it, and what the verdict is pinned to
- Publisherliaohch3 GitHub userOwner of the repository this skill is read from
- Source folderliaohch3/claude-tap/.agents/skills/js-in-html-testingThe exact folder we audited
- LicenceMITAs the repository states it
- Commit pinned for this verdict4c2d422a35f5A new audit runs when the source changes
- Repository statusNot archivedLast push 2 days ago
- Sandboxed runNot runSkills are read, not executed; layer L4 is skipped
What it tells the agent
Full source on GitHub ↗Its description: Test JS logic embedded in HTML using two-layer strategy - Python unit tests + Playwright browser integration tests
---
name: js-in-html-testing
description: Test JS logic embedded in HTML using two-layer strategy - Python unit tests + Playwright browser integration tests
user_invocable: false
---
# JS-in-HTML Two-Layer Testing Strategy
For JavaScript logic embedded in HTML files (e.g., diff navigation in viewer.html), use a two-layer testing approach.
## Layer 1: Python Unit Tests (fast algorithm verification)
Replicate core JS algorithms in Python and verify correctness via pytest.
Best for: pure computation logic, state decisions, matching algorithms — anything that doesn't depend on the DOM.
**Example**: `tests/test_diff_matching.py`
```python
# Replicate JS findPrevSameModel / findNextSameModel
def find_diff_parent_by_prefix(entries, idx): ...
def find_next_by_prefix(entries, idx): ...
# Replicate JS updateNavButtons state computation
def compute_nav_button_states(entries, cur_idx):
prev_idx = find_diff_parent_by_prefix(entries, cur_idx)
...
return (prev_enabled, next_enabled)
```
Advantages: fast (0.02s), no browser dependency, integrates with existing pytest setup.
## Layer 2: Playwright Browser Integration Tests (DOM interaction verification)
Generate HTML with test data embedded, open it in real Chromium via Playwright, and verify DOM state and user interactions.
Best for: button disabled states, overlay show/hide, keyboard events, click navigation, etc.
**Example**: `tests/test_nav_browser.py`
### Building test HTML
```python
def _build_test_html():
from claude_tap.viewer import VIEWER_SCRIPT_ANCHOR, _read_viewer_template
template = _read_viewer_template()
records = [json.dumps(e) for e in TEST_ENTRIES]
data_js = "const EMBEDDED_TRACE_DATA = [\n" + ",\n".join(records) + "\n];\n"
# Inject data into template
return template.replace(
VIEWER_SCRIPT_ANCHOR,
f"<script>\n{data_js}</script>\n{VIEWER_SCRIPT_ANCHOR}",
1,
)
```
### Playwright fixture
```python
@pytest.fixture(scope="module")
def browser_page(html_file):
from playwright.sync_api import sync_playwright
pw = sync_playwright().start()
browser = pw.chromium.launch(headless=True)
page = browser.new_page()
page.goto(f"file://{html_file}")
page.wait_for_selector(".sidebar-item", timeout=5000)
yield page
browser.close()
pw.stop()
```
### Verifying DOM state
```python
def _get_nav_state(page):
return page.evaluate("""() => {
const overlay = document.querySelector('.diff-overlay');
if (!overlay) return { overlayExists: false };
return {
overlayExists: true,
prevDisabled: overlay.querySelector('.diff-nav-prev')?.disabled,
nextDisabled: overlay.querySelector('.diff-nav-next')?.disabled,
title: overlay.querySelector('.diff-title')?.textContent,
};
}""")
```
### Simulating user interaction
```python
# Click buttons
page.click(".diff-nav-next")
# Keyboard navigation
page.keyboard.press("ArrowRight")
# Call internal JS functions
page.evaluate("selectEntry(2)")
page.evaluate("showDiff()")
```
## Notes
- Trace data may contain `</script>` text (e.g., when Claude discusses code), which breaks `<script>` block parsing. Escape it: `line.replace("</script>", '</scr" + "ipt>')`
- Test data must match the viewer's expected JSONL format (including `turn`, `duration_ms`, `request_id`, `request.path`, etc.)
- Playwright requires `uv pip install playwright`
## Running
```bash
# Fast unit tests
uv run pytest tests/test_diff_matching.py -v
# Browser integration tests
uv run pytest tests/test_nav_browser.py -v
# All (excluding slow e2e)
uv run pytest tests/ --ignore=tests/test_e2e.py -v
```Excerpt, first 3,694 characters of SKILL.md, verbatim from the audited commit. It is text from someone else’s repository, quoted so you can judge it before your agent reads it.
Install
Pinned to the audited commit 4c2d422
uv run pytest tests/test_diff_matching.py -v uv run pytest tests/test_nav_browser.py -v uv run pytest tests/ --ignore=tests/test_e2e.py -v
git clone https://github.com/liaohch3/claude-tap git -C claude-tap checkout 4c2d422a35f5
Commands as the repository documents them: shown, never run by us. Our verdict covers commit 4c2d422a35f5 only.
Works in
The author has not said which agents this skill supports, and we have not tested it in any.
Audit history
Every audit, every source change
- ✓SAFE B 89 / 100
first audit · source
4c2d422a35f5
README badge
For maintainers · shows the latest audit
[](https://modelsatlas.com/skills/liaohch3/js-in-html-testing/)
The badge shows our verdict and grade for this skill, and links back to this page. It changes when the audit does.
Similar skills
All testing skills →liaohch3/claude-tap
Run PR-grade real Codex E2E validation through claude-tap, including resume turns, multiple tool calls, optional image input, viewer verification, and screenshot evidence.
liaohch3/claude-tap
Generate demo assets (GIF/MP4) from real tmux E2E runs and viewer screenshots using asciinema and Playwright
liaohch3/claude-tap
Run claude-tap end-to-end tests with pytest
liaohch3/claude-tap
Validate maintainer docs structure, standards freshness, manifest paths, and plan state. Run this after modifying any file under .agents/docs/standards/, .agents/docs/plans/, .agents/docs/architecture/, or AGENTS.md —…
liaohch3/claude-tap
Record browser test videos with Playwright for PR review and bug fix verification
liaohch3/claude-tap
Full pre-PR merge-readiness check. Run this before opening or merging a pull request — it validates local gates (lint, format, tests), CI status, screenshot evidence, and PR metadata in one pass. Also useful for…
Add this badge to your README
[](https://modelsatlas.com/skills/liaohch3/js-in-html-testing/)
<a href="https://modelsatlas.com/skills/liaohch3/js-in-html-testing/"><img src="https://modelsatlas.com/skills/liaohch3/js-in-html-testing/badge.svg" alt="ModelsAtlas: SAFE B"></a>
Questions about Js In Html Testing
What does the Js In Html Testing skill do?
Is Js In Html Testing safe to install?
What can Js In Html Testing access on my machine?
How current is this page?
Sources
- github.com/liaohch3/claude-tap/tree/main/.agents/skills/js-in-ht — the audited source at commit 4c2d422a35f5 and every finding aboveObserved · 12 Oct 2026
Spotted something wrong? Report a correction · Methodology
Keep going in your AI
Opens with this page as the source. We add nothing else to the prompt.
- What does the Js In Html Testing skill do?
- Is Js In Html Testing safe to install?
- What can Js In Html Testing access on my machine?