GSA-TTS / 10x-website

[LIVE] 10x 11ty site
https://10x.gsa.gov
3 stars 0 forks source link

Create a way to test new components #163

Open natashapl opened 6 months ago

natashapl commented 6 months ago

There is a need for testing of new front end components. Until there is a complete solution, there is a workaround that checks every page in the sitemap and ensure that a certain element exists in the site. The code was originally provided by @jonathanbobel and I converted to a gist that can be downloaded here.

To use this code, do the following:

  1. Download the code snippet mentioned above. The file is called "sitemap-element-checker.js".
  2. Add that file to the root of the 10x project.
  3. Open the file site.json and temporarily change the value of "url" to "http://localhost:8080". Save the file.
  4. Open a new terminal and run the following:

node sitemap-element-checker.js

It will list all the pages in the site and state whether or not the element exists in the page.