Automated testing
There are many different types of automated testing, which all have separate roles to play. Ideally, automated testing can be run locally as well as part of a continuous integration workflow.
Validating HTML output
Ruby
HTMLProofer is the most common tool in use for ruby projects at 18F for validating HTML output. It is used in our guides to ensure that internal links are not broken, but it can also be used for a broad range of image, link, and script tests.
HTMLProofer can be run on the command line directly, as a Rake task or as part of a CI action.
Warning:
Some government websites are very sensitive to crawlers, and so testing external government links can cause HTMLProofer to fail with an opaque error like 1 No Error
. If you are testing external links in a CI/CD pipeline, you may regularly have to manually check errors to ensure that they are valid. When a link is actually broken, HTMLProofer will display a diagnostic message about where the bad link originated.