End-end-testing with Cypress: Jan 2024 Update
As of January 31, 2024 the Cypress end-to-end testing suite created by Mika is now running on integration
Mika’s October PR: E2e test mika by mika-robots · Pull Request #2931 · LiteFarmOrg/LiteFarm
January 2024 update PR: LF-4026 Get Cypress tests passing on current state of integration by kathyavini · Pull Request #3100 · LiteFarmOrg/LiteFarm
What is tested
Mika’s test suite is modular (comprised of three sub-tests), that always run in order:
Crops
Create a new crop, crop variety, and planting management plan
Farm People
Invite a farm manager
(Fail to) invite to an invalid email
(Fail to) invite to a duplicate email
Tasks
Create a cleaning task (and complete it)
Create a field work task (and complete it)
Importantly, each test calls the same setup code which runs exactly once per workflow. As the database is freshly created each time the tests are run, this code prepares the user account and farm for the three test suites above.
The configuration code performs (and so tests) the following:
Create a new password-based account in the specified language
Note: we are currently running the tests only in English, but the test suite was designed to make it easy to run in other languages as well
Log in to the created user account
Create a new farm
Create a location on that farm
Trigger and dismiss all spotlights on those pages
Videos
The scope of coverage is best grokked by watching the runs.
To view the most up-to status of the test suite content, I recommend looking at the runs on Cypress cloud, which will still be accurate as the test suite is modified in the future: https://cloud.cypress.io/projects/wzcbom/runs
Common configuration + Crops
Farm people
Tasks