2017-10-28 08:14:06 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
require "qunit/selenium/test_runner"
|
2017-10-19 12:01:52 -04:00
|
|
|
|
2019-02-05 09:50:06 -05:00
|
|
|
if ARGV[1]
|
|
|
|
driver = ::Selenium::WebDriver.for(:remote, url: ARGV[1], desired_capabilities: :chrome)
|
|
|
|
else
|
|
|
|
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)
|
|
|
|
end
|
2017-10-19 12:01:52 -04:00
|
|
|
|
|
|
|
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)
|