Webmock: stubbing capybara-webkit

Created on 3 Feb 2017  路  4Comments  路  Source: bblimke/webmock

Hello,

i'm trying to intercept and stub https requests from capybara-webkit driver to external site pages, which are resided in internet. I see that currently by default webmock can't intercept them.

So my question is how to intercept calls from capybara-webkit surfing visits.

Most helpful comment

There is no way to do that with webmock

capybara-webkit runs webkit engine which is an independent headless browser.

WebMock operates on server side only.

You could perhaps load additional js code in test environment which uses https://github.com/node-nock/nock to stub js requests.

or use something like https://github.com/hashrocket/capybara-webmock but that doesn't work with capybara-webkit.

https://github.com/oesmith/puffing-billy seems to support webkit.

All 4 comments

I got exactly the same question

There is no way to do that with webmock

capybara-webkit runs webkit engine which is an independent headless browser.

WebMock operates on server side only.

You could perhaps load additional js code in test environment which uses https://github.com/node-nock/nock to stub js requests.

or use something like https://github.com/hashrocket/capybara-webmock but that doesn't work with capybara-webkit.

https://github.com/oesmith/puffing-billy seems to support webkit.

Hello @bblimke! Over at vcr we were asked a very similar question and I gave a suggestion for how to approach this, but yeah, we agree that this is not webmock's job. Good luck!

@krainboltgreene Thanks for letting me know!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

wgordon17 picture wgordon17  路  5Comments

leifg picture leifg  路  19Comments

vangberg picture vangberg  路  3Comments

lokenmakwana picture lokenmakwana  路  6Comments

Watson1978 picture Watson1978  路  4Comments