2
rocktim
4y

How to write tests for a scraping script cause the website dom may change at anytime so using a website is not an option while writing tests .

Comments
  • 6
    How do I write tests for a set of dice when their number of sides can change at any time?
  • 0
    @Root The first thing I thought of is checking for the status code but I am not sure if that's the way while testing in these types of situations.
  • 5
    Mock your target datasource. Integration test their live site against your expectation. Bonus points for reusing those tests to configure alerts and file tickets.
  • 0
    @SortOfTested Lol I was about to mention you and here you are 🤗. I knew I was not gonna get a straight answer unless you show up 😅. Thanks, and I will mention you again if I get stuck lol
Add Comment