testcafe: Native window.print() dialog is not handled

Are you requesting a feature or reporting a bug?

bug

What is the current behavior?

system print dialog appears and prevent test execution

What is the expected behavior?

this dialog should be handled

Provide the test code and the tested page URL (if applicable)

<html>
    <head>
    </head>
    <body>
        <button onclick="window.print()">print</button>
        <button>click</button>
    </body>
</html>

Test code

test('Print dialog', async t => {
    await t
        .click(Selector('button').withText('print')) // waiting here and prevents further test execution
        .click(Selector('button').withText('click')) // 
});

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 3
  • Comments: 16 (3 by maintainers)

Commits related to this issue

Most upvoted comments

The setNativeDialogHandler method is intended for the native alert/confirm/prompt and beforeunload dialogs. It does not support the print dialog (as mentioned in this thread) or other dialogs. We will look deeper into it in the context of your other thread: #4732

Hi @ZayanNadeem

The current development sprint is already planned. We will consider this issue during planning the next development sprint.