intellij-cypress icon indicating copy to clipboard operation
intellij-cypress copied to clipboard

new open-ct configuration won't run in IntelliJ 2022.1

Open francisu opened this issue 2 years ago • 8 comments

I created a new open-ct configuration for component tests and it fails like this:

/usr/local/bin/yarn node yarn:configurations/package.json:cypress/bin/cypress open-ct -b electron --config testFiles=**/src/**/*
/Users/francis/d/IdeaProjects/product/.pnp.cjs:45547
    throw firstError;
    ^

Error: Qualified path resolution failed - none of those files can be found on the disk.

Source path: /Users/francis/d/IdeaProjects/product/packages/client/cypress/yarn:configurations/package.json:cypress/bin/cypress
Not found: /Users/francis/d/IdeaProjects/product/packages/client/cypress/yarn:configurations/package.json:cypress/bin/cypress
Not found: /Users/francis/d/IdeaProjects/product/packages/client/cypress/yarn:configurations/package.json:cypress/bin/cypress.js
Not found: /Users/francis/d/IdeaProjects/product/packages/client/cypress/yarn:configurations/package.json:cypress/bin/cypress.json
Not found: /Users/francis/d/IdeaProjects/product/packages/client/cypress/yarn:configurations/package.json:cypress/bin/cypress.node

    at Function.external_module_.Module._resolveFilename (/Users/francis/d/IdeaProjects/product/.pnp.cjs:45546:55)
    at Function.external_module_.Module._load (/Users/francis/d/IdeaProjects/product/.pnp.cjs:45345:48)
    at Function.moduleExports.runMain (/Users/francis/d/IdeaProjects/product/.pnp.cjs:45596:31)
    at internal/main/run_main_module.js:17:47

Process finished with exit code 1

It looks like the "node" string should not be there, as when I remove that it does appear to work.

I think this stopped working when I upgraded to 2022.1.

IntelliJ version information:

IntelliJ IDEA 2022.1 (Ultimate Edition)
Build #IU-221.5080.210, built on April 11, 2022
Licensed to Francis Upton IV
Subscription is active until March 14, 2023.
Runtime version: 11.0.14.1+1-b2043.25 x86_64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
macOS 12.3
GC: G1 Young Generation, G1 Old Generation
Memory: 10000M
Cores: 12
Registry:
    js.debugger.wip.log=/Users/francis/temp/wip.log
    js.debugger.webconsole=false

Non-Bundled Plugins:
    com.jetbrains.plugins.ini4idea (221.5080.126)
    com.jetbrains.ChooseRuntime (1.2)
    com.intellij.plugins.watcher (221.5080.126)
    org.asciidoctor.intellij.asciidoc (0.37.17)
    org.rust.lang (0.4.169.4584-221)
    mdx.js (1.0.221)
    intellij.prettierJS (221.5080.169)
    Pythonid (221.5080.212)
    R4Intellij (221.5080.41)
    me.mbolotov.cypress.pro (3.1)

Kotlin: 221-1.6.20-release-285-IJ5080.210

francisu avatar Jun 06 '22 20:06 francisu

Hi @francisu! Could you please share how you run configuration look like? image both general and runner tabs, please

mbolotov avatar Jun 08 '22 08:06 mbolotov

Here you go!

Screen Shot 2022-06-08 at 11 29 05 Screen Shot 2022-06-08 at 11 29 14 Screen Shot 2022-06-08 at 11 29 24 Screen Shot 2022-06-08 at 11 29 32

francisu avatar Jun 08 '22 18:06 francisu

hmm, this is pretty weird behavior. Unfortunately, I don't have macOS handy to reproduce the problem. I will probably try to setup it using a virtual machine. Meanwhile, you can play with parameters on the runner tab.

mbolotov avatar Jun 08 '22 19:06 mbolotov

I did try and play with the runner tab settings and could not get it to work.

Unrelated question: does this version support Cypress 10?

francisu avatar Jun 10 '22 22:06 francisu

No, it does not currently support Cypress 10. I'm now working on adding support for the new configuration file format. That will fix the ability to create run configurations from green arrows in the editor. Do you know any other problems with the plugin regarding Cypress 10?

mbolotov avatar Jun 11 '22 07:06 mbolotov

Do you know any other problems with the plugin regarding Cypress 10? No, I have not tried it at all.

Any progress on this issue?

francisu avatar Jul 06 '22 18:07 francisu

do you mean problem running a open-ct configuration? Unfortunately, no. I was busy with the 3.2 plugin version with the support of Cypress 10. I will probably look into this issue in a few days.

mbolotov avatar Jul 06 '22 19:07 mbolotov

