-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use GovukTest to provide headless chrome selenium options
This changes the configuration mechanism for Jasmine selenium runner to use the approach advised in the gem (as per: alphagov/content-publisher#2110) and also uses GovukTest as a means to share the headless chrome configuration.
- Loading branch information
Showing
3 changed files
with
9 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
browser: chrome | ||
configuration_class: HeadlessChromeJasmineConfigurer |