This PR adds cypress e2e automated test that validates when a user clicks “Print my Selections” button, print functionality is triggered.
Given when we utilize cypress to trigger printing, a browser window pops up and the test will remain stuck until a user interacts with the window to close it, this test will stub the call to print and include an assertion to validate that printing was called once.
To avoid opening print dialogue which makes the test stuck, we can stub the window.print method before the application calls it.
PR Summary
This PR adds cypress e2e automated test that validates when a user clicks “Print my Selections” button, print functionality is triggered.
Given when we utilize cypress to trigger printing, a browser window pops up and the test will remain stuck until a user interacts with the window to close it, this test will stub the call to print and include an assertion to validate that printing was called once. To avoid opening print dialogue which makes the test stuck, we can stub the window.print method before the application calls it.
https://glebbahmutov.com/cypress-examples/recipes/stub-window-print.html#app-calls-the-window-print-method
Related Github Issue
https://github.com/GSA/usagov-benefits-eligibility/issues/846
Type of change
Detailed Testing steps
npm run cypress:run_chrome
print-selections.cy.js
as well as other tests are passing