title: Cypress how to close window print dialog
body: <p>I am looking to perform action on print window using cypress.</p>
  <p>Manually when I click on the print button I get the print window like Image 1.
  But when I run the same script in cypress test runner, I get the print windows as in Image 2.</p>
  <p>I am aware that action on such window can be done using a stub. But I cant even inspect print window I get in test runner i.e. Image 2. so what shall be the locator of cancel button ??</p>
  <pre><code>let printStub
            cy.window().then(win =&gt; {
                  printStub = cy.stub(win, 'print')
                  cy.get(HOW DO I GET THE LOCATOR).click().then(()=&gt;{
                      expect(win.print).to.be.called
                  })
              })
  </code></pre>
  <p><strong>Image 1:</strong>
  <a href="https://i.stack.imgur.com/fUvX0.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/fUvX0.png" alt="enter image description here" /></a></p>
  <p><strong>Image 2:</strong>
  <a href="https://i.stack.imgur.com/EO3RP.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/EO3RP.png" alt="enter image description here" /></a></p>