diff --git a/Gemfile b/Gemfile index 0f15ad8c2..93e35584f 100644 --- a/Gemfile +++ b/Gemfile @@ -19,8 +19,9 @@ gem "uglifier" group :development, :test do gem "govuk_schemas" + gem "govuk_test" gem "jasmine" - gem "jasmine_selenium_runner", require: false + gem "jasmine_selenium_runner" gem "rubocop-govuk" gem "scss_lint-govuk", require: false end @@ -35,7 +36,6 @@ end group :test do gem "capybara" gem "faker" - gem "govuk_test" gem "minitest-reporters" gem "mocha" gem "webdrivers" diff --git a/Gemfile.lock b/Gemfile.lock index 0954d16ce..eab7567cd 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -124,7 +124,7 @@ GEM sprockets (< 4) govuk_schemas (4.1.1) json-schema (~> 2.8.0) - govuk_test (1.0.3) + govuk_test (2.0.0) brakeman (~> 4.6) capybara puma @@ -198,7 +198,7 @@ GEM coderay (~> 1.1) method_source (~> 1.0) public_suffix (4.0.6) - puma (4.3.6) + puma (5.0.2) nio4r (~> 2.0) rack (2.2.3) rack-test (1.1.0) @@ -246,7 +246,7 @@ GEM rb-fsevent (0.10.4) rb-inotify (0.10.1) ffi (~> 1.0) - regexp_parser (1.7.1) + regexp_parser (1.8.0) request_store (1.5.0) rack (>= 1.4) rest-client (2.1.0) diff --git a/spec/javascripts/support/jasmine_helper.rb b/spec/javascripts/support/jasmine_helper.rb index 6892c6f60..467694c89 100644 --- a/spec/javascripts/support/jasmine_helper.rb +++ b/spec/javascripts/support/jasmine_helper.rb @@ -1,14 +1,7 @@ -require "jasmine/runners/selenium" -require "webdrivers/chromedriver" +require "jasmine_selenium_runner/configure_jasmine" -Jasmine.configure do |config| - config.prevent_phantom_js_auto_install = true - - config.runner = lambda { |formatter, jasmine_server_url| - options = Selenium::WebDriver::Chrome::Options.new - options.headless! - - webdriver = Selenium::WebDriver.for(:chrome, options: options) - Jasmine::Runners::Selenium.new(formatter, jasmine_server_url, webdriver, 50) - } +class HeadlessChromeJasmineConfigurer < JasmineSeleniumRunner::ConfigureJasmine + def selenium_options + { options: GovukTest.headless_chrome_selenium_options } + end end diff --git a/spec/javascripts/support/jasmine_selenium_runner.yml b/spec/javascripts/support/jasmine_selenium_runner.yml new file mode 100644 index 000000000..b947652da --- /dev/null +++ b/spec/javascripts/support/jasmine_selenium_runner.yml @@ -0,0 +1,2 @@ +browser: chrome +configuration_class: HeadlessChromeJasmineConfigurer