I need to write a class to enforce rules on items that may or may not be added to the same container in the warehouse, and I would like to translate the requirements into Cucumber before implementing it.
Each element has several attributes, for example, “Element family” (for example, electronics, book), “Element status” (for example, main stock, faulty stock) and “Package” (for example, 1050, 1051).
I can come up with several strategies for writing a Cucumber test for this, and I would like to know which one is recommended:
First, you can list all the attributes for each product:
Given I have a tote containing:
| sku | client | family | status | batch | weight |
| 100000 | Foo | garment | main | 1234 | 10 |
When I add the item:
| sku | client | family | status | batch | weight |
| 200000 | Bar | garment | main | 1234 | 10 |
Then I should be told there is a Client conflict
Secondly, you can have a basic product with hard coding and try to specify the minimum attributes from it:
Given I have a tote containing an item that client "Foo"
When I add an item that client "Bar"
Then I should be told there is a Client conflict
, , .
, :
Given I have a tote containing an item
And I add an item with a different client
Then I should be told there a client conflict
- ?