pixi-vn-testing

Play-test Pixi'VN games end-to-end in a browser via the Game.testing window bridge.

145|9|Updated Feb 14, 2024
One-click install
npx skills add https://github.com/DRincs-Productions/pixi-vn --skill pixi-vn-testing-drincs-productions
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pixi-vn-testing
Source: https://github.com/DRincs-Productions/pixi-vn/tree/main/skills/testing
Command: npx skills add https://github.com/DRincs-Productions/pixi-vn --skill pixi-vn-testing-drincs-productions

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @drincs/pixi-vn.

What problem does it solve? Automated or agent-driven playtesting of a Pixi'VN game fails when calling narration functions directly, because steps expect the app's live StepLabelProps (navigate, t, toast). This Skill teaches how to enable and drive the Game.testing devtools bridge on window so external scripts can play the game exactly like a real player. ## Core Features & Use Cases - Browser-based game control: Start labels, continue steps, select choices, answer input prompts, go back, and close labels through window.pixiVN. - Live props and action routing: setProps injects the app's real StepLabelProps, and setActions routes testing calls through the app's own UI functions so agent actions match real player behavior. - State control and error capture: Seed or assert storage, snapshot/restore full game state, and collect errors raised during automated runs. - Use Case: An AI agent starts the game at label "start", reads getState() to see open choices, selects choice 0, seeds storage with gold: 100, and verifies the shop unlocks — all as a headless regression test. ## Quick Start Enable Game.testing in dev mode, then ask the agent to start the game at the start label and play through the story by reading getState and calling continue or selectChoice on window.pixiVN.

Frequently Asked Questions about pixi-vn-testing

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I play-test a Pixi'VN game from a script or AI agent?

Enable Game.testing so the API is exposed on window (default key pixiVN), then evaluate async calls like start, continue, selectChoice, and goBack in the page. Read getState() first to see the current dialogue, choices, and input requirements before acting.

Why does calling narration.continue from the browser console throw an error?

narration.continue expects StepLabelProps, which most apps augment with fields like navigate or t, so passing an empty object fails when a step uses them. Game.testing solves this by merging live props supplied through setProps into every action.

Is Game.testing enabled by default in Pixi'VN projects?

No, it is opt-in and disabled by default. Projects using vitePluginPixivn get it auto-enabled during vite dev (the testing option defaults to true) but never during vite build; other setups must call Game.testing.enable() behind a dev-only check.

Can I seed game storage or snapshot state during automated tests?

Yes, window.pixiVN exposes storage for setting flags and variables, plus Game.exportGameState and restoreGameState for snapshotting. Game.clear wipes storage, narration, history, canvas, and sound to reset between test scenarios.

How do I capture errors during an automated Pixi'VN test run?

Game.testing.enable registers its own Game.addOnError handler while active, collecting errors into window.pixiVN.errors with timestamps. Call clearErrors() between test cases so failures do not bleed across scenarios.