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

Can't run because no spec files were found. #62

Closed granite closed 2 years ago

granite commented 2 years ago

I just installed Cypress Pro plugin (Version 2.4.0) in Webstorm (Version 2021.2.1). I tried to follow this video to setup a Test Run Configuration (ref: https://www.youtube.com/embed/1gjjy0RQeBw ) , but it seems out-of-date. I don't see any 'Create Run Configuration' option in the context menu. Instead I have More Run/Debug->Edit Run Configuration, but that didn't work. So then I then went to the main menu Run->Configurations and clicked + -> Cypress.

I setup the working directory to be where all my cypress config and tests are located; The directory structure is like this:

cypress
-> config
-> fixtures
-> integration
-> plugins
-> support

My tests are under integration. When I try to run my test for one the spec files (cypress\integration\user-profile\user-profile\user-profile.spec.js) , I get an error saying it can't find the spec file,, even though all the paths look correct

"C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npx-cli.js" cypress run -b chrome --config-file config/cypress.json --reporter C:\Users\username\AppData\Local\Temp\intellij-cypress-reporter1099357078825348125.js --spec C:\Users\username\git_username\dwp-pwa\cypress\integration\user-profile\user-profile\user-profile.spec.js

Can't run because no spec files were found.

We searched for any files matching this glob pattern:

integration\user-profile\user-profile\user-profile.spec.js

Relative to the project root folder:

C:\Users\username\git_username\dwp-pwa\cypress

Process finished with exit code 1

image

image

mbolotov commented 2 years ago

Hi @granite! There seems to be a couple of issues:

  1. Currently the plugin does not support specifying cypress config path. It tries to find it automatically based on the spec file (looking up through the file path hierarchy). As your config file is placed in a separate directory, the plugin can't find it. And thus it does not suggest to create a run configuration via gutter in the editor.

  2. I don't know why the cypress itself fails to find the spec when you run it. I have to look to this problem closely.

mbolotov commented 2 years ago

Hi @granite! You can try the 2.5.0 version of plugin and define your specific path to the cypress configuration file: image

It should fix the issue 1 from above

mbolotov commented 2 years ago

Hi @granite! Have you had a chance to try the 2.5.0 version and specify a custom cypress config file path? Does it solve your problem?