cucumber - Should all fields that are visible on a screen be validated in Gherkin? -
we creating gherkin feature files our application create executable specifications. have files this:
given product <type> found when product clicked detailed information on product appears , field text has value , field price has value , field buy available
we wondering if whole list of and
keywords validate if fields visible on screen way go, or if should shorten 'validate input'.
we have similar case in our service can return lot of 10's of elements each case validate. not validate every element each interaction, test elements relevant test case.
to make easier maintain , switch elements using, use scenario outlines , tables of examples.
scenario outline: po boxes correctly located when search in usa "<input>" address contains | label | text | | po box | <pobox> | | city name | <cityname> | | state code | <statecode> | | zip code | <zipcode> | | +4 code | <zipplus4> | examples: | id | input | pobox | cityname | statecode | zipcode | | 01 | po box 123, 12345 | po box 123 | boston | ma | 12345 | | 02 | po box 321, whitefish | po box 123 | whitefish | mn | 54321 |
by doing way, have generic step "the address contains" uses 'label' , 'text' test individual elements. neat , tidy way test lot of potential combinations - depends on individual use case - how important of fields are.