These are chat archives for Behat/Behat
Hello, when describing a scenario with entities. Should you refer to those entities by their identifiers or just as the last inserted?
Title is just a variable for the folder and the theme.
Id is the real identifier of those entities.
What’s the best way to write a scenario
Example 1 (refering to last inserted):
Scenario: Add a theme to an empty folder Given I am a teacher And I have a folder with title "December" And I have a theme with title "Kerstmis" and themeImage "Bluebox" When I add my theme to my folder Then my folder should contain my theme And my theme should have an position of "1" within this folder
Example 2 (refering to Ids):
Scenario: Add a theme to an empty folder Given I am a teacher And I have a folder with id “1” and title "December" And I have a theme with id “11” and title "Kerstmis" and themeImage "Bluebox" When I add theme “11” to folder “1" Then folder “1" should contain theme “11" And theme “11” should have an position of "1" within folder “1"
so If you look at the example of modelling by example blog (http://stakeholderwhisperer.com/posts/2014/10/introducing-modelling-by-example)
Scenario: Getting the delivery cost for a single product under £10 Given a product named "White Marker" and priced £5 was added to the catalogue When I add the "White Marker" product from the catalogue to the picked up basket Then the overall basket price should be £9
The product Identifier in this case would be the name?
but further in the blogpost he does this.
With this code he will search for a product in the catalogue with $name. If it is not an identifier how can he be certain that not two products are added to the basket?