-
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
file download not working in electron #18547
Comments
Should I expect a response? |
I also experience the same issue with Cypress 9.0.0 |
Thanks for your patience - we get a lot of issues opened and sometimes they slip through the cracks. I'm able to reproduce the issue exactly as described, an electron crash in 9.0.0. When run in Firefox, the download link opens in a new window. Cypress tests are currently limited to a single top level domain, and your download link is pointing to google docs. https://docs.cypress.io/guides/guides/web-security#Same-superdomain-per-test has some more details on this limitation. That's not to say this isn't a bug - Cypress crashing is never what we want to see! We're currently working on improving multi-domain support within Cypress, but for now you'll have to work around it by staying within the same top-level domain. |
Hey @BlueWinds Thank you for the reply! Could you please have a look at the similar issue? The difference is that I am using the same domain for the download link. |
Thanks for the response @BlueWinds Is this ever likely to change? |
Let me send a couple of links your way, and see if any of these help. The big takeaway is that when testing this sort of thing, usually clicking through isn't actually necessary - you can assert that the url on the link is correct, which gives you almost as much coverage. https://docs.cypress.io/guides/references/trade-offs#Same-origin We are also working on direct multi-domain support, but it's likely to be several months before anything concrete is ready. #17336 |
Thanks @BlueWinds but as I said the app I'm testing generates these files and I need to download them and check (and write various asserts on) their contents. |
The alternative proposed is far from ideal, as it only covers simple cases. In my case the URL is generated dynamically on JS side for the download file. I cannot assert on anything unless I click the button, which in turn breaks cypress or hangs it on 10.10.0 |
It does seem like there is a bug here. When we are doing the We have a reproduction from #24354 in this repo: https://github.com/aaron-qa/cy-error-repoduce |
I am getting seemingly the same problem: Trace: The new-window event is deprecated and will be removed. Please use contents.setWindowOpenHandler() instead.
at Object.log (node:electron/js2c/browser_init:225:603)
at emitDeprecatedNewWindowEvent (node:electron/js2c/browser_init:185:1303)
at openGuestWindow (node:electron/js2c/browser_init:185:1685)
at EventEmitter.<anonymous> (node:electron/js2c/browser_init:165:14118)
at EventEmitter.emit (node:events:527:28)
ERR_FAILED (-2) loading 'about:blank#blocked'
Error: ERR_FAILED (-2) loading 'about:blank#blocked'
at rejectAndCleanup (node:electron/js2c/browser_init:165:7500)
at EventEmitter.stopLoadingListener (node:electron/js2c/browser_init:165:7875)
at EventEmitter.emit (node:events:527:28) And it stops going over the rest of tests. We are debugging our own web app deployed to a public URL. Our code does not use The versions: Cypress: 12.0.2
Browser: Electron 106 (headless)
Node Version: v14.21.2 (/Users/eugene/.nvm/versions/node/v14.21.2/bin/node) |
I have the same issue downloading a PDF in a new tab crashes Electron. As a result it is impossible to run these kind of tests in CI. This issue doesn't happen with other browsers. |
@flotwig any idea when this can get fixed? Looks like I'm going to have to switch to Firefox as the latest version of Chrome isn't performing well with the Cypress version I'm sticking with to avoid this issue. |
I am getting the same issue in Cypress
|
I am trying to use chrome but the same issues. any fix please? |
The bug is still present in Cypress
|
Current behavior
This appears to be the same issue as described in
#14747
However I am getting it in cypress 8.6.0
It eventually bombs out with
And returns you to the command line my downloads folder is empty
I ran into the same problem when trying to write a test in my automation framework at work and thought it might be a problem with the app (or proxy) but this seems to indicate otherwise.
Am I doing something wrong here?
Desired behavior
Allow me to download the file
Test code to reproduce
To reproduce:
Cypress Version
8.6.0
Other
No response
The text was updated successfully, but these errors were encountered: