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

Cypress runner will not run when activated with a path containing whitespaces #53

Open
rhpkegel opened this issue Jul 26, 2021 · 8 comments

Comments

@rhpkegel
Copy link

rhpkegel commented Jul 26, 2021

we cannot run tests with the Cypress runner at all on one of our machines, because the project is located in a directory with a space character, like so: C:\Users\Jane Doe\projects\myProject\src\main\frontend\cypress\integration/**/*. The plugin then fails to load the reporter, like so:

Warning: It looks like you're passing --spec a space-separated list of arguments:
"C:\Users\Jane Doe\projects\myProject\src\main\frontend\cypress\integration/**/*"
This will work, but it's not recommended.
If you are trying to pass multiple arguments, separate them with commas instead:
  cypress run --spec arg1,arg2,arg3
The most common cause of this warning is using an unescaped glob pattern. If you are
trying to pass a glob pattern, escape it using quotes:
  cypress run --spec "**/*.spec.js"
Could not load reporter by name: C:\Users\Jane
We searched for the reporter in these paths:
- C:\Users\Jane
The error we received was:
Cannot find module 'C:\Users\Jane'

For completeness' sake, the command that is run is as follows:
"C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npx-cli.js" cypress run -b chrome --headless -e TAGS=\"not (@nog-te-implementeren or @niet-runnen-ivm-bug)\" --reporter "C:\Users\Jane Doe\AppData\Local\Temp\intellij-cypress-reporter9985614208215620979.js" --spec "C:\Users\Jane Doe\projects\myProject\src\main\frontend\cypress\integration/**/*"

@mbolotov
Copy link
Owner

It a bit hard to create a separate user with a space in the name for me.

So I just tried to run the command with spaces in other places. And it worked okay for me.
The command was as follows:
"C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npx-cli.js" cypress run --reporter "C:\Users\mbolotov\AppData\Local\Temp\my dir11585968697581366181\intellij-cypress-reporter1427337492072983935.js" --spec "C:/work/t/new folder/cypress-starter-kit/tests/cypress/integration/foo bar/sample-test.js"

As a workaround, you could try using the old approach with the intellij-cypress-reporter installed as a project dependency.

@mbolotov
Copy link
Owner

mbolotov commented Aug 6, 2021

@rhpkegel, have you had a chance to try the workaround?

@rhpkegel
Copy link
Author

rhpkegel commented Sep 9, 2021

@mbolotov Hey! Sorry, I didn't get your message, github's interface is a mystery to me sometimes. I'm afraid my colleague that suffers from this issue has not done anything with cypress lately, so I've not had the chance to test this. Apologies for the inconvenience!

@kevincam3
Copy link

Any plans to make it work with spaces in the User name?

@mbolotov
Copy link
Owner

Hi @kevincam3!
Do you have the same problem with the reporter resolution failure?
Do you have Could not load reporter by name wording in your output?
If yes, did you try to use the reporter as a project dependency approach?

@kevincam3
Copy link

Yes, I do have the same problem. I did add that dependency but It's not clear to me how to run it making use of that dependency. Those screenshots seem to be of an older version of Webstorm/PhpStorm.

@mbolotov
Copy link
Owner

You don't have to do anything other than this. The runner will pick it up automatically.
But now I think it won't help as long as your project is placed under the user directory. It will use the user directory as a part of the full path as well.
So current workaround seems to be to use a local reporter dependency as well as moving your project out of the user directory (so that it doesn't contain a space).
BTW what version of the plugin do you use?

@kevincam3
Copy link

I'm using 1.4.1

Yeah, just installing that package as a dependency doesn't do anything it still runs the same. I guess I won't be able to use this plugin for now. I'll just launch it externally.

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

No branches or pull requests

3 participants