Giter Site home page Giter Site logo

Interaction with ExVCR about hound HOT 5 CLOSED

hashnuke avatar hashnuke commented on June 18, 2024
Interaction with ExVCR

from hound.

Comments (5)

HashNuke avatar HashNuke commented on June 18, 2024

@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.

from hound.

danhper avatar danhper commented on June 18, 2024

@HashNuke After looking at the code, I think he is trying to mock the webdriver responses.

@zamith Why are you trying to do this? I am not sure it is really the way to go, could you describe your use case a little more precisely please.

from hound.

zamith avatar zamith commented on June 18, 2024

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?

from hound.

HashNuke avatar HashNuke commented on June 18, 2024

@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).

from hound.

zamith avatar zamith commented on June 18, 2024

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.

from hound.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.