-
Notifications
You must be signed in to change notification settings - Fork 190
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs(play): add scenarios section #4737
base: main
Are you sure you want to change the base?
Changes from 2 commits
fd57dba
5fd23bf
012f3e4
3550ba6
4724680
0f449c9
fa0ec83
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -92,6 +92,38 @@ Play's rewind operation currently does not support the following elements: | |
- Play rewinds to an element, not to an element instance. For example, if you wanted to rewind your process to a sequential multi-instance service task which ran five times, it will rewind your process to the first instance of that service task. | ||
- Play rewinds processes by initiating a new instance and executing each element. However, if any element behaves differently from the previous execution, such as a Connector returning a different result, the rewind may fail. | ||
|
||
## Scenarios | ||
|
||
You can validate your process by creating scenarios for different paths, ensuring that it continues to function as expected after any changes to your diagram. Scenarios let you replay and confirm that the process completes correctly with the pre-defined actions and variables. | ||
|
||
### Saving a scenario | ||
|
||
After executing a path in your process, you can save it as a scenario by clicking the **Save scenario** button in the process instance header. To view your saved scenarios, navigate to the process definition page by clicking the **View all** button under the Scenarios column in the process instance header. | ||
|
||
![save scenario](img/play-save-scenario.png) | ||
|
||
### Scenario coverage | ||
|
||
Scenario coverage is calculated as the percentage of flow nodes in your process that are covered. This includes all elements, events, and gateways. For example, if 8 out of 10 flow nodes are covered, the coverage will be 80%. | ||
On the process definition page, covered paths are highlighted in blue. You can also click on individual scenarios to view their specific coverage. | ||
|
||
![save scenario](img/play-coverage.png) | ||
|
||
Once a process instance is completed, the process instance header will display how much your process scenario coverage would increase if this path were saved as a scenario. | ||
|
||
### Running a scenario | ||
|
||
Scenarios can be run from the process definition page using the **Run all scenarios** button, or by clicking the **Run scenario** button with the play icon for each individual scenario. The result of a scenario execution will be marked as **Completed** or **Failed.** Failed scenarios must be manually updated by clicking the **manually complete and update the scenario** button, especially when changes are made to your diagram that require further user input—such as when a new flow node is added to a previously saved scenario path. | ||
|
||
![save scenario](img/play-scenario-runs.png) | ||
|
||
### Limitations | ||
|
||
- Scenarios are stored in the browser's local storage, making them accessible only in the current browser and not usable outside of Play or in a different browser. | ||
huygur marked this conversation as resolved.
Show resolved
Hide resolved
|
||
- Call activities are not supported; therefore, scenarios containing them cannot be executed successfully. | ||
- Scenario paths that include process modifications are not supported. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. variable changes are actually supported |
||
- Similar to process instances, scenarios do not run in isolation. For instance, if two scenario paths are defined for a process and both contain the same message event or signal event, running these scenarios simultaneously may lead to unintended consequences. Publishing a scenario or broadcasting a signal could inadvertently impact the other scenario, resulting in the failure of both. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💭 It could be nice to include a link to the documentation for the nature of message events and signal events, where the issue with global publish/broadcast is mentioned. However, I am not aware of such a link at this moment. |
||
|
||
## Modify a process instance | ||
|
||
There are two main reasons to modify a process instance in Play: | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I applied your suggestion 👍
I am not sure though, if we should call this a 'test coverage'. But I have no better suggestion 😅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, me neither. I'm framing the value around accelerating manual testing