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

For the same spec, Screenshots are generated in different folders when run all specs or run specific spec using command --spec #24176

Closed
787681277 opened this issue Oct 8, 2022 · 4 comments
Assignees
Labels
CT Issue related to component testing

Comments

@787681277
Copy link

Current behavior

If do Angular component testing:
For the same spec, Screenshots are generated in different folders with below 2 commands
npx cypress run --component --browser chromium
npx cypress run --component --browser chromium --spec

This issue does not occur if do React component testing

Desired behavior

If do Angular component testing:
For the same spec, Screenshots should be generated in SAME folders with below 2 commands
npx cypress run --component --browser chromium
npx cypress run --component --browser chromium --spec

Test code to reproduce

Angular component testing
npx cypress run --component --browser chromium
npx cypress run --component --browser chromium --spec "XX"

Cypress Version

10.9

Node version

v12.20.0

Operating System

12.6

Debug Logs

No response

Other

No response

@ll-vvolodko
Copy link

ll-vvolodko commented Oct 31, 2022

We experience same issue with Cypress 10.7. and Node 16.17

When running tests using --spec parameter the screenshots are being generated like this -> screenshots-folder/spec-file-name/screenshot-name

When running tests without --spec parameter then the folder structure reflects the folder structure for tests themself -> screenshots-folder/sub-folder-1/sub-folder-2/spec-file-name/screenshot-name

@github-actions
Copy link
Contributor

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.

@github-actions github-actions bot added the stale no activity on this issue for a long period label May 12, 2023
@tassin-gauthier
Copy link

tassin-gauthier commented May 31, 2023

I would like to reopen this issue which is very problematic for include screenshots to a mochawesome report.

Btw, the problem is not due to Angular / React as the author suggests but it depends on the spec folder hierarchy, and how much spec you are testing with npm run.

  • npm run cypress
  • npm run cypress --spec folder1/*
  • npm run cypress -- spec folder1/folder1-1/*
    will lead to 3 differents path for the same screenshots

@nagash77 nagash77 added CT Issue related to component testing and removed stale no activity on this issue for a long period labels May 31, 2023
@emilyrohrbough
Copy link
Member

This is a duplicate of #24052 (comment). It was an intentional v10.0.0 change, however, we recognizing this behavior is unexpected.

I am closing as a duplicate in favor of #24052.

@emilyrohrbough emilyrohrbough closed this as not planned Won't fix, can't repro, duplicate, stale May 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CT Issue related to component testing
Projects
None yet
Development

No branches or pull requests

6 participants