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

Allow to specify the path to cypress executable #3

Closed rusakov92 closed 4 years ago

rusakov92 commented 4 years ago

Hello, my current setup in PHPStorm is with a remote PHP interpreter and there is a folder mapping to my root directory from my local PC to my docker container. Example:

In Preferences -> Languaged & Frameworks -> PHP Path mappings: <Project root>->/code Where project root is /User/myname/code

It looks like the plugin uses the mapped remote folder as a project root and tries to execute my cypress test by appending /code as the project root instead of /User/myname/code. Here is what I see from the runner configuration:

node /code/node_modules/.bin/cypress run --env headless=true --config-file cypress.json --headless run --headed --reporter /User/myname/code/node_modules/cypress-intellij-reporter --spec /User/myname/code/tests/Cypress/integration/autorization_code/authorization_code_generation.js

Is there a way to specify the full path to the executable?

mbolotov commented 4 years ago

Hi, No there is no way to specify the full path now. I'll think about this feature. Currently, you could try to run cypress via a package manager: image

Is it possible to share your project setup somehow?

rusakov92 commented 4 years ago

Yes, those are my current settings, I usually run cypress locally because from the remote container I can only run it in headless mode but I also set up PHPStorm to use the remote interpreter because of custom packages and settings that are specific for the version in the container.

Problem is that the app uses my local node executable as intended but appends the incorrect project root dir to the cypress executable in the node_modules folder. If I'm able to specify my local custom path to cypress executable this will resolve my problem.

mbolotov commented 4 years ago

those are my current settings,

Hmm, do you mean you have the npm selected and have node /code/node_modules/.bin/cypress run in the command? That looks quite weird since this form of command is expected for a no package manager invocation type. When I set the npm I get the following: "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npx-cli.js" cypress run ... So there is no explicit path to cypress package in this case.

rusakov92 commented 4 years ago

Had another check on the configuration, turns out yarn is set as a package manager. Here is my config, note that all paths are local on my Mac. Screenshot 2020-03-28 at 19 33 46 Screenshot 2020-03-28 at 19 34 55

I've set it to use NPM: Screenshot 2020-03-28 at 19 43 59

Works fine without any issues and executes all tests. I guess there is no issue here then, I did not configure correctly my runner. Sorry about that.