I have introduced ajaxy table sorting to my application, and I want to set up cucumber tests to test the functionality when javascript is supported and when javascript is not supported.
I am using capybara, so if I use the flag @javascript, it will run the test with a javascript driver. Is their a flag that will run the scenario twice once with javascript and once without?
Something like the following …
@test-both-javascript-and-non-javascript
Scenario: Table Search
When I fill in "search" with "Jonathan"
And I press "Search"
Then I should see the following users:
| Jonathan | Smith | jonathan@example.com | active |
Is the behaviour really the same, regardless of whether JavaScript is enabled or disabled? If so, why are you using JavaScript at all? 😉
I suspect that in reality the behaviour is slightly different whether JavaScript is enabled or disabled. Therefore you should have two scenarios describing the behaviour for each case, e.g. does the JavaScript version suggest results as you type?