-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Chrome hangs when copying text to clipboard #2739
Comments
I'm not able to reproduce this at all. You are doing this copy/paste manually right? Not writing tests for cypress to do this? Could you record a video/gif of what you mean? Perhaps I'm not doing exactly what you're doing. |
Yes you have understood the issue correctly. I don't think adding a video is going to add any value here. None of my team mates can reproduce this error either (all on Mac). |
This might be related, I'm getting stuck after clicking a button that's supposed to copy to the clipboard. I know issue #311 is tracking copy/paste support and I'm fine if the copy function is a no-op for now but I'd still like to be able to click this button w/out needing any human interaction to move on to the next part of the test afterwards. Right now, I need to hit enter to click OK to move on. |
All I can suggest is to ensure you have all extensions disabled when trying the keyboard shortcut - it may be localized somehow to your machine since no one else is experiencing this exact behavior. Unfortunately we have to close this issue as there is not enough information to reproduce the problem. Please comment in this issue with a reproducible example and we will reopen the issue. 🙏 |
@bohendo Are you using copy-to-clipboard, by chance? So I guess we need to wait until #2851 is fixed. |
@tzimmermann Good call, I'm actually using |
This comment has been minimized.
This comment has been minimized.
If the copy-to-clipboard functionality is not important to what you are testing, you can stub out window.prompt so that your test will run without interruption. https://docs.cypress.io/api/commands/stub.html#Replace-built-in-window-methods-like-prompt // Disable window prompt which is used in link creation by copy-to-clipboard library
// This prompt pauses test execution during `cypress open`
cy.window().then(win => {
cy.stub(win, 'prompt').returns('DISABLED WINDOW PROMPT');
}); You could probably also store the value passed to the prompt in a |
It worked for me. Hope it helps. |
@bohendo did you find solution for how to handle this clipboard prompt. i having same issue can you please help me out. |
I have solution, copy-to-clipboard library do document.execCommand("copy") and this has to be in callback. For my solution help use https://github.com/dmtrKovalenko/cypress-real-events#readme library and invoke button that do copy like ... cy.get(selector).realClick(); |
Chrome version 87 with Cypress default Electron is OK But there is a problem with the selection of Chrome 104. It seems that the new version limits the ability to copy scripts to the clipboard. |
@ivanmjartan Thank you, your solution help me and working for me |
Thanks! |
Current behavior:
Clipboard does not work in Chrome launched by Cypress:
⌘+C
) causes Chrome to hangDesired behavior:
Clipboard should work as normal when interacting with Cypress Chrome instance.
Steps to reproduce:
Select any text anywhere in a Chrome instance launched by Cypress (text on a page, console/debugger output, location bar, chrome preferences etc) then hit
⌘+C
.Versions
The text was updated successfully, but these errors were encountered: