2017-10-28 08:14:06 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
require "qunit/selenium/test_runner"
|
|
|
|
require "chromedriver/helper"
|
2017-10-19 12:01:52 -04:00
|
|
|
|
|
|
|
driver_options = Selenium::WebDriver::Chrome::Options.new
|
2017-10-28 08:14:06 -04:00
|
|
|
driver_options.add_argument("--headless")
|
|
|
|
driver_options.add_argument("--disable-gpu")
|
2018-01-18 11:28:12 -05:00
|
|
|
driver_options.add_argument("--no-sandbox")
|
2017-10-19 12:01:52 -04:00
|
|
|
|
|
|
|
driver = ::Selenium::WebDriver.for(:chrome, options: driver_options)
|
|
|
|
result = QUnit::Selenium::TestRunner.new(driver).open(ARGV[0], timeout: 60)
|
|
|
|
driver.quit
|
|
|
|
|
2017-10-19 12:11:20 -04:00
|
|
|
puts "Time: #{result.duration} seconds, Total: #{result.assertions[:total]}, Passed: #{result.assertions[:passed]}, Failed: #{result.assertions[:failed]}"
|
2017-10-19 12:01:52 -04:00
|
|
|
exit(result.tests[:failed] > 0 ? 1 : 0)
|