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

trashAssetsBeforeRuns=false keeps all versions of screenshots but not of videos #8280

Open
alina-thorzen opened this issue Aug 14, 2020 · 7 comments · May be fixed by #30673
Open

trashAssetsBeforeRuns=false keeps all versions of screenshots but not of videos #8280

alina-thorzen opened this issue Aug 14, 2020 · 7 comments · May be fixed by #30673
Labels
stage: ready for work The issue is reproducible and in scope topic: video 📹 type: unexpected behavior User expected result, but got another

Comments

@alina-thorzen
Copy link

alina-thorzen commented Aug 14, 2020

Current behavior:

In my cypress.json I have the option

  "trashAssetsBeforeRuns": false,

The test cases are running every day with ./node_modules/.bin/cypress run

It is kept all versions of the screenshots for each run, but not for the videos. The videos get overwritten

Desired behavior:

The videos should not get overwritten. I would like to keep all the videos of each run

Test code to reproduce

add "trashAssetsBeforeRuns": false to cypress.json

Versions

cypress version 4.12.1

cypress-issue

@jennifer-shehane
Copy link
Member

trashAssertsBeforeRuns option:

Whether Cypress will trash assets within the screenshotsFolder and videosFolder before tests run with cypress run.

When run as set to false, an screenshots taken for next runs are saved, but it does overwrite the video from the previous run. I believe this is unexpected behavior.

it('write to file', () => {
  expect(true).to.be.false
})
{
  "trashAssetsBeforeRuns": false
}

After 2 cypress run

Screen Shot 2020-08-17 at 2 32 06 PM

@jennifer-shehane jennifer-shehane added the type: unexpected behavior User expected result, but got another label Aug 17, 2020
@cypress-bot cypress-bot bot added the stage: ready for work The issue is reproducible and in scope label Aug 17, 2020
@cypress-app-bot
Copy link
Collaborator

This issue has not had any activity in 180 days. Cypress evolves quickly and the reported behavior should be tested on the latest version of Cypress to verify the behavior is still occurring. It will be closed in 14 days if no updates are provided.

@cypress-app-bot cypress-app-bot added the stale no activity on this issue for a long period label May 17, 2023
@cypress-app-bot
Copy link
Collaborator

This issue has been closed due to inactivity.

@cypress-app-bot cypress-app-bot closed this as not planned Won't fix, can't repro, duplicate, stale Jun 2, 2023
@OliverLeighC
Copy link

Is there a fix for this?

@jennifer-shehane jennifer-shehane removed the stale no activity on this issue for a long period label Sep 4, 2024
@YJDoc2
Copy link

YJDoc2 commented Oct 16, 2024

Hey, I believe this might be happening because while writing screenshot to disk here , the path generation checks for given path existing or not, and updates the path according to the overwrite flag here. From what I see in video capture code here there is no such logic to detect existing paths. I'm not sure if the actual video writing is done in some other place where we are doing such check, but from a first glance, I think this might be the reason of videos not getting persisted.

@jennifer-shehane Is this issue open for contributions? If so can I try to make a PR for it? This would be my first time contributing to cypress, is there anything other than Contributing.md I should take a look at if I work on this? Thanks!

@jennifer-shehane
Copy link
Member

@YJDoc2 Yes, if tests are written we would accept PRs to fix bugs

@YJDoc2 YJDoc2 linked a pull request Nov 25, 2024 that will close this issue
3 tasks
@YJDoc2
Copy link

YJDoc2 commented Nov 28, 2024

Hey @jennifer-shehane , I have opened #30673 for this, and need a bit of help with adding tests in there. I have mentioned details in the PR description, do I need to do something else to get it reviewed or someone from cypress will review it when they get time?
Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stage: ready for work The issue is reproducible and in scope topic: video 📹 type: unexpected behavior User expected result, but got another
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants