ItsSim / fsolauncher

Official FreeSO Launcher made with Electron
https://beta.freeso.org
Mozilla Public License 2.0
14 stars 9 forks source link

[Windows/Mac] Set up testing framework and add tests #32

Closed ItsSim closed 2 years ago

ItsSim commented 2 years ago

Is your feature request related to a problem? Please describe. I think using automated testing for the launcher's core functionality would allow me to evolve the launcher's features without worrying too much about breaking stuff (especially with changes like #15, #16, #30). This would also tie into the plans I had to set up CI for building the app - tests being one of the phases necessary to build and distribute the application.

This issue is more of a "food for thought" issue than something that should be done right away. Keeping it in here to give it a thought every once and a while. Might actually be implemented into the next version of the launcher instead of this one (same with CI). It's much easier to add tests when starting from scratch. So, super-low priority.

Describe the solution you'd like A testing solution should be studied for the launcher. Jest (and maybe Puppeteer?) to automate testing core launcher features (installers, launching the game), creating unit and integration tests. Also study if any current code would need refactoring to facilitate testing.

Describe alternatives you've considered There used to be a framework specifically made for Electron apps: Spectron. But I believed it has been deprecated and shouldn't be used.

Additional context Throwback to 2018 when I broke the TSO installer with an extra command line flag.

ItsSim commented 1 year ago

e2e testing for Windows and macOS was implemented using Playwright.

Most of the installation process is covered, no need to manually test on every platform every time a change is made.

More tests to be made in the future.