vendredi 28 avril 2017

Calabash Conditional Scenario Runs

To set the scene, this will be in regards to Calabash-iOS tests. I have a dashboard with multiple scrollable cells. The cells can also be individually resized and reorganized. In addition to that, when you log out and log back into the app, it will remember the state it was in previously before.

I currently have a test that will pinch on the cell to enlarge it and pinch again to shrink it. However, I am unsure of how to check the state of the cell to run specific scenarios. I have a text that will either appear or disappear depending on the state of the cell. So, I will have the following:

Example:
Scenario 1: Enlarging small cell state
  And I don't see the text "text1"
  When I pinch to zoom in on "Cell1"
  And I wait for 5 seconds
  Then I should see "text1"   
  When I pinch to zoom out on "Cell1"   
  And I wait for 5 seconds   
  Then I should not see "text1"

Scenario 2: Enlarge small cell
  Given the app has launched
  And I don't see the text "text1"
  When I pinch to zoom in on "Cell1"
  And I wait for 5 seconds
  Then I should see "text1"
  When I pinch to zoom out on "Cell1"
  And I wait for 5 seconds
  Then I should not see "text1"

My question is - Is there a way for me to determine before hand if "text1" exists to run one scenario and if it doesn't exist, then run the other one?

Aucun commentaire:

Enregistrer un commentaire