My team is just starting with BDD, and we are learning to write scenarios in a GIVEN, WHEN, THEN format. This will position us to start to automate our tests (with selenium) at the start of sprint, so that we fail until the application code catches up to satisfy the test(s).
We are thinking that the automation of our scenario is rigid, and defines the expected case, but when we take on a story, that is going to introduce (for example) a field or button that doesn't yet exist, how should we manage the automation. Would we
- write the automation as far as we can go, and when a real locator id is known with certainty, update both the application code and test together?
- write the automation case defining an explicit id that we are then obligated to match when the application code is written.
This is sort of a chicken - egg proposition. Am I being too rigid on how specific the actual automation is, and should I be content that my GIVEN-WHEN-THEN statement is accurate enough?