diff options
author | Ola Bini <ola.bini@gmail.com> | 2014-07-31 19:35:40 -0300 |
---|---|---|
committer | Ola Bini <ola.bini@gmail.com> | 2014-07-31 19:35:40 -0300 |
commit | e54e5ee931b3991cbb5e427e7e5d27b3f6c75e6e (patch) | |
tree | 1e0da33d22874c0ea5576818fe45958611ebda29 /fake-service/features/support | |
parent | 04cf441c5ae18400c6b4865b0b37a71718dc9d46 (diff) |
Add fake-service
Diffstat (limited to 'fake-service/features/support')
-rw-r--r-- | fake-service/features/support/env.rb | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/fake-service/features/support/env.rb b/fake-service/features/support/env.rb new file mode 100644 index 00000000..932f259d --- /dev/null +++ b/fake-service/features/support/env.rb @@ -0,0 +1,31 @@ +require 'capybara' +require 'capybara-screenshot' +require 'capybara-screenshot/cucumber' + +RACK_PORT = ENV['RACK_PORT'] || '4567' +HOST = "http://localhost:#{RACK_PORT}" + +Capybara.register_driver :selenium_chrome do |app| + Capybara::Selenium::Driver.new(app, :browser => :chrome) +end + +Capybara::Screenshot.register_driver(:selenium_chrome) do |driver, path| + driver.browser.save_screenshot(path) +end + +driver = ENV['CUCUMBER_DRIVER'] ? ENV['CUCUMBER_DRIVER'].to_sym : :selenium_chrome + +Capybara.configure do |config| + config.run_server = false + config.default_driver = driver + config.app_host = HOST +end + +include Capybara::DSL + +Before do + `curl -d '' #{HOST}/control/mailset/mediumtagged/load` + sleep 3 + visit '/?lang=en' + page.driver.browser.manage.window.maximize +end |