BigW Consortium Gitlab

Commit 6984c2ee by Grzegorz Bizon

Use headless chrome instead of webkit via QtWebkit

parent ec2130be
......@@ -2,6 +2,6 @@ source 'https://rubygems.org'
gem 'capybara', '~> 2.12.1'
gem 'capybara-screenshot', '~> 1.0.14'
gem 'capybara-webkit', '~> 1.12.0'
gem 'rake', '~> 12.0.0'
gem 'rspec', '~> 3.5'
gem 'selenium-webdriver', '~> 2.53'
......@@ -16,7 +16,10 @@ GEM
capybara-webkit (1.12.0)
capybara (>= 2.3.0, < 2.13.0)
json
childprocess (0.7.0)
ffi (~> 1.0, >= 1.0.11)
diff-lcs (1.3)
ffi (1.9.18)
json (2.0.3)
launchy (2.4.3)
addressable (~> 2.3)
......@@ -44,6 +47,12 @@ GEM
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.5.0)
rspec-support (3.5.0)
rubyzip (1.2.1)
selenium-webdriver (2.53.4)
childprocess (~> 0.5)
rubyzip (~> 1.0)
websocket (~> 1.0)
websocket (1.2.4)
xpath (2.0.0)
nokogiri (~> 1.3)
......@@ -56,6 +65,7 @@ DEPENDENCIES
capybara-webkit (~> 1.12.0)
rake (~> 12.0.0)
rspec (~> 3.5)
selenium-webdriver (~> 2.53)
BUNDLED WITH
1.14.6
require 'rspec/core'
require 'capybara/rspec'
require 'capybara-webkit'
require 'capybara-screenshot/rspec'
require 'selenium-webdriver'
# rubocop:disable Metrics/MethodLength
# rubocop:disable Metrics/LineLength
......@@ -20,7 +20,6 @@ module QA
configure_rspec!
configure_capybara!
configure_webkit!
end
def configure_rspec!
......@@ -43,9 +42,9 @@ module QA
config.order = :random
Kernel.srand config.seed
config.before(:all) do
page.current_window.resize_to(1200, 1800)
end
# config.before(:all) do
# page.current_window.resize_to(1200, 1800)
# end
config.formatter = :documentation
config.color = true
......@@ -53,26 +52,28 @@ module QA
end
def configure_capybara!
Capybara.register_driver :chrome do |app|
capabilities = Selenium::WebDriver::Remote::Capabilities.chrome(
'chromeOptions' => {
'binary' => '/opt/google/chrome-beta/google-chrome-beta',
'args' => %w[headless disable-gpu]
}
)
Capybara::Selenium::Driver
.new(app, browser: :chrome, desired_capabilities: capabilities)
end
Capybara.configure do |config|
config.app_host = @address
config.default_driver = :webkit
config.javascript_driver = :webkit
config.default_driver = :chrome
config.javascript_driver = :chrome
config.default_max_wait_time = 4
# https://github.com/mattheworiordan/capybara-screenshot/issues/164
config.save_path = 'tmp'
end
end
def configure_webkit!
Capybara::Webkit.configure do |config|
config.allow_url(@address)
config.block_unknown_urls
end
rescue RuntimeError # rubocop:disable Lint/HandleExceptions
# TODO, Webkit is already configured, this make this
# configuration step idempotent, should be improved.
end
end
end
end
......@@ -12,7 +12,6 @@ RSpec.configure do |config|
config.shared_context_metadata_behavior = :apply_to_host_groups
config.disable_monkey_patching!
config.expose_dsl_globally = true
config.warnings = true
config.profile_examples = 10
config.order = :random
Kernel.srand config.seed
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment