summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Eastwood <contact@ericeastwood.com>2018-03-09 18:30:02 -0600
committerEric Eastwood <contact@ericeastwood.com>2018-06-08 00:18:43 -0500
commit3bef0c018265f5a247a44b60ae885f5e1502ffaf (patch)
treed683513f8d6704a9678a658baccc775e4577fdec
parent5652b3aad99e73d5ea33f5f310d6bee85654634c (diff)
downloadgitlab-ce-3bef0c018265f5a247a44b60ae885f5e1502ffaf.tar.gz
Add ability to run rspec tests through external Selenium server
``` SELENIUM_REMOTE_URL=http://localhost:4545/wd/hub bundle exec spring rspec spec/features/issues/notes_on_issues_spec.rb ```
-rw-r--r--spec/support/capybara.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/spec/support/capybara.rb b/spec/support/capybara.rb
index c0ceb0f6605..36f7c4dcf33 100644
--- a/spec/support/capybara.rb
+++ b/spec/support/capybara.rb
@@ -40,11 +40,14 @@ Capybara.register_driver :chrome do |app|
# Disable /dev/shm use in CI. See https://gitlab.com/gitlab-org/gitlab-ee/issues/4252
options.add_argument("disable-dev-shm-usage") if ENV['CI'] || ENV['CI_SERVER']
+ args = {}.merge(ENV['SELENIUM_REMOTE_URL'] ? { url: ENV['SELENIUM_REMOTE_URL'] } : {})
+
Capybara::Selenium::Driver.new(
app,
browser: :chrome,
desired_capabilities: capabilities,
- options: options
+ options: options,
+ **args
)
end