jasmine / jasmine-gem

Jasmine ruby gem
681 stars 275 forks source link

Chrome headless backend not documented #308

Closed himdel closed 5 years ago

himdel commented 5 years ago

https://github.com/jasmine/jasmine-gem/pull/301 introduced chrome headless as a backend.

But, the README is oblivious to that change, and it's ...non trivial to figure out ;).


From what I can tell, the steps are:

in your gemspec...

  s.add_development_dependency "chrome_remote",  "~> 0.2.0"

in spec/javascript/support/jasmine_helper.rb...

  config.runner = lambda do |formatter, jasmine_server_url|
    Jasmine::Runners::ChromeHeadless.new(formatter,
                                         jasmine_server_url,
                                         config)
  end

  config.chrome_binary = 'google-chrome-beta'
  config.chrome_cli_options = {
    'headless' => nil,
    'disable-gpu' => nil,
    'remote-debugging-port' => 9222,
  }
  config.chrome_startup_timeout = 20

  # TODO this should probably allow just that one url
  require 'webmock'
  WebMock.allow_net_connect!

in .travis.yml...

addons:
  chrome: 'beta'