The FSH (Flow, Subflow, Helper) method adds a layer of responsibility for actions performed during tests by structuring test files in a modular and reusable way.
- Flow: The starting file for any test. It's the one launched with the command maestro test flow.yaml. It defines the logic of the tests using helpers and subflows.
- SubFlow: A subset of a flow, allowing multiple actions to be chained together. It is used to group reusable sequences of logical actions.
- Helper: Simple actions for navigation or content verification. They encapsulate atomic interactions with the application.
The idea of the FSH method is to approach functional programming to improve the maintainability and reusability of tests.
npm install -g maestro-fsh-cli
bun add global maestro-fsh-cli
pnpm add -g maestro-fsh-cli
yarn global add maestro-fsh-cli
Init the folder structure like:
- maestro or .maestro or e2e
- flows
- subflows
- helpers
- config.yaml
$ maestro-fsh init
The doctor
command checks the integrity of your Maestro project setup by verifying the existence of required folders.
$ maestro-fsh-cli doctor
Create file:
$ maestro-fsh-cli create flows fileName
$ maestro-fsh-cli create helpers fileName
$ maestro-fsh-cli create subflows fileName