Created
April 26, 2011 18:11
-
-
Save roykolak/942774 to your computer and use it in GitHub Desktop.
Just a simple method to switch capybara to a different driver and then change back to the default
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
feature 'viewing the webpage' do | |
switch_driver :webkit | |
scenario 'viewing from a webkit browser' do | |
... | |
end | |
end | |
# In support folder | |
def switch_driver(driver_name) | |
before(:each) do | |
Capybara.current_driver = driver_name | |
end | |
after(:each) do | |
Capybara.use_default_driver | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Interesting. Not sure if I will need to do this, as I don't use cucumber. I use bacon for testing and I think it may work using that. If not normally then I will try putting the it 'should blah blah blah....' do in the switch_driver block and see if that works. If not, it is good to know that there is this example that I can come back to which works.
Thanks