GSA-TTS / usagov-benefits-eligibility

Benefits eligibility estimator tool for USAGov.
22 stars 5 forks source link

add test that stub print my selections #907

Closed nehemiah-abuga closed 1 year ago

nehemiah-abuga commented 1 year ago

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

github-actions[bot] commented 1 year ago
Pa11y testing results ``` > usagov-benefits-eligibility@1.2.0 test:pa11y > pa11y http://localhost:3000/ Welcome to Pa11y > Running Pa11y on URL http://localhost:3000/ No issues found! ```
github-actions[bot] commented 1 year ago
Pa11y testing results ``` > usagov-benefits-eligibility@1.2.0 test:pa11y > pa11y http://localhost:3000/ Welcome to Pa11y > Running Pa11y on URL http://localhost:3000/ No issues found! ```