digital-analytics-program / gov-wide-code

Provides a set of javascript files and documentation to implement web analytics on US federal websites
http://www.digital.gov/dap
104 stars 55 forks source link

Add more integration tests. #124

Closed sanason closed 2 months ago

sanason commented 2 months ago

Builds on the initial Cucumber integration tests added by @levinmr . Provides some test coverage for:

Generally, the behavior of the tests is to:

  1. Start up a headless browser (using Puppeteer).
  2. Load a page from our DAP-enabled test site in the browser.
  3. Interact with the page in some way that should trigger a DAP event (using Puppeteer).
  4. Inspect window.dataLayer to verify that the correct gtag call was made.

The DAP-enabled test site runs in Docker, in a process that must be started up separately from the test runner. The contents of the test site are based on an HTML file that Cardinal Path has been using for its own manual testing of the DAP code.

sanason commented 2 months ago

@levinmr I'm not allowed to add reviewers but I'd appreciate your review.