Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Adding support for JS/mechanize selection. This required the URLs to …
…be rewritten
- Loading branch information
jb@kulor.com
committed
Jun 11, 2012
1 parent
f9c5815
commit e8802e9
Showing
6 changed files
with
32 additions
and
31 deletions.
There are no files selected for viewing
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
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
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
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
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
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
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,10 +1,19 @@ | |||
require 'capybara/mechanize/cucumber' | require 'capybara/mechanize/cucumber' | ||
require 'capybara/cucumber' | require 'capybara/cucumber' | ||
require 'rspec/expectations' | require 'rspec/expectations' | ||
# require 'debugger' | |||
|
|
||
Capybara.run_server = false | Capybara.run_server = false | ||
Capybara.app_host = 'http://localhost:3000' | Capybara.app_host = 'http://localhost:3000' | ||
Capybara.default_selector = :css | Capybara.default_selector = :css | ||
|
|
||
Capybara.default_driver = :mechanize | Capybara.default_driver = :mechanize | ||
Capybara.default_driver = :selenium if ENV['DRIVER'] == 'js' | |||
|
|||
Before do |scenario| | |||
# As the Moo app will throw alert messages when switching pages | |||
# or exiting, this can interfere with the Cucumber session (the next scenario may fail) | |||
begin | |||
page.driver.browser.switch_to.alert.accept | |||
rescue | |||
end | |||
end |