Skip to content

Deleting downloadsFolder during a test doesn't delete, and makes folder unwritable #32832

@ashleymercer

Description

@ashleymercer

Current behavior

Attempting to delete downloadsFolder during a test doesn't in fact delete the folder, but instead makes the folder protected somehow (at least on Windows, this makes the folder accessible only to admin users). It is then no longer possible to read or write to that path meaning any subsequent tests which attempt to read or write will fail.

The folder remains protected like this until Cypress exits, at which point the folder is automatically removed. (This is different from normal behaviour, where the downloadsFolder is left in place after Cypress exits).

This only seems to happen during cypress open. If the same tests are executed with cypress run then everything works fine.

Desired behavior

It should be possible to wipe the downloads folder during a test without breaking everything.

Test code to reproduce

https://github.com/ashleymercer/cypress-test-downloads-dir

Cypress Version

15.5.0

Debug Logs

TBC

Other

Motivation is that we are attempting to work around #14870 so currently have a snippet in our e2e.ts file which simply deletes the downloadsFolder before each test.

This was working fine in the previous version we used (14.4.1) so this looks like a regression.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions