In my Rails application, I have a set of cucumber acceptance tests that test various pages of my application. With cucumber, tagging a specific test (scenario) with @javascript causes that scenario to run using a JavaScript driver instead of a simpler driver that does not support JavaScript.
Is there an easy way for my tests to determine whether they are currently being run with a driver that supports JavaScript or one that doesn’t? I want this so that I can make my tests behave slightly differently if they are being run with JavaScript enabled.
In case anyone’s interested, I took a look at the documentation for Capybara and found another possible solution: