Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Native window.print() dialog is not handled #2331

Closed
AlexKamaev opened this issue Apr 20, 2018 · 16 comments
Closed

Native window.print() dialog is not handled #2331

AlexKamaev opened this issue Apr 20, 2018 · 16 comments
Assignees
Labels
SYSTEM: hammerhead TYPE: enhancement The accepted proposal for future implementation. TYPE: Web API support
Milestone

Comments

@AlexKamaev
Copy link
Contributor

AlexKamaev commented Apr 20, 2018

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')) // 
});
@AlexKamaev AlexKamaev added TYPE: bug The described behavior is considered as wrong (bug). SYSTEM: hammerhead labels Apr 20, 2018
@miherlosev miherlosev added this to the Planned milestone May 7, 2018
@miherlosev miherlosev self-assigned this May 7, 2018
@miherlosev miherlosev added TYPE: enhancement The accepted proposal for future implementation. and removed TYPE: bug The described behavior is considered as wrong (bug). labels May 7, 2018
@ZayanNadeem
Copy link

Is there any update on this issue?

@miherlosev
Copy link
Collaborator

Hi @ZayanNadeem

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

@weyert
Copy link

weyert commented Nov 18, 2019

Any update on this?

@need-response-app need-response-app bot added the STATE: Need response An issue that requires a response or attention from the team. label Nov 18, 2019
@miherlosev miherlosev self-assigned this Nov 19, 2019
@miherlosev
Copy link
Collaborator

Hi @weyert

At present, this enhancement is not implemented.
The features that we are planning to implement are listed on the Roadmap page. The current feature is not on this list. I'm afraid I cannot provide you with any time frames as to when it will be implemented.

If this enhancement is very important for you, the PR is greatly appreciated.

@need-response-app need-response-app bot removed the STATE: Need response An issue that requires a response or attention from the team. label Nov 19, 2019
@rob4629
Copy link
Contributor

rob4629 commented Feb 5, 2020

Hi, I'm just wondering if an issue I'm experiencing is related to this.

Running my tests in headed mode (Safari, Chrome, Firefox), and I get a browser dialog/pop-up window: this website has been blocked from automatically composing an email. I've tried to use await t.setNativeDialogHandler(() => true), but I'm unable to clear the dialog. This then prevents the rest of my tests from executing (as referenced here).

@need-response-app need-response-app bot added the STATE: Need response An issue that requires a response or attention from the team. label Feb 5, 2020
@AlexSkorkin
Copy link
Collaborator

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

@need-response-app need-response-app bot removed the STATE: Need response An issue that requires a response or attention from the team. label Feb 7, 2020
@github-actions github-actions bot added the STATE: Stale An outdated issue that will be automatically closed by the Stale bot. label Feb 7, 2021
@rob4629
Copy link
Contributor

rob4629 commented Feb 7, 2021

Hey, can you leave this open, please?

@need-response-app need-response-app bot added the STATE: Need response An issue that requires a response or attention from the team. label Feb 7, 2021
@github-actions github-actions bot removed the STATE: Stale An outdated issue that will be automatically closed by the Stale bot. label Feb 8, 2021
@Farfurix
Copy link
Contributor

Farfurix commented Feb 8, 2021

Hello @rob4629,

OK.

@need-response-app need-response-app bot removed the STATE: Need response An issue that requires a response or attention from the team. label Feb 8, 2021
@fabidev1993
Copy link

hi
any update on this issues?
i have same problem
i want to be sure that button is working correctly but when i click on the button print dialog comes out and i can not do any thing with that :|

@need-response-app need-response-app bot added the STATE: Need response An issue that requires a response or attention from the team. label Mar 28, 2021
@AlexSkorkin AlexSkorkin added the STATE: No updates No updates are available at this point. label Mar 29, 2021
@github-actions
Copy link

No updates yet. Once we get any results, we will post them in this thread.

@github-actions github-actions bot removed STATE: Need response An issue that requires a response or attention from the team. STATE: No updates No updates are available at this point. labels Mar 29, 2021
@LaszloQ
Copy link

LaszloQ commented Jun 30, 2021

Hello, I'm experiencing the same problem. The print window is opened and the browser hangs and eventually closes down.

Do you have any workarounds for this? The submit button doesn't have an onClick attribute.

@need-response-app need-response-app bot added the STATE: Need response An issue that requires a response or attention from the team. label Jun 30, 2021
@viktoria2506 viktoria2506 added the STATE: No workarounds No workarounds are available at this point. label Jun 30, 2021
@github-actions
Copy link

There are no workarounds. Once we get any updates, we will post them in this thread.

@github-actions github-actions bot removed STATE: Need response An issue that requires a response or attention from the team. STATE: No workarounds No workarounds are available at this point. labels Jun 30, 2021
@miherlosev miherlosev removed their assignment Jun 23, 2022
@kerrijackson
Copy link

Any update on this? please???

@need-response-app need-response-app bot added the STATE: Need response An issue that requires a response or attention from the team. label Jun 1, 2023
@miherlosev
Copy link
Collaborator

Hi @kerrijackson,

There are still no updates. However, you can use the following workaround to prevent test execution from being stopped. Add the following code to clientScript.

window.print = function () {};

@need-response-app need-response-app bot removed the STATE: Need response An issue that requires a response or attention from the team. label Jun 5, 2023
@Artem-Babich Artem-Babich self-assigned this Jun 6, 2023
Artem-Babich added a commit to Artem-Babich/testcafe that referenced this issue Jun 6, 2023
@github-actions
Copy link

Release v3.0.0-rc.2 addresses this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
SYSTEM: hammerhead TYPE: enhancement The accepted proposal for future implementation. TYPE: Web API support
Projects
None yet
Development

No branches or pull requests