jugar-probar
jugar-probar is the Rust library for Probar - a Playwright-compatible testing framework for WASM games and applications.
Note: The CLI tool is published separately as probador.
Installation
Add to your Cargo.toml:
[]
= "0.3"
With specific features:
[]
= { = "0.3", = ["browser", "runtime", "derive"] }
Quick Start
use *;
Features
Playwright Parity
- CSS, text, testid, XPath, role-based locators
- All standard assertions (visibility, text, count)
- All actions (click, fill, type, hover, drag)
- Auto-waiting with configurable timeouts
- Network interception and mobile emulation
WASM-Native Extensions
- Zero-copy memory views - Direct WASM memory inspection
- Type-safe entity selectors - Compile-time verified game object access
- Deterministic replay - Record inputs with seed, replay identically
- Invariant fuzzing - Concolic testing for game invariants
- Frame-perfect timing - Fixed timestep control
- WCAG accessibility - Color contrast and photosensitivity checking
Feature Flags
| Feature | Description |
|---|---|
browser |
CDP browser automation (chromiumoxide, tokio) |
runtime |
WASM runtime testing (wasmtime) |
derive |
Type-safe derive macros (probar-derive) |
Examples
# Deterministic simulation with replay verification
# Playwright-style locator API demo
# WCAG accessibility checking
# GUI coverage tracking
API Overview
Assertions
use Assertion;
// Value equality
let eq = equals;
// Numeric range
let range = in_range;
// Boolean checks
let truthy = is_true;
// Approximate equality (floats)
let approx = approx_eq;
GUI Coverage
use gui_coverage;
let mut gui = gui_coverage! ;
gui.click;
gui.visit;
println!; // "GUI: 33% (1/3 elements, 1/3 screens)"
assert!; // Fail if below 80%
Simulation
use ;
// Record a simulation
let config = new;
let recording = run_simulation;
// Replay and verify determinism
let replay = run_replay;
assert!;
CLI Tool
For command-line usage, install the CLI separately:
# Validate playbook state machines
# Run mutation testing
# Export state diagrams
Documentation
License
MIT OR Apache-2.0