stubbing print window #18323
Unanswered
sagarrajput
asked this question in
Questions and Help
Replies: 1 comment 1 reply
-
@brian-mann @jennifer-shehane @bahmutov Can anyone help us with this. @sagarrajput Do you have any workaround for this? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello
I trying to stub print preview but getting, could you please help, Ultimately I want to close print preview or somehow avoid from opening,
expected print to have been called exactly once, but it was never called
My code looks like
cy.window().then(win => {
cy.stub(win, 'print').as('print');
});
cy.get('my locator').click(); // this click event opens print widdow(Only after closing print preview window my API call happens).
cy.get('@print').should('have.been.calledOnce');
tagging: @brian-mann @jennifer-shehane @bahmutov
Beta Was this translation helpful? Give feedback.
All reactions