I still don't know when I'll have time to setup MacOS in VM and look into the problem :(

mbolotov avatar Jul 15 '22 09:07 mbolotov

I'm still having this same problem with plugin version 3.5 and IntelliJ version 2022.2.3.

This statement is the problem:

/Users/francis/.nvm/versions/node/v16.16.0/bin/yarn node run cypress open-ct -b electron --config testFiles=**/AGGrid.spec.ts

If I change it to:

/Users/francis/.nvm/versions/node/v16.16.0/bin/yarn cypress open-ct -b electron --config testFiles=**/AGGrid.spec.ts

It runs fine.

Can you change it to remove the "node run" in the command line arguments (I'm using yarn version 3)?

francisu avatar Nov 20 '22 00:11 francisu

Is there anything I can do to help debug this so it can be fixed? This product does not work at all for me given this problem. If you are willing to provide the sources/development environment information, I'm happy to figure out the problem and find a solution.

francisu avatar Nov 29 '22 00:11 francisu

Hi @francisu! Sorry for the late answer, the github notifications was not delivered to my email for some reason. I will look into this ASAP

mbolotov avatar Dec 02 '22 14:12 mbolotov

Did you try running a configuration with a cleared package manager field? image

When this field is empty, plugin uses direct Cypress launch method which could work for your case.

mbolotov avatar Dec 05 '22 09:12 mbolotov

Did you try running a configuration with a cleared package manager field? image

When this field is empty, plugin uses direct Cypress launch method which could work for your case.

I tried it and it's a slightly different result, but still does not work.

/Users/francis/.nvm/versions/node/v16.16.0/bin/yarn node yarn:packages/client/package.json:cypress/bin/cypress open-ct -b electron --config testFiles=**/formValidation.spec.ts
/Users/francis/d/product/.pnp.cjs:45832
    throw firstError;
    ^

Error: Qualified path resolution failed - none of those files can be found on the disk.

Source path: /Users/francis/d/product/packages/client/yarn:packages/client/package.json:cypress/bin/cypress
Not found: /Users/francis/d/product/packages/client/yarn:packages/client/package.json:cypress/bin/cypress
Not found: /Users/francis/d/product/packages/client/yarn:packages/client/package.json:cypress/bin/cypress.js
Not found: /Users/francis/d/product/packages/client/yarn:packages/client/package.json:cypress/bin/cypress.json
Not found: /Users/francis/d/product/packages/client/yarn:packages/client/package.json:cypress/bin/cypress.node

    at Function.external_module_.Module._resolveFilename (/Users/francis/d/product/.pnp.cjs:45831:55)
    at Function.external_module_.Module._load (/Users/francis/d/product/.pnp.cjs:45630:48)
    at Function.moduleExports.runMain (/Users/francis/d/product/.pnp.cjs:45881:31)
    at node:internal/main/run_main_module:17:47

Process finished with exit code 1

This command works on the command line:

/Users/francis/.nvm/versions/node/v16.16.0/bin/yarn cypress open-ct -b electron --config testFiles='**/formValidation.spec.ts'

But I can't find a way to have the runner omit 'node' and also specify cypress as just 'cypress'.

francisu avatar Dec 05 '22 22:12 francisu

I've added some logging while the plugin is collecting the run parameters:

Cypress Support Pro-3.5.1-RUN-DEBUG.zip

Could you install this bundle and start your run configuration? It will show one (the most interesting) parameter as an exception: image

Other parameters will be show in the logs. Please show me at least the first one.

mbolotov avatar Dec 07 '22 18:12 mbolotov

I've added some logging while the plugin is collecting the run parameters:

Sorry it took so long to test this.

I have tried it with the version you provided. Here is the run configuration:

Screen Shot 2023-01-02 at 11 50 22

Here is the result from the console:

Screen Shot 2023-01-02 at 11 50 33

Here is the IntelliJ log that shows the run parameters from this run:

Screen Shot 2023-01-02 at 11 51 02

And (as above) here is the comparison of the command line provided by the plugin vs. the command line with "node" removed, showing the first fails, and the second succeeds:

Screen Shot 2023-01-02 at 11 51 39

Finally, attached is also a text file of the complete log since I started testing this today (with differences in the run configurations). I was only able to see the exception you added once, but could not reproduce it.

log.txt

The problem does not appear to be in the parameters you offer (according to the log), but in the fact that "node" is added after the specification of the yarn executable.

francisu avatar Jan 02 '23 20:01 francisu

The problem does not appear to be in the parameters you offer (according to the log), but in the fact that "node" is added after the specification of the yarn executable.

Yes, according to the logs, the plugin does not add any node parameter. It's probably added somewhere in the platform's code. I will try to figure it out.

mbolotov avatar Jan 03 '23 16:01 mbolotov

could you try this bundle: Cypress Support Pro-3.5.1-YARN-NO-NODE-WRAP.zip I've added a possible fix but I'm unable to verify it on my machine.

mbolotov avatar Jan 10 '23 11:01 mbolotov

could you try this bundle: Cypress Support Pro-3.5.1-YARN-NO-NODE-WRAP.zip I've added a possible fix but I'm unable to verify it on my machine.

YAY YAY YAY YAY YAY!!!!!

It works just fine.

Thank you so much!

francisu avatar Jan 11 '23 17:01 francisu

You could express your feelings at the plugin review page =)

mbolotov avatar Jan 11 '23 17:01 mbolotov

fixed in 3.6 version

mbolotov avatar Jan 13 '23 13:01 mbolotov