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

Cypress is not able to clean /screenshots #4655

gabbersepp opened this issue Jul 5, 2019 · 2 comments


2 participants
Copy link

commented Jul 5, 2019

Current behavior:

On every run, cypress will clean it's screenshots folder (as mentioned in the documentation). Unfortunately on Windows it is likely that the filenames are too long and thus can not be deleted. When cypress tries to do this, it ignores those files.
We take all screenshots after the test runs and publish them as build artifacts. So this is a problem as we always see old screenshots.

Desired behavior:

Cypress should be able to delete them anyway.

I will use a own build step that uses "rimraf" to do this. maybe cypress should include rimraf or similar for this task?

Steps to reproduce: (app code and test code)

Execute cypress from this repo on a Windows 2016 Server.

Please note: It seems that Windows 10 has increased it's max path length. So when using this repo on a Win10 machine, you will have no issues.


cypress 3.3.2
Windows 10
Chrome: Version 75.0.3770.100 (Offizieller Build) (64-Bit)


This comment has been minimized.

Copy link

commented Jul 8, 2019

Thanks for providing a reproducible example. We shouldn't be creating screenshot files with a filename that is too long - so that we don't run into a problem deleting them.

There is some code to ensure filename length here:

As well as tests here:


This comment has been minimized.

Copy link

commented Jul 8, 2019

Thanks to make that clear.
Unfortunatelly, this code ensures a max filename length but ignores the directory structure.
In Windows we have 260 chars including the directory structure.

But I am not sure if this needs to be fixed as stated in the new Win10 versions do not have this limitation anymore and also new windows server versions doesn't restrict the length.

By using rimraf I have fixed this for our purpose.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.