I was wondering if there is any way to run cucumber scenario with and without javascript without duplicating code.
I develop website that utilizes html5 navigation. However it should work find if browser doesn't support html5 features.
I would like to write cucumber test that would test navigation. I know I can test basic html navigation with simple cucumber scenario. And I can test html5 navigation with same scenario but with @javascript tag.
I would really love to avoid this code duplication. I was experimenting with around hooks, hoping that I could simple call block, then call same block with
Capybara.using_driver(Capybara.javascript_driver) { block.call }
However this doesn't work.
Anyone have any idea how to implement this?
P.S. I'm quite new to Ruby, and just started working with cucumber.