-
Notifications
You must be signed in to change notification settings - Fork 557
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Webmock stopping selenium from deleting session in specs #1014
Comments
@james-ai did you find a solution to this? |
@madleech unfortunately not, and I haven't been given time to look into it in a while. Are you experiencing the same issue? |
@madleech what is the method and host that WebMock is blocking for you? What parameters have you passed to |
@james-ai I am. I worked around it by adding: # Add hook to allow capybara to cleaning terminate selenium session
RSpec.configure do |config|
config.after(:suite) do
WebMock.allow_net_connect!
end
end
@bblimke The error I'm getting is:
I'm using this in my WebMock.disable_net_connect!(allow_localhost: true, allow: ['datadog-agent']) On a suspicion I searched the codebase for other Sigh! So @james-ai maybe check to see if there are any hidden |
Apologies if this is the wrong place to post this. Having an issue where it seems that webmock is stopping the capybara selenium driver from deleting the session. Details below.
System
Summary
Whilst successfully running a suite of tests on GitLab CI[1], WebMock intercepts a request from Capybara's Selenium driver to delete a session[2].
Although the error appears after the tests have run I wonder if it occurs whilst the specs are running? This is due to seeing newlines appearing in the RSpec output on GitLab, but not when run locally:
In spec/support/capybara.rb I have allowed connections to any URL with selenium, or session in it:
I have previously confirmed in the
before(:suite)
block that a session URL, such as http://selenium__standalone-chrome:4444/wd/hub/session/0146cfc5158d585f445cfcdbda289733, would be allowed by WebMock.Per the suggestion in [2] I stubbed the request - though I don't believe this is desired behaviour - but that still caused the same error.
Observed behaviour
WebMock does not allow the Selenium delete the session and complete the browser exit.
Desired behaviour
The session is deleted, the browser is closed, and no errors are raised.
[1] In .gitlab-ci.yml I have a docker service to enable the use of Selenium:
The URL for that service is exposed to my specs via an environment variable:
- export SELENIUM_REMOTE_URL="http://selenium__standalone-chrome:4444/wd/hub"
[2] Here is the full output from the WebMock error:
The text was updated successfully, but these errors were encountered: