diff options
author | Guillermo Iguaran <guilleiguaran@gmail.com> | 2017-10-19 11:01:52 -0500 |
---|---|---|
committer | Guillermo Iguaran <guilleiguaran@gmail.com> | 2017-10-19 11:01:52 -0500 |
commit | 4dcf12a340f82fb01453ef3b7aca6df756bdaa65 (patch) | |
tree | 5bae45481d1598e8b8704cf319808b7e0f295237 /ci/qunit-selenium-runner.rb | |
parent | b7bf70982395ee5fd2e89064f87f268eeddb9d6d (diff) | |
download | rails-4dcf12a340f82fb01453ef3b7aca6df756bdaa65.tar.gz rails-4dcf12a340f82fb01453ef3b7aca6df756bdaa65.tar.bz2 rails-4dcf12a340f82fb01453ef3b7aca6df756bdaa65.zip |
PhantomJS is abandoned, replace it with Selenium/Chrome headless
Diffstat (limited to 'ci/qunit-selenium-runner.rb')
-rw-r--r-- | ci/qunit-selenium-runner.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/ci/qunit-selenium-runner.rb b/ci/qunit-selenium-runner.rb new file mode 100644 index 0000000000..1d18d666b0 --- /dev/null +++ b/ci/qunit-selenium-runner.rb @@ -0,0 +1,13 @@ +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 = ::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.tests[:total]}, Passed: #{result.tests[:passed]}, Failed: #{result.tests[:failed]}" +exit(result.tests[:failed] > 0 ? 1 : 0) |