feat(e2e): add Cypress to the project for E2E testing #399
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I think it's time to start looking at adding E2E tests (UI testing). We used to have Selenium back in the days, but that was hard to install and run. The JavaScript world have come a long way and new tools, the best tool that I've found so far and is super easy to install (it's all in the PR) is Cypress.io, it's quite easy to program tests and it works universally. It doesn't need any framework or anything except running an npm command to install it, just run
npm install
(oryarn
) and then runnpm run cypress:open
or even better if you have VScode, just run the task "Cypress Open GUI" that I added. Here's a quick intro video of CypressThere's a ton of things we can do with Cypress, drag & drop, click buttons, scroll, etc... and what is funny is that while doing this very quick and basic test, I actually found a bug in the Grid Menu which I'll have to fix later (now fixed in PR #402).
See animated GIF of the very simple test I added for the Grid Menu example. It runs the tests against the GitHub demo page.
Also note, this is just a structure to start with, I intend to add more in the future and also wish (plan) to add this to our build process, so there would be less surprises. First thing to do in the future, would be to start looking into running this locally instead of the now github demo page.