Giter Site home page Giter Site logo

Comments (6)

benthorner avatar benthorner commented on July 23, 2024 8

To add to the above, here's how we're using headless Chrome with Jasmine.

# Gemfile
group :development, :test do
  gem "jasmine"
  gem "jasmine_selenium_runner", require: false
end

# spec/javascripts/support/jasmine_helper.rb
require "jasmine/runners/selenium"

Jasmine.configure do |config|
  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)
  }
end

The jasmine_selenium_runner gem doesn't support headless chrome out of the box.

from jasmine-gem.

rpbaltazar avatar rpbaltazar commented on July 23, 2024 4

Is chrome headless supported in the end, or not?

from jasmine-gem.

slackersoft avatar slackersoft commented on July 23, 2024 2

The original selenium functionality never really disappeared, just pulled out of this repo. Take a look at jasmine_selenium_runner for real browser support. This gives users who are fine with PhantomJS and don't want the Selenium overhead the option, while still allowing users who want a real browser that option.

Hope this helps. Thanks for using Jasmine!

from jasmine-gem.

slackersoft avatar slackersoft commented on July 23, 2024 1

Chrome headless is supported via the jasmine selenium runner gem. I don't think we have great docs for how to use the headless part of chrome with the selenium runner, but I would be happy to review a pull request there to update the readme with steps to configure the browser.

Hope this helps. Thanks for using Jasmine!

from jasmine-gem.

BrianHawley avatar BrianHawley commented on July 23, 2024

But be sure to keep PhantomJS support as an option, in case people have to run tests on platforms where GTK3 isn't supported, so they can't run headless Chrome/Firefox. (Yes, I'm aware that having to run tests on a platform that old is its own problem, but it happens.)

from jasmine-gem.

jergarmar avatar jergarmar commented on July 23, 2024

Thanks so much for the headless chrome example. Super helpful!

from jasmine-gem.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.