I use simple uptime monitors like statuscake, uptimerobot, etc. to verify that my sites are up. The problem is that some of the sites are ASP.NET applications with complex __doPostback
interactions -- basically, the user fills out a form, clicks submit, and then ASP.NET-generated javascript takes them to the next page.
My idea was to write a CasperJS (basically an easier API for PhantomJS) script to simulate this user interaction and test to make sure it works.
I have the test running in CasperJS and now I'd like to expose the test as its own REST API so I can have my uptime monitor hit it every few minutes. The REST API would return 200
if the test is successful; some error code if not.
I would normally throw restify or express around the logic, but you need to run CasperJS via casperjs file.js
instead of via node
, which means I can't run restify within it. I've looked at PhantomJS, Nightmare, and Zombie. If you know for sure those would work for this let me know; otherwise I had issues with their API that lead me back to CasperJS.
This feels a bit like exposing a test suite as an API if that gives any ideas.
Any suggestions?