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

(feat) Custom path / filename for snapshots #161

Open
jonyw4 opened this issue Dec 28, 2020 · 2 comments
Open

(feat) Custom path / filename for snapshots #161

jonyw4 opened this issue Dec 28, 2020 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@jonyw4
Copy link

jonyw4 commented Dec 28, 2020

Hi guys, amazing plugin for cypress! It is really helpful. I need a feature in this project and I want to contribute 😁

Is your feature request related to a problem? Please describe.
I have an automatically generated test file and I need to customize the snapshot path and filename.

Describe the solution you'd like
Today if we use toMatchImageSnapshot we have name prop that defines a custom name for the image file. Maybe we could add that in toMatchSnapshot too. Is this way I can split the snapshot file into multiple files.

@jonyw4 jonyw4 added the enhancement New feature or request label Dec 28, 2020
@adhamqodirov
Copy link

@meinaart Awesome plugin for cypress, thank youuuu. I wanted to ask if you have time, I want to contribute to your plugin and add some configuration to split the images into 3 folders (stable folder, actual folder, different folder). Could you tell us how to achieve this result? In which files do I need to change the paths and some conditions? Thanks in advance :))

@sergei-shneider
Copy link

while looking for a different solution i found this workaround that seems to work well for this purpose-> #10 (comment)

Just modify it so that fixCypressSpec accepts an argument and then splice that argument at lastIndexOf('/') or indexOf('.') in both absoluteFile and relativeFile.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants