Skip to main content
U.S. flag

An official website of the United States government

The .gov means it’s official.
Federal government websites often end in .gov or .mil. Before sharing sensitive information, make sure you’re on a federal government site.

The site is secure.
The https:// ensures that you are connecting to the official website and that any information you provide is encrypted and transmitted securely.

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.

18F Engineering

An official website of the GSA’s Technology Transformation Services

Looking for U.S. government information and services?
Visit USA.gov