The basics
Running your first workflow
Last updated
Was this helpful?
Running your first workflow
Last updated
Was this helpful?
In this tutorial, we'll create a new Node.js project, install the test suite, and run our first workflow.
Use npm, yarn, or pnpm to create a new project. Install and the LetsFlow test suite.
Copy the cucumber configuration from the test suite and create directories from the scenario and test files.
Edit package.json
and add the test:workflows
script.
The scenario describes the process we're automating. We can write a scenario in either JSON or YAML.
Create file basics.yaml
(or basics.json
) in the scenarios
directory.
A scenario has states. A new process will always start in the "initial" state. We define that if we perform the "complete" action, the process will transition to the "(done)" state.
A state with a name in parenthesis, like "(done)", is an end state. There are no transitions from an end state. Unlike normal states, end states can be used in a goto
statement without defining them explicitly.
The LetsFlow test suite comes with a predefined set of statements that can be used to test running a scenario.
Create file basics.feature
in the features
directory.
Run the test from the command line
You've successfully created and tested your first workflow.
The scenario can be tested by writing a BDD test in the language. Gherkin uses a set of special keywords to give structure and meaning so the test can be executed.