zeebe-spec
zeebe-spec copied to clipboard
Add action "wait-for-state-transition"
Is your feature request related to a problem? Please describe. Not really a problem, more an inconvenience. If I wanted to write a test to wait that a certain timer has been fired twice, currently this would mean:
-
await-element-instance-state - activated
-
await-element-instance-state - completed
-
await-element-instance-state - activated
-
await-element-instance-state - completed
This makes it difficult to understand the intention of the test.
A shorthand action could be introduced to first wait for one state, than another state. The shorthand could also check that the transition makes sense (e.g. activated to completed makes more sense then completed to activated)
Describe the solution you'd like I'd like to have an action with the following spec:
- action: await-element-instance-state-transition
args:
element_name: B
from-state: activated
to-state: completed
Additional context Not sure how relevant this will be for the tests, but this could also be a place to specify for the test to wait for the n-th state transition.
I like the idea :+1:
To be more flexible and avoid multiple actions, we could check for a list of state transitions:
- action: await-element-instance-state-transition
args:
element_name: B
state_tranisitions: activated, completed
- action: await-element-instance-state-transition
args:
element_name: non-interupting timer event
state_tranisitions: completed, completed