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

new open-ct configuration won't run in IntelliJ 2022.1 and 2022.2 #92

Closed francisu closed 1 year ago

francisu commented 2 years ago

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

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

francisu commented 2 years ago

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

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.

francisu commented 2 years ago

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?

mbolotov commented 2 years ago

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?

francisu commented 2 years ago

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?

mbolotov commented 2 years ago

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

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

francisu commented 2 years ago

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 commented 1 year ago

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.

mbolotov commented 1 year ago

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 commented 1 year ago

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.

francisu commented 1 year ago

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'.

mbolotov commented 1 year ago

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.

francisu commented 1 year ago

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.

mbolotov commented 1 year ago

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 commented 1 year ago

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.

francisu commented 1 year ago

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!

mbolotov commented 1 year ago

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

mbolotov commented 1 year ago

fixed in 3.6 version