testing-strategy-vitest-playwright

Define Vitest and Playwright testing strategies for Foundry VTT modules.

1|Updated Mar 15, 2025
One-click install
npx skills add https://github.com/herveDarritchon/foundryvtt-swerpg --skill testing-strategy-vitest-playwright
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: testing-strategy-vitest-playwright
Source: https://github.com/herveDarritchon/foundryvtt-swerpg/tree/main/.agents/skills/testing-strategy-vitest-playwright
Command: npx skills add https://github.com/herveDarritchon/foundryvtt-swerpg --skill testing-strategy-vitest-playwright

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps developers add, review, and stabilize tests for the SWERPG system in Foundry Virtual Tabletop, ensuring reliable and comprehensive test coverage.

Core Features & Use Cases

  • Unit and Integration Testing: Provides strategies for Vitest tests covering rules, data transformations, and UI logic.
  • End-to-End Automation: Guides the use of Playwright for real browser workflows such as actor sheets, settings, and importers.
  • Use Case: Automate regression tests for complex Foundry modules, reducing manual testing time and preventing regressions.

Quick Start

Use this Skill to set up and improve your testing infrastructure with clear rules and best practices.

Frequently Asked Questions about testing-strategy-vitest-playwright

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

FAQPage Schema
How do I set up automated testing for Foundry VTT modules?

Vitest and Playwright are integrated to establish comprehensive testing strategies for Foundry VTT, covering unit, integration, and E2E workflows. This combination ensures high reliability and maintainability in module development by automating regression tests for complex systems.

Can I use Playwright for end-to-end UI testing in Foundry VTT?

Playwright is used for end-to-end UI testing in Foundry VTT to automate real browser workflows such as actor sheets, settings, and importers. This approach reduces manual testing time and prevents regressions by validating complex user interactions directly within the browser environment.

What is the best way to organize Vitest unit tests for Foundry VTT systems?

Organizing Vitest unit tests for Foundry VTT systems involves structuring tests to cover rules, data transformations, and UI logic. The strategy provides clear rules and best practices for test organization and mock usage to stabilize testing workflows and ensure comprehensive coverage.

Does this testing strategy support both unit and integration testing workflows?

This testing strategy supports both unit and integration testing workflows using Vitest. It provides specific strategies for testing rules, data transformations, and UI logic, ensuring comprehensive coverage and high reliability across module development for the Foundry Virtual Tabletop platform.

Why use Vitest and Playwright together for Foundry VTT module development?

Vitest and Playwright are used together to separate fast unit logic testing from browser-based end-to-end workflows. This combination streamlines testing workflows, stabilizes complex module development, and ensures high maintainability by targeting specific testing layers effectively.

How do I stabilize flaky E2E tests in Foundry VTT?

Stabilizing flaky E2E tests in Foundry VTT involves applying stability best practices tailored for the platform using Playwright. The strategy guides setup, mock usage, and test organization to ensure high reliability and maintainability when automating real browser workflows like actor sheets and importers.