Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-04-28 15:09:44 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-04-28 15:09:44 +0300
commitc74b7b5e4345702a1d59c72d923c3580ef157a59 (patch)
tree0d6cc261341fa36babe44e497dc26153da611b7b /spec/support/capybara.rb
parent0f59ad0c29c8679957c716317c842f606177f223 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/support/capybara.rb')
-rw-r--r--spec/support/capybara.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/spec/support/capybara.rb b/spec/support/capybara.rb
index e80b69e4fd5..38f9ccf23f5 100644
--- a/spec/support/capybara.rb
+++ b/spec/support/capybara.rb
@@ -95,12 +95,23 @@ RSpec.configure do |config|
config.include CapybaraHelpers, type: :feature
config.before(:context, :js) do
+ # This prevents Selenium from creating thousands of connections while waiting for
+ # an element to appear
+ webmock_enable_with_http_connect_on_start!
+
next if $capybara_server_already_started
TestEnv.eager_load_driver_server
$capybara_server_already_started = true
end
+ config.after(:context, :js) do
+ # WebMock doesn't stub connections, so we need to restore the original behavior
+ # to prevent many specs from failing:
+ # https://github.com/bblimke/webmock/blob/master/README.md#connecting-on-nethttpstart
+ webmock_enable!
+ end
+
config.before(:example, :js) do
session = Capybara.current_session