lundi 25 avril 2016

Testing HTML inside JSON - JAVA

I have a RESTful service that serves up HTML. Currently, my tests grab the HTML and does a simple .contains("") However, I have to work around HTML tags such as , etc because I am using the .contains on the HTML source, not the HTML rendering you would typically test against using a web driver.

Usually, one would use a web driver, such as Selenium, to validate HTML content. However, this is not a web service, it's a REST service that serves up HTML. It seems that Selenium wants to start off with a GET request, not a POST request. (There is no JavaScript on the webpages as these are email templates.)

What would be the best way to write tests to validate the HTML contents of a REST service in a Java project?

Aucun commentaire:

Enregistrer un commentaire