Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Proposal: Nest screenshot path based on spec path by default #1826

Closed
chrisbreiding opened this issue May 30, 2018 · 5 comments · Fixed by #1858
Closed

Proposal: Nest screenshot path based on spec path by default #1826

chrisbreiding opened this issue May 30, 2018 · 5 comments · Fixed by #1858
Assignees
Labels
pkg/server This is due to an issue in the packages/server directory type: enhancement Requested enhancement of existing feature
Milestone

Comments

@chrisbreiding
Copy link
Contributor

Instead of saving screenshots all directly in the screenshots directory, nest them based on where the spec file is relative to the integration directory. So if running

cypress/integration/app/#/user_spec.js

a screenshot will be saved as

cypress/screenshots/app/#/user_spec.js -- login -- users -- can log in.png.

@chrisbreiding chrisbreiding added type: enhancement Requested enhancement of existing feature pkg/server This is due to an issue in the packages/server directory labels May 30, 2018
@chrisbreiding chrisbreiding added this to the 3.1.0 milestone May 30, 2018
@chrisbreiding chrisbreiding self-assigned this May 30, 2018
@chrisbreiding
Copy link
Contributor Author

@brian-mann What about when/if we eventually support having different folders for unit and e2e tests? Should we include the test type too to avoid collisions?

So the pattern is:

{screenshotsFolder}/{type}/{specPath}{testName}.png

with

cypress/integration/app/#/user_spec.js

saved as

cypress/screenshots/integration/app/#/user_spec.js -- login -- users -- can log in.png

@brian-mann
Copy link
Member

Definitely don't take into account the unit vs integration stuff.

It is a good point, but I don't think we can factor that in right now.

@jennifer-shehane jennifer-shehane removed this from the 3.1.0 milestone Jun 1, 2018
@brian-mann brian-mann added this to the 3.0.2 milestone Jun 5, 2018
@chrisbreiding chrisbreiding reopened this Jun 12, 2018
@jennifer-shehane jennifer-shehane added stage: pending release and removed stage: in progress stage: needs investigating Someone from Cypress needs to look at this stage: proposal 💡 No work has been done of this issue stage: needs review The PR code is done & tested, needs review stage: ready for work The issue is reproducible and in scope labels Jun 27, 2018
@brian-mann
Copy link
Member

Released in 3.0.2.

@phryneas
Copy link

phryneas commented Jul 2, 2018

Well, this is quite a breaking change for a minor release. :/
Could you please at least update the documentation to match this behaviour?
https://docs.cypress.io/api/commands/screenshot.html does not reflect this yet.

@jennifer-shehane
Copy link
Member

@phryneas Sorry for the inconvenience. There has been a new section added to the screenshots docs on "Naming conventions", hopefully this helps.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
pkg/server This is due to an issue in the packages/server directory type: enhancement Requested enhancement of existing feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants