From 287920ca7d06c8f51198ec750d65ba703835b257 Mon Sep 17 00:00:00 2001 From: Matthew Draper Date: Wed, 6 Feb 2019 01:20:06 +1030 Subject: Respect ENV variables when finding DBs etc for the test suite If they're not set we'll still fall back to localhost, but this makes it possible to run the tests against a remote Postgres / Redis / whatever. --- ci/qunit-selenium-runner.rb | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'ci') diff --git a/ci/qunit-selenium-runner.rb b/ci/qunit-selenium-runner.rb index 132b3d17eb..1df6aedb36 100644 --- a/ci/qunit-selenium-runner.rb +++ b/ci/qunit-selenium-runner.rb @@ -1,14 +1,20 @@ # 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") +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 -driver = ::Selenium::WebDriver.for(:chrome, options: driver_options) result = QUnit::Selenium::TestRunner.new(driver).open(ARGV[0], timeout: 60) driver.quit -- cgit v1.2.3