1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/ci/qunit-selenium-runner.rb
yuuji.yaginuma 8059c77404 Load chromedriver-helper.rb
The bin shim provides by `chromedriver-helper` gem has renamed to
`chromedriver-helper` since 2.0.
https://github.com/flavorjones/chromedriver-helper/pull/58

Since bin of new name is set to driver path in
`lib/chromedriver-helper.rb`, need to load it.
2018-09-16 09:40:17 +09:00

16 lines
642 B
Ruby

# frozen_string_literal: true
require "qunit/selenium/test_runner"
require "chromedriver-helper"
driver_options = Selenium::WebDriver::Chrome::Options.new
driver_options.add_argument("--headless")
driver_options.add_argument("--disable-gpu")
driver_options.add_argument("--no-sandbox")
driver = ::Selenium::WebDriver.for(:chrome, options: driver_options)
result = QUnit::Selenium::TestRunner.new(driver).open(ARGV[0], timeout: 60)
driver.quit
puts "Time: #{result.duration} seconds, Total: #{result.assertions[:total]}, Passed: #{result.assertions[:passed]}, Failed: #{result.assertions[:failed]}"
exit(result.tests[:failed] > 0 ? 1 : 0)