diff options
author | Folker Bernitt <fbernitt@thoughtworks.com> | 2014-08-20 17:21:20 +0200 |
---|---|---|
committer | Folker Bernitt <fbernitt@thoughtworks.com> | 2014-08-20 17:45:12 +0200 |
commit | ae6f773d4abc42dcc0eaa1c70f8af14b091f8d47 (patch) | |
tree | 15e5df69a6d1b774042dfd29372115a1baf4136f /py-fake-service/features/support | |
parent | a3ea808b6290a7c756b28099df9fa8574c94055e (diff) |
Translated cucumber tests to behave.
Diffstat (limited to 'py-fake-service/features/support')
-rw-r--r-- | py-fake-service/features/support/env.rb | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/py-fake-service/features/support/env.rb b/py-fake-service/features/support/env.rb new file mode 100644 index 00000000..2386da9b --- /dev/null +++ b/py-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 => :firefox) +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 |