Playground: Automated WASM testing infrastructure with headless browser #239

Open
opened 2026-02-02 20:51:20 +00:00 by john · 0 comments
Owner

Overview

Create automated testing infrastructure for McRogueFace WASM builds using headless browser execution. This enables CI integration and regression testing for the playground and Emscripten deployments.

Scope

Test Runner Script

Create tests/wasm/run_wasm_tests.py using Playwright:

  • Launch headless Chromium
  • Load playground page
  • Wait for runtime initialization
  • Execute Python code via window.runPython()
  • Capture and validate output
  • Report pass/fail status

Test Cases

  • Basic expression evaluation
  • Module imports (mcrfpy)
  • UI object creation
  • Syntax error recovery
  • Runtime error recovery
  • State persistence between runs
  • Reset functionality

Makefile Integration

test-wasm: wasm
    # Start local server, run tests, cleanup

CI Integration

GitHub Actions or similar:

  • Setup Emscripten SDK
  • Build WASM target
  • Install Playwright + Chromium
  • Run test suite

Dependencies

  • Python 3.x
  • Playwright (pip install playwright)
  • Chromium (installed via playwright install chromium)

References

Part of playground improvement initiative documented in docs/PLAYGROUND_IMPROVEMENT_PLAN.md (Phase 4)

## Overview Create automated testing infrastructure for McRogueFace WASM builds using headless browser execution. This enables CI integration and regression testing for the playground and Emscripten deployments. ## Scope ### Test Runner Script Create `tests/wasm/run_wasm_tests.py` using Playwright: - Launch headless Chromium - Load playground page - Wait for runtime initialization - Execute Python code via `window.runPython()` - Capture and validate output - Report pass/fail status ### Test Cases - Basic expression evaluation - Module imports (mcrfpy) - UI object creation - Syntax error recovery - Runtime error recovery - State persistence between runs - Reset functionality ### Makefile Integration ```makefile test-wasm: wasm # Start local server, run tests, cleanup ``` ### CI Integration GitHub Actions or similar: - Setup Emscripten SDK - Build WASM target - Install Playwright + Chromium - Run test suite ## Dependencies - Python 3.x - Playwright (`pip install playwright`) - Chromium (installed via `playwright install chromium`) ## References - [Emscripten Test Suite](https://emscripten.org/docs/getting_started/test-suite.html) - [Playwright Python](https://playwright.dev/python/) - [emrun for Browser Testing](https://emscripten.org/docs/compiling/Running-html-files-with-emrun.html) ## Related Part of playground improvement initiative documented in `docs/PLAYGROUND_IMPROVEMENT_PLAN.md` (Phase 4)
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
john/McRogueFace#239
No description provided.