Probar

Probar (Spanish: "to test/prove") is a Rust-native testing framework for WASM games, providing a pure Rust alternative to Playwright/Puppeteer.

Probar Coverage Visualization

Installation

Probar is distributed as two crates:

CratePurposeInstall
jugar-probarLibrary for writing testscargo add jugar-probar --dev
probadorCLI tool for running testscargo install probador

Library (jugar-probar)

Add to your Cargo.toml:

[dev-dependencies]
jugar-probar = "0.3"
#![allow(unused)]
fn main() {
use jugar_probar::prelude::*;
}

CLI (probador)

cargo install probador
# Validate a playbook state machine
probador playbook login.yaml --validate

# Run with mutation testing
probador playbook login.yaml --mutate

# Export state diagram
probador playbook login.yaml --export svg -o diagram.svg

# Start dev server for WASM
probador serve --port 8080

Features

  • Browser Automation: Chrome DevTools Protocol (CDP) via chromiumoxide
  • WASM Runtime Testing: Logic-only testing via wasmtime (no browser overhead)
  • Visual Regression: Image comparison for UI stability
  • Accessibility Auditing: WCAG compliance checking
  • Deterministic Replay: Record and replay game sessions
  • Monte Carlo Fuzzing: Random input generation with invariant checking
  • Type-Safe Selectors: Compile-time checked entity/component queries
  • GUI Coverage: Provable UI element and interaction coverage

Feature Flags

FeatureDescription
browserCDP browser automation (chromiumoxide, tokio)
runtimeWASM runtime testing (wasmtime)
deriveType-safe derive macros (probar-derive)

Why Probar?

AspectPlaywrightProbar
LanguageTypeScriptPure Rust
BrowserRequired (Chromium)Optional
Game StateBlack box (DOM only)Direct API access
CI SetupNode.js + browserJust cargo test
Zero JSViolates constraintPure Rust

Design Principles

Probar is built on pragmatic testing principles:

  • Poka-Yoke (Mistake-Proofing): Type-safe selectors prevent runtime errors
  • Muda (Waste Elimination): Zero-copy memory views for efficiency
  • Jidoka (Autonomation): Fail-fast with configurable error handling
  • Genchi Genbutsu (Go and See): Abstract drivers allow swapping implementations
  • Heijunka (Level Loading): Superblock scheduling for consistent performance