Clipboard does not work in Chrome launched by Cypress:
⌘+C) causes Chrome to hangClipboard should work as normal when interacting with Cypress Chrome instance.
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.
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?
I stumbled upon the same behaviour in my app, and found that copy-to-clipboard has a fallback mechanism that will display exactly this alert box if it finds that execCommand does not work (as appears to be the case within cypress).
So I guess we need to wait until https://github.com/cypress-io/cypress/issues/2851 is fixed.
@tzimmermann Good call, I'm actually using react-copy-to-clipboard but it uses copy-to-clipboard under the hood. I'll keep an eye on #2851 👍
+1
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 clipboard variable and read from it later on in your test.
It worked for me. Hope it helps.
https://github.com/sudodoki/copy-to-clipboard/issues/88
Most helpful comment
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.
