Good day,
I have been thinking about the substance of describing features (Gherkin syntax) and cannot find the best answer.
Two examples of the same scenario:
Scenario: Creation of a new task
Given I see the button for the creation of a new task
When I click the button in order to create a new task
Then I see the task editor
Scenario: Creation of a new task
Given I see the button "Create task"
When I click the button "Create task"
Then I see page "Task editor" has been opened
I see the main differences:
-
The first variant is interface-independent. But, you MUST use a selector or similar to find the exact element, but then you can change everything in the interface, and these tests will not fail (as the second variant).
-
The first variant is NOT declarative. In general, you cannot reuse it for describing any OTHER interface behavior.
-
For my taste, the second variant much more simple for understanding what is going on in the scenario.
I think, the second variant is much more flexible and allow you to write scenarios MUCH faster, but in the same time has problems:
-
You MUST include interface date in the scenarios. It is not a good practice.
-
Any time when you change an interface, you need to fix your tests.
-
You may describe anything to test (as visible data, for example), so such tests are much more accurate, and provide higher quality.
So, can you tell, what do you think about it?
I think that flexibility, speed, quality, and readability (the second variant) are much better than the first variant (which have nothing, except readability and "stability"?), but I am not sure. Yes, you put some data in scenarios, but you almost NEVER change them, and even if you will change it, it may be fixed in seconds/minutes.
What do you use in your projects, and why?
And, the main question is, which variant is better?
Tell your thoughts, please.
Aucun commentaire:
Enregistrer un commentaire