Skip to content

Files

Latest commit

cc13866 · Jun 6, 2022

History

History

stubbing-spying__window-print

Stubbing window.print

This is an example showing how to stub window.print method call

The application

The page index.html calls window.print on button click. Without stubbing, the test would click and then a system print dialog would block the rest of the test.

System print dialog

By stubbing the window.print the spec.cy.js can confirm the call has happened.

Stub window print test