Arrange your repository for Maestro tests
Lots of teams choose to keep their Maestro tests alongside the code for their application. That way, a build from a few months back that now needs a patch also has the correct version of the tests sat with them, and a new feature branch that changes how login works can have the changes to the test flows developed right alongside.
But what's a good way to lay this out?
Boring tester answer: it depends π
Journeys
If you arrange your tests as journeys through your application, then you likely want some top-level folder to contain them, and only start organising them into deeper subfolders once they become unwieldy. Maybe you end up with something like this:
βββ flows
β βββ config.yaml
β βββ login.yaml
β βββ register.yaml
β βββ shopping.yaml
βββ src
βββ app
βββ <code here>
Which later spreads into something deeper, once you decide to start splitting. Here, I've broken this up between flows centered around new and existing users, and an extra folder to contain utility scripts that might be shared.
βββ flows
β βββ config.yaml
β βββ tests
β β βββ new_users
β β β βββ register.yaml
β β β βββ shopping_first_time_discount.yaml
β β βββ existing_users
β β βββ account_settings.yaml
β β βββ deeplink_from_email.yaml
β β βββ deeplink_from_notification.yaml
β β βββ login.yaml
β β βββ shopping.yaml
β β βββ shopping_bulk_buy_discount.yaml
β βββ utils
β βββ set_discount_code.js
βββ src
βββ app
βββ <code here>
In this example, the instructions in Controlling What Tests to Include have been used to set inclusion patterns in the config.yaml to include everything below the 'tests' folder.
Features
For testing approaches that are centered on validating the behaviours of individual features or requirements, you might choose to mirror the source structure, so that the tests are easy to find and maintain:
βββ flows
β βββ config.yaml
β βββ account
β β βββ set_display_name.yaml
β βββ auth
β β βββ login.yaml
β β βββ login_invalid.yaml
β β βββ login_locked_account.yaml
β βββ basket
β β βββ add_to_cart.yaml
β β βββ update_cart.yaml
β βββ checkout
β βββ complete_purchase.yaml
β βββ save_for_later.yaml
βββ src
βββ app
βββ account
β βββ <code here>
βββ auth
β βββ <code here>
βββ basket
β βββ <code here>
βββ checkout
βββ <code here>
Last updated
Was this helpful?