microsim-iframe-tester
Installation
SKILL.md
MicroSim Iframe Height Tester
Purpose
MicroSims are embedded in MkDocs pages via <iframe> tags with fixed heights and scrolling="no". If the iframe height is too short, controls at the bottom (sliders, buttons, dropdowns) get clipped and students can't interact with them. This skill automates checking that every MicroSim's controls are fully visible at the declared iframe height.
How It Works
Always use the Python script (scripts/test-iframe-heights.py) — it only requires pip install playwright and avoids any Node.js/npm dependency. A legacy Node.js version (scripts/test-iframe-heights.js) exists but should not be used. The script uses Playwright to:
- Find all MicroSim directories under
docs/sims/ - Read each
index.mdto extract the declared iframe height - Load
main.htmlin a browser viewport constrained to that height - Wait for p5.js (or other libraries) to finish rendering controls
- Find all interactive elements (buttons, sliders, selects, inputs, checkboxes)
- Check whether each element's bounding box fits within the iframe height
- Measure the actual content height needed
- Report pass/fail with recommended height for failures