I have two doubts about BDD with Cucumber related to best practices.
I have a page to automate user registration.
You enter your personal data, such as: name, email, and confirmation After that you select the options of your interest of the site (there are 10 comboboxes, can be as many as you want). Insert a recaptcha and send.
I need to validate all cases of success, as well as failure.
So, here are my questions:
1) Page with recaptcha. Since it is not possible to automate a recaptcha and this step naturally comes into my test, should I make a scenario for invalid recaptcha validation?
2) Is there any clever way for me to write a scenario exploring all the possible combinations of site interest options?
In my page: ( ) Economy ( ) Education ( ) Sports ( ) Recreation ( ) Travels ( ) ...
I want to be able to submit the test several times by testing 1 option selected, 2 options, 3 options, ..., all options. But I just want to do it if there is a lean way to do it.
In other words: In Scenario Outline examples can I pass a null value in this case?
In line with what Thomas mentioned on Captcha I would say that this is one of the few things which cannot be automated to test (except the negative path).
I also agree with Thomas that you should not want to test every single possibility of the options using executable specifications, but rather use integration testing or possible even unit testing if the architecture of this part of the code allows that.
As for an actual executable scenario in Gherkin format I see something like the following for this functionality:
Given Paul supplied the incorrect Captcha
When he wants to register himself
Then he should not be registered
There could be a potential other scenario depending on whether or not someone is allowed to register when no options are selected:
Given Paul has not chosen any of the possible interest topics
When he wants to register himself
Then he should not be registered