-
Notifications
You must be signed in to change notification settings - Fork 145
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
Interaction with ExVCR #100
Comments
@zamith exvcr is for http requests made by your http client. When you use Hound, the http requests are made by the browser being used to test. Unless required, I would suggest that you write tests at a much lower level (parsing the html obtained etc). Closing this issue. |
I was thinking of writing integration level tests for this, since a call to one of the tasks can visit a few different pages. Basically I wanted to mock the responses but not have to do it by hand, have them be automatically generated. I guess I can grab the HTML from the page and create a custom cassette for that. Is that what you're suggesting? |
@tuvistavie Thanks for pointing out. Just looked at @zamith's code. @zamith I would suggest not trying to use exvcr on the webdriver responses. If you change the webdriver server (let's say from selenium to using chrome_driver directly), your cassettes will break :) Yes, having the html of a page and writing tests for the parser is better. Or if it is definitely required, then just scrape the page for real during the test (assuming the site is a really popular site, I don't think they'll mind if you scrape a few pages a month when running tests). |
I was trying to do that because each task can interact with multiple pages, and I couldn't think of a better way to do integration tests. I guess that writing unit tests for parts of the parser is better than nothing. Thanks. |
I'm building a web scraper using Hound, and it works fine, but when trying to test it using exvcr to mock the responses the responses are pretty much empty (at least no interesting data). I'm not sure if this is an exvcr or hound issue, or even if it is an issue with the way I have them set up, but hopefully you can help me.
I have opened the same issue on the exvcr repo, with the relevant code.
The text was updated successfully, but these errors were encountered: