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: Ability to remove space before #<attempt> in filename #196

Open
jestapinski opened this issue Dec 1, 2022 · 2 comments · May be fixed by #199
Open

Feat: Ability to remove space before #<attempt> in filename #196

jestapinski opened this issue Dec 1, 2022 · 2 comments · May be fixed by #199
Labels
enhancement New feature or request

Comments

@jestapinski
Copy link

I'm looking to use this plugin with a framework (Bazel) that errors should files be passed with spaces in the filename which makes adoption quite complicated. Fortunately, I can provide options to remove most of the default spaces from the Cypress task etc., but this last space is hard coded. (i.e. some task name #0.png (the space before the #0)). This also might be tricky since spaces in filenames in general can be tricky to deal with.

Describe the solution you'd like
A flag perhaps to toggle this space to be on or off (or some other character to be used)

Additional context
Is there some quick workaround?

@jestapinski jestapinski added the enhancement New feature or request label Dec 1, 2022
FRSgit added a commit that referenced this issue Dec 4, 2022
resolves #196

Signed-off-by: Jakub Freisler <[email protected]>
@FRSgit FRSgit linked a pull request Dec 4, 2022 that will close this issue
@FRSgit
Copy link
Member

FRSgit commented Dec 4, 2022

Hey @jestapinski,

As a temporal workaround please use version 3.2.4-feat-spaces.0 release as a part of PR #199.
Is that change enough for you? If yes, I will wait with it to get other big issues resolved, so there is only a single major version bump (changing filename would be a breaking change).

Also, can you provide me with all of the steps that were necessary to get rid of any spaces from image names? I would like add those to the documentation (maybe in the FAQ section). Of course, feel free to file a PR with that documentation addition by yourself if you want to 🙂

@jestapinski
Copy link
Author

Hey @FRSgit thanks for the speedy reply!

Looks good to me, see the _ as expected and so that is what I was expecting! To get everything else to omit the space, I passed the following option to matchImage:

{
  title: `${Cypress.currentTest.titlePath.join('_').replace(/\s/g, '_')}`,
}

Alternatively, we could have joined on ' ' since the replace would also catch that. The key is the replace. I can file a PR shortly to add that to the FAQ

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

Successfully merging a pull request may close this issue.

2 participants