From e54e5ee931b3991cbb5e427e7e5d27b3f6c75e6e Mon Sep 17 00:00:00 2001 From: Ola Bini Date: Thu, 31 Jul 2014 19:35:40 -0300 Subject: Add fake-service --- fake-service/features/support/env.rb | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 fake-service/features/support/env.rb (limited to 'fake-service/features/support/env.rb') 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 -- cgit v1.2.3