Automated frontend testing with Cypress in Gladys!

Hello everyone,

Recently, we have had some deployments that have broken some parts of the frontend.

As the frontend is hosting more and more integrations, and more and more screens, it is becoming longer and more complicated to manually test that each new version does not bring regression ^^

In the same way that the backend has automated tests (which cover more than 95% of the code), we have therefore decided to add automated tests to the frontend, with Cypress!

@AlexTrovato has done all the groundwork around the technology to understand how it works and how we could put it in Gladys, and today I have merged the first part of this development! (Cypress tests by atrovato · Pull Request #1086 · GladysAssistant/Gladys · GitHub). A big thank you for the work done :folded_hands:

Today, we have frontend tests:

  • On the signup process
  • On the login process
  • On the bluetooth integration

This is really the beginning of frontend tests in Gladys, and now the goal is to add as many as possible, both on new developments and on existing features.

I made a small video of the tests running on my local machine:

https://streamable.com/1fqfz5

I find it quite funny to see, it’s really like a user walking very quickly in Gladys and testing very quickly a lot of scenarios :slight_smile:

The documentation

I wrote a small doc that summarizes how to run Cypress tests locally:

It’s really summary for now, I think it should be expanded with the « best practices Â» you wrote in your presentation @AlexTrovato? :slight_smile:

@AlexTrovato I’m adding Cypress tests, so I’m struggling with react-select :smiley:

I have several possible approaches:

  • Either I go for the « type Â» approach, where I type what I want to select and then press « enter Â»
  • Or I go for the « class Â» approach and try to click, but it’s not easy

For now, it looks like this:

https://streamable.com/z34ruy

I’m having a great time, it’s really fluid and easy to do :slight_smile:

Hello, did you manage to get the select?

I didn’t have time to finish (release v4.3.1 and others), I’ll get back to it next week :slight_smile: I’ll make it!