Skip to content
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

Dealing with Webmock #4

Closed
mltsy opened this issue Oct 5, 2017 · 4 comments

Comments

Projects
None yet
4 participants
@mltsy
Copy link

commented Oct 5, 2017

I'm using webmock in my tests and I can't figure out a good way to deal with it blocking webdrivers' requests. I've tried not requiring webmock in the gem file, and explicitly requiring it after webdrivers in test_helper.rb and it still blocks the request... do you have a good method for avoiding this problem?

Where do you normally require 'webdrivers' ? Do you use webmock? Is there a command I can call to make it download the drivers immediately so it doesn't get caught after webmock is initialized?

@titusfortner

This comment has been minimized.

Copy link
Owner

commented Nov 20, 2017

I do not use webmock, but it should let you stub only the internet calls you want?

I think it black lists by default, but you can whitelist: https://github.com/mozilla/geckodriver/releases, http://chromedriver.storage.googleapis.com

I require it in spec_helper.rb

@mltsy

This comment has been minimized.

Copy link
Author

commented Nov 20, 2017

Well that sounds simple enough :) Pokes a couple holes in the webmock wall, but I guess as long as you're not testing anything to do with webdrivers, it shouldn't be a problem!

I ended up just adding the webdrivers I needed to the image I was using rather than installing them as part of the test run. But this solution certainly seems like it should work 👍

@mltsy mltsy closed this Nov 20, 2017

@Crisfole

This comment has been minimized.

Copy link

commented Oct 24, 2018

For future viewers of this:

WebMock.disable_net_connect!({
  allow_localhost: true,
  allow: 'chromedriver.storage.googleapis.com'
})

@jrochkind jrochkind referenced this issue Mar 27, 2019

Closed

Cache Binaries #29

@jrochkind

This comment has been minimized.

Copy link

commented Mar 27, 2019

I ran into this switching from chromedriver-helper to webdrivers.

It is a gotcha. If the URLs that webdrivers tries to contact change in the future, of course the Webmock setup would have to be changed too.

This is related to #29

The allow: 'chromedriver.storage.googleapis.com' worked. Of course if webdrivers ever changes what urls it has to contact, or contacts different URLs in different configurations (if I switch to FF instead of Chrome say?), it would have to be adjusted.

edwardkerry added a commit to alphagov/govuk_test that referenced this issue Apr 24, 2019

Update Changelog and Readme
`webdrivers` causes an issue with `webmock`. This is therefore a breaking change, and
the Readme now has instructions on how to address this.

titusfortner/webdrivers#4

edwardkerry added a commit to alphagov/govuk_test that referenced this issue Apr 24, 2019

Update Readme
`webdrivers` causes an issue with `webmock`. This is therefore a breaking change, and
the Readme now has instructions on how to address this.

titusfortner/webdrivers#4

edwardkerry added a commit to alphagov/govuk_test that referenced this issue Apr 24, 2019

Update Readme
`webdrivers` causes an issue with `webmock`. This is therefore a breaking change, and
the Readme now has instructions on how to address this.

titusfortner/webdrivers#4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.