mbolotov / intellij-cypress

IntelliJ-Cypress plugin: https://plugins.jetbrains.com/plugin/13819-intellij-cypress Pro version: https://plugins.jetbrains.com/plugin/13987-cypress-support-pro
MIT License
35 stars 5 forks source link

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

Open rhpkegel opened 2 years ago

rhpkegel commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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

rhpkegel commented 2 years ago

@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 commented 2 years ago

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

mbolotov commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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.