I'm trying to run cucumber using VCR gem, chrome driver, and webmock but it's not working. One problem is that none of the requests are getting recorded. I do have VCR set to ignore_localhost
which I believe is needed due to javascript as explained in this SO answer.
But why doesn't my step request to visit a url (say www.test.com
) get recorded? I see the chrome browser loading up and the address in the URL so I know the cucumber step is going there.
If i turn off ignore_localhost
then I see some recordings but the uri's are all 127.0.0.1
. The uri I'd expect is showing up in body: string
instead of the uri
. Why is this happening?
request:
method: post
uri: http://127.0.0.1:9592/session/87bb12aa8b5b1230399b98bcc7d0ba11/url
body:
encoding: US-ASCII
string: ! '{"url":"http://www.test.com"}'
headers:
Accept:
- application/json
Content-Type:
- application/json; charset=utf-8
Content-Length:
- '46'
User-Agent:
- Ruby
Incase it helps, here's my VCR config
VCR.configure do |c|
c.cassette_library_dir = 'features/support/vcr_cassettes'
c.hook_into :webmock
c.ignore_localhost = true
end