Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unit testing screen scraper

I'm in the process of writing an HTML screen scraper. What would be the best way to create unit tests for this?

Is it "ok" to have a static html file and read it from disk on every test?

Do you have any suggestions?

like image 907
alexn Avatar asked Aug 10 '09 17:08

alexn


1 Answers

To guarantee that the test can be run over and over again, you should have a static page to test against. (Ie. from disk is OK)

If you write a test that touches the live page on the web, thats probably not a unit test, but an integration test. You could have those too.

like image 94
Arjan Einbu Avatar answered Sep 28 '22 02:09

Arjan Einbu