Skip to content
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

Add action "wait-for-state-transition" #18

Open
pihme opened this issue Sep 29, 2020 · 1 comment
Open

Add action "wait-for-state-transition" #18

pihme opened this issue Sep 29, 2020 · 1 comment
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@pihme
Copy link
Contributor

pihme commented Sep 29, 2020

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.

@pihme pihme added the enhancement New feature or request label Sep 29, 2020
@saig0
Copy link
Collaborator

saig0 commented Sep 30, 2020

I like the idea 👍

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
Status: 1️⃣ Good First Issue
Development

No branches or pull requests

2 participants