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

What is tested

Mika’s test suite is modular (comprised of three sub-tests), that always run in order:

 

  1. Crops

    1. Create a new crop, crop variety, and planting management plan

  2. Farm People

    1. Invite a farm manager

    2. (Fail to) invite to an invalid email

    3. (Fail to) invite to a duplicate email

  3. Tasks

    1. Create a cleaning task (and complete it)

    2. 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

 

  1. Common configuration + Crops

crops.js.mp4

 

  1. Farm people

farm_people.js.mp4

 

  1. Tasks