cy-verify-downloads icon indicating copy to clipboard operation
cy-verify-downloads copied to clipboard

In Cypress headless mode download.htm file is created

Open tea8923 opened this issue 1 year ago • 1 comments

When starting the tests in a Cypress headless mode, .crdownload is not appended to the downloaded file and removed when the file is downloaded completely, instead the completely new file is being created inside cypress/downloads folder with the name downloads.htm.crdownload ('downloads.htm'). So at the end of testing there are 2 files:

valid_file.txt download.htm

Why is it happening?

CY v12.17.0 cy-verify-downloads v0.1.15

Thank you in advance.

tea8923 avatar Jul 27 '23 15:07 tea8923

I had the same problem and it's because the file is still downloading. I solved the problem by adding a cy.wait after the download action (click or get url). For example, you add 10 seconds to make sure it's finished (then maybe you can intercept it).

Hope it's help you

oselow avatar Oct 23 '23 13:10 oselow