aboutsummaryrefslogtreecommitdiffstats
path: root/ci/qunit-selenium-runner.rb
diff options
context:
space:
mode:
Diffstat (limited to 'ci/qunit-selenium-runner.rb')
-rw-r--r--ci/qunit-selenium-runner.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/ci/qunit-selenium-runner.rb b/ci/qunit-selenium-runner.rb
new file mode 100644
index 0000000000..132b3d17eb
--- /dev/null
+++ b/ci/qunit-selenium-runner.rb
@@ -0,0 +1,16 @@
+# 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)