frondeus / fvtt-syrin-control

Syrinscape Online Control plugin for FoundryVTT
MIT License
13 stars 4 forks source link

New E2E suite #64

Open frondeus opened 1 year ago

frondeus commented 1 year ago

Context

SyrinControl grows in new features every release. It means it's getting harder and harder to test it manually with all the edge cases in mind. Because I want a stable and trouble-free module, E2E (end-to-end) tests are necessary. By automating the test suite, we can ensure some quality control.

Moreover, good E2E tests can be used as a learning tool for newcomers, and if we could record them - as free documentation on how to run this module :)

Specs

I chose Cypress.io as my E2E framework. It does support WebGL (used by pixi.js), and runs directly in the target browser. Let's prepare a cypress suite per feature:

A test suite should intercept the HTTP requests to Syrinscape API and stub the responses. First of all, we do not want to overload already slow Syrinscape servers, but we do not want to entirely depend on an external API that might have an outage.

All tests should be isolated. Each test should clear the world before it starts. By clearing the world, I mean removing ambient sounds, and playlists, clearing cache, removing scenes, etc. Each test should have only a blank slate and not be interfered with by another.

Tests should run in one thread.

Acceptance criteria

References