Marek Siemieniuk-Morawski
2018-08-03 21:09:10 UTC
Hey,
I'm facing with the problem of designing acceptance tests for the
application being some kind of long form web app (let's say it's a survey
app). It's not technically hard to write the scenario that pass through the
flow from the very first page to the last one. The challenge is how to do
it smart, according to best practices. As far as I understand how good
Cucumber's scenario should look, the scenario must:
- be able to run independently of other scenarios,
- contain *only one *When keyword,
- contain *at most* 5 steps,
- steps should be reusable as much as possible.
So, after many hours of reading, trying, and thinking, I created a scenario
as below.
Scenario: Successfully pass through the flow of the application
Given I got access to the very first page of the Application
When I choose the 2nd option on First page
Then I should be navigated to /second-page page
When I provide my personal data in Second page:
| input | value |
| some_data | some_value |
| some_data2 | some_value2 |
| some_data_consent | true |
Then I should be navigated to /third-page page
When I provide my personal data in Third page:
| input | value |
| some_data | some_value |
| some_data2 | some_value2 |
Then I should be navigated to /other-page page
When I provide my personal data in Other page:
...
Then I should be navigated to /last-page page
It works, but I accomplished only one of the "best practices" - steps are
very reusable. That's why I'm writing the post, to ask you what do you
think about the scenario, the assumption that I follow, and how would you
do in my place? I believe there are many places for improvements.
I'm facing with the problem of designing acceptance tests for the
application being some kind of long form web app (let's say it's a survey
app). It's not technically hard to write the scenario that pass through the
flow from the very first page to the last one. The challenge is how to do
it smart, according to best practices. As far as I understand how good
Cucumber's scenario should look, the scenario must:
- be able to run independently of other scenarios,
- contain *only one *When keyword,
- contain *at most* 5 steps,
- steps should be reusable as much as possible.
So, after many hours of reading, trying, and thinking, I created a scenario
as below.
Scenario: Successfully pass through the flow of the application
Given I got access to the very first page of the Application
When I choose the 2nd option on First page
Then I should be navigated to /second-page page
When I provide my personal data in Second page:
| input | value |
| some_data | some_value |
| some_data2 | some_value2 |
| some_data_consent | true |
Then I should be navigated to /third-page page
When I provide my personal data in Third page:
| input | value |
| some_data | some_value |
| some_data2 | some_value2 |
Then I should be navigated to /other-page page
When I provide my personal data in Other page:
...
Then I should be navigated to /last-page page
It works, but I accomplished only one of the "best practices" - steps are
very reusable. That's why I'm writing the post, to ask you what do you
think about the scenario, the assumption that I follow, and how would you
do in my place? I believe there are many places for improvements.
--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cukes+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cukes+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.