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

Calling "cy.verifyDownload" with an empty string results in success

Open BillyTom opened this issue 3 months ago • 0 comments

I have been using cy-verify-downloads version 0.2.4 for a while now, and I just noticed an unwanted behaviour.

I accidentally changed one of my test suites so that it would call verifyDownload with an empty string as a parameter. In that case the test would be marked as "pass", even though the file download was not actually tested. The log output in Cypress UI looked like this:

verifyDownload - Waiting for the file to be exist
task - isFileExist, /home/foobar/project/cypress/downloads
assert - The file has been downloaded successfully: expected true to be true

I think this is misleading behaviour. If "cy.verifyDownload" is called with an empty string, then the test case should fail.

BillyTom avatar Nov 11 '24 09:11 BillyTom