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

file download not working in electron #20911

Closed
sharky910 opened this issue Apr 5, 2022 · 4 comments
Closed

file download not working in electron #20911

sharky910 opened this issue Apr 5, 2022 · 4 comments

Comments

@sharky910
Copy link

sharky910 commented Apr 5, 2022

Current behavior

I am getting the same issue as #14747 but on 9.5.3, when using my cucumber test to download the file cypress is crashing (using Electron).

This is the test I have written:
image

and the error I am getting:

image

I have been removing the target so the second page does not open and it all opens on one page and this has worked for other fields but not this xlsx file.

Desired behavior

Download the XLSX file to a Download Folder without crashing

Test code to reproduce

import {Then} from "cypress-cucumber-preprocessor/steps";

Then(`I click on button {string}`, (button) => {
    switch(button){
        case "Download Guide":
        cy.get('.fa-download').invoke('removeAttr', 'target').click();
        break;

'<p class="mb-20px"><a :href="propertyExcelGuideURL" target="_blank"><i class="fas fa-download"></i> Download guide/sample file</a>' +

Cypress Version

9.5.3

Other

No response

@nagardd
Copy link

nagardd commented Apr 7, 2022

I have the same issue but without removing target attribute:
cy.get('.cta-button').click()

When I add removeAttr:
cy.get('.cta-button').invoke('removeAttr', 'target').click() I get timeout:
Timed out after waiting 60000ms for your remote page to load

My anchor from: https://www.londonstockexchange.com/adviser:
<a _ngcontent-ng-lseg-c14="" class="cta-button gold-button big-font-size outline bold-font-weight" target="_blank" href="https://api.londonstockexchange.com/api/gw/lse/download/directories/aim-adviser/instruments?sectors=&amp;locations=&amp;marketcapitalizationrange="> Download list <span _ngcontent-ng-lseg-c14="" class="cta-document"></span></a>

Cypress Version:
8.6.0

@cypress-bot cypress-bot bot added stage: backlog and removed stage: needs investigating Someone from Cypress needs to look at this labels Apr 29, 2022
@archfz
Copy link

archfz commented Nov 1, 2022

I am getting this issue on cypress 10.10.0. I was before on 9.5.3 and it wasn't reproducing. The whole cypress process dies. Removing target blank only improves this by not crashing cypress, but download still doesn't work.

@AlenaHalotaAbsa
Copy link

I'm having the same issue in Cypress 10.4.0.

Test:

cy.get('[class="ti-new-window"]').eq(0).click().then(() => {
cy.verifyDownload();
})

Result:
Error: ERR_FAILED (-2) loading '------/download'
at rejectAndCleanup (node:electron/js2c/browser_init:161:7647)
at EventEmitter.stopLoadingListener (node:electron/js2c/browser_init:161:8022)
at EventEmitter.emit (node:events:526:28)
at EventEmitter.emit (node:domain:475:12)

@flotwig
Copy link
Contributor

flotwig commented Feb 27, 2023

This is seemingly a duplicate of #18547, closing

@flotwig flotwig closed this as completed Feb 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants