These are chat archives for Behat/Behat

8th
Mar 2017
Bart Wegrzyn
@bwegrzyn
Mar 08 2017 18:23
I have a question about testing a CRUD API. I have a scenario each for create, edit/update, and delete. However, the IDs in my API are auto generated UUIDs instead f numerical IDs. How am I able to take the UUID from the create scenario response and use it in the edit/update/delete scenarios? According to the documentation, contexts are not shared between scenarios so it seems like sharing the UUID is impossible. Any ideas?
Chuk Shirley
@chukShirley
Mar 08 2017 18:35
Could "Create," "Read," "Update," and "Delete" not use the same scenario?
@bwegrzyn ^
Bart Wegrzyn
@bwegrzyn
Mar 08 2017 18:37
@chukShirley I haven't tried doing it in one scenario. The scenario would be quite long if its possible to do it this way.
Chuk Shirley
@chukShirley
Mar 08 2017 18:39
Or just one feature
multiple scenarios, but it uses the same context class
Ciaran McNulty
@ciaranmcnulty
Mar 08 2017 18:40
Why would the scenario be large?
Given I created a Foo / When I delete the Foo / Then it should be deleted
Bart Wegrzyn
@bwegrzyn
Mar 08 2017 18:47
I'll try it like that and see where it gets me.
So a context class is shared among scenarios in a feature? Or each scenario gets its own instance?