BackStoryOrg / website

Landing page for backstory.ink
Other
0 stars 0 forks source link

Testing framework decisions #10

Open rendall opened 9 months ago

rendall commented 9 months ago

The website needs a testing framework. Eventually it will (likely) have a portal through which our creatives interact with our engine, world, pitching system, and BackStory audiences interact with stories and other content.

Let us use this discussion as a forum to come to a consensus about the best one(s) to use for our needs. Here are some to consider:

We want to think about ease of use and support. I was on a team that used Testing Library and Storybook for the Frontend and Jest for the backend. Worked quite well together, but I want to invite thoughts.

SundayTyper commented 9 months ago

I've used Cypress before and it is dead-easy. Although their analytics and multi-processing features are locked behind a paywall, so the free tier is not desperately fast. Especially as it will render a site and interact via the UI.

Storybook is also a good choice for creating and storing components to use in multiple places (i.e. banners, logos, table stylings)

A different test framework I liked was Playwright. It has asynchronous waits (like Cypress), but runs headlessly by default, so it will execute tests faster. I think it's also got some decent integrations with jQuery and Jest for load testing. As well as exporting its results to a file whch we can create an internal dashboard for

rendall commented 9 months ago

I've used Cypress too and quite like it. However, it can take a lot of time to maintain. We might consider using it, but only for vital user flows, e.g. log in and out, pitching

Storyboard is pretty great, especially for component-heavy sites. You test the front-end components in isolation and can test each state independently. Also, you can see each component visually.

Jest is an industry standard and has lots of support. I've been using vitest for the engine and it's a drop-in replacement for jest. So far, no complaints and it is definitely faster. On the other hand, it was not as informative when there were inefficiencies in the code.

Testing Library is an enhancement of Jest, and I think we should use it for frontend work. Storybook is more of a visual testing framework and development tool, while Testing Library tests internal logic and state.

I have not used Playwright and will take a look. We will be moving away from jQuery, though. Load testing is 👍🏻