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
Probable incompatibility with Selenium? #1001
Comments
@bobmaerten thank you for reporting. Can you please provide some more details? Does it raise any error and stacktrace? Are you able to provide an example that fails? |
I was a little bit reluctant to create this issue, as we have very little context to provide. Our tests all fail with an error from Capybara returning def test_perform_visit
visit some_path
assert has_selector?(%(a.btn-primary[id="default-action"]))
assert has_selector?(%(a.btn-secondary[id="other-action"]))
find(%([id="other-action"]), match: :first).click
assert has_selector?(%(a.btn-primary[id="other-action"])) # Fails here after click involving a controller request
assert has_selector?(%(a.btn-secondary[id="default-action"]))
end
|
I found that my system tests do not run, and instead give me this error: WebMock::NetConnectNotAllowedError: Real HTTP connections are disabled. Unregistered request: POST http://127.0.0.1:9515/session with body '{"capabilities":{"alwaysMatch":{"browserName":"chrome","goog:chromeOptions":{}}}}' with headers {'Accept'=>'application/json', 'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Content-Length'=>'81', 'Content-Type'=>'application/json; charset=UTF-8', 'User-Agent'=>'selenium/4.9.1 (ruby macosx)'}
You can stub this request with the following snippet:
stub_request(:post, "http://127.0.0.1:9515/session").
with(
body: "{\"capabilities\":{\"alwaysMatch\":{\"browserName\":\"chrome\",\"goog:chromeOptions\":{}}}}",
headers: {
'Accept'=>'application/json',
'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3',
'Content-Length'=>'81',
'Content-Type'=>'application/json; charset=UTF-8',
'User-Agent'=>'selenium/4.9.1 (ruby macosx)'
}).
to_return(status: 200, body: "", headers: {}) Removing edit: Adding |
I checked our test-suite against the latest version and it seems to work fine now. Can't tell what changed either on the gem side or from our tests ¯_(ツ)_/¯. |
There were no WebMock version changes, therefore I expect that the issue was related to webmock in combination with something that has changed. Anyway, in case it happens again, please open the issue again. |
Our test suite does not pass anymore since the release of the 3.16 version.
I found the culprit would be #976
Our stack consist of :
Non-system tests pass as usual. On another app using the exact same stack but without system tests either (no Selenium/Capybara) we do not encounter problem either.
We have tried many different approaches to try to make tests pass:
The text was updated successfully, but these errors were encountered: