These are chat archives for Behat/Behat

26th
Jun 2017
Bit Wombat
@bitwombat
Jun 26 2017 07:22
If my scenario involves a sequence, is it advisable to have two or more "Given, When, Then" sets in the same scenario?
But Yes
Bit Wombat
@bitwombat
Jun 26 2017 10:33
Thanks for the doc pointers @SamyOteroGlez. But, I don't think those pages give me an answer. They say (and I knew) that there's "no real difference" between the keywords. That doesn't mean that it's wise to string Given/When/Then sets in one Scenario...
SamyOteroGlez
@SamyOteroGlez
Jun 26 2017 10:33
@bitwombat
What exactly do you want to achieve?
Can you give me an example of what you have in mind?
Bit Wombat
@bitwombat
Jun 26 2017 10:58
@SamyOteroGlez Well, I sort of lost it, but something like:
Given I'm logged in
When I go to the "Add Event" screen
Then I see different types of events to chose from.
When I then save the new event
Then the training cycle shows as complete.
Bit Wombat
@bitwombat
Jun 26 2017 11:50
So two actions making up a scenario... a sequence.
SamyOteroGlez
@SamyOteroGlez
Jun 26 2017 12:58
@bitwombat
I believe you need to isolate the tests you want to perform. Be as simple as possible every time. You have 2 different tests there instead of one.
SamyOteroGlez
@SamyOteroGlez
Jun 26 2017 13:59
@bitwombat
Or you can rewrite it like this:
Given I am logged in
And I go to the "Add Event" screen
When I see different types of events to chose from.
And I save the new event
Then the training cycle shows as complete.
Paul Gibbs
@pgibbs_twitter
Jun 26 2017 14:29
Hi. I know how to hook something via AfterScenario; in the callback, I'm going to check if a specific tag is set on the scenario or feature, and then do something. What I would like to know if it's possible to dynamically add tags to a scenario/feature during runtime, please? i.e.e not explicitly written in the .feature file.
Bit Wombat
@bitwombat
Jun 26 2017 21:03
@SamyOteroGlez two good points/ideas. Many thanks.