Closed perochowa closed 4 years ago
Have posted update v0.2.9 where fixed issue with extension activation when cypress is used without cucumber - could you please install it and verify commands are now available?
In case issue still exist could you please provide information about:
cypress.json
file content (maybe you have custom folders setup)
And ways to reproduce your issue: is it called from command palette
or via editor menu
, some example repository.
Thanks.I just installed this extension on my VS Code and I got the same issue: Custom command not found
cypress.json
Cypress: Go to Custom Command Definition
@Maximus1285 So, let me explain where Custom command not found
is thrown:
So could you please provide info about:
Cypress.Commands.add('command', () => {})
?${workspaceRoot}/${customCommandsFolderConfiguration}
For example:
workspaceRoot = "/Users/Shelex/repos/vscode-cy-helper"
customCommandsFolder = "cypress/support"
It will look for your custom commands created in /Users/Shelex/repos/vscode-cy-helper/cypress/support
folder.
So questions:
cypressHelper.customCommandsFolder
extension config?Thank you!
@Shelex Here's the info you requested:
Line where you are experiencing error
Cypress.Commands.add('command', () => {})
cypress/support/commands.js
cypressHelper.customCommandsFolder
is the default one because I haven't changed it, which is cypress/support
is cypress folder located right in workspace?
I don't understand what you mean by this question@Maximus1285 Thank you for response!
I'm not quite sure to understand what you need when you ask for
Line where you are experiencing error
.
I mean text located on line where you are calling 'go to custom command definition'.
For example: cy.command1().command2().then(()=>
is cypress folder located right in workspace?
I don't understand what you mean by this question
You have current open folder in vscode.
Example: /Users/Shelex/repos/vscode-cy-helper
And is cypress located in cypress
folder right in opened project or you have nested structure?
Example of nested structure:
Opened project: /Users/Shelex/repos/vscode-cy-helper
Cypress folder: testing/e2e/cypress
@Shelex thank you for your clarification!
I mean text located on line where you are calling 'go to custom command definition'.
The line where I experience the issue is cy.visitPage(urls.investigation);
And yes, cypress folder is located right in workspace
@Maximus1285 Hmm, weird. Checked it on: MacOS 10.14.6 & VS Code: 1.40.1 Fresh-installed plugin with basic repo: https://github.com/Shelex/cypress_basic With exact line in test you have mentioned and default cypress setup. And extension works well.
Could you please also try example repo and how extension work there?
@Shelex I just tested it using cypress_basic repo and it still didn't work Watch this video
@Maximus1285 Thanks!
And is there any error trace in View => Terminal => Output tab => Select 'Log (Extension Host)'
?
@Shelex No, nothing shows up in View => Terminal => Output tab
@Maximus1285 Okay, another idea is to check other extensions if they manipulate configuration or file system. Could you please provide list of your installed extensions?
@Maximus1285 By the way, upgraded extension to 0.3.2 with fix for global dependencies issue for one of my colleagues. As it looks similar to yours (unable to open custom command definition) could you please upgrade to v0.3.2 and check if your issue still reproduces.
I've also struggling some problems with go custom command definition
There is also problem w generating types definition, because command is not found. It worked on my project only once...
Tested on version v.0.3.5
@joszo
Cypress.Commands.add
?go to definition
?@Shelex
do you have specific folder for integration files or custom commands on cypress.json?
The structure for my project is like the default one from cypress.
I've created package.json
{
"devDependencies": {
"cypress": "3.7.0",
"cypress-xpath": "1.4.0"
}
}
Then npm i
and next npx cypress open
- the default structure was created.
After that I've delete example folder, and added my test.spec.js
in integration folder.
Are commands created with Cypress.Commands.add?
Yes in commands.js
:
Cypress.Commands.add('visitGoogle', () => { cy.visit('https://google.com') })
`Cypress.Commands.add("visitGoogle", () => { cy.visit('https://google.com') })
I've tried with one quote and double quotes.
Could you please provide text of line where you are calling go to definition?
What do you mean by that?
Could you please check if extension is working for some basic setup?
I will check it tomorrow :)
Probably I found a clue - when I disabled all my extensions, and enable Cypress helper than go to definition
and generated types
started to work. If you want I can share you my extensions which I have installed.
@joszo yes, please.
Hmm strange, I've deleted some of unused extensions, then I started to enabling all extensions and for now everything is working.
I will monitor it - maybe process from another extensions blocked it...
@joszo Anyway, could you please provide your installed extensions list.
You can do it by executing command on binary of vscode:
MacOs : "/Users/shelex/Applications/Visual Studio Code.app/Contents/Resources/app/bin/code" --list-extensions
Windows: "c:\Program Files\Microsoft VS Code\bin\" --list-extensions
andrew-codes.cypress-snippets
angelomollame.conflict-squeezer
CoenraadS.bracket-pair-colorizer
dracula-theme.theme-dracula
esbenp.prettier-vscode
k--kato.intellij-idea-keybindings
paulhoughton.vscode-jscpd
PKief.material-icon-theme
remimarsal.prettier-now
rexebin.dracula
ritwickdey.LiveServer
shd101wyy.markdown-preview-enhanced
Shelex.vscode-cy-helper
streetsidesoftware.code-spell-checker
waderyan.gitblame
WallabyJs.quokka-vscode
wayou.vscode-todo-highlight
For a months was checking extension behaviour with all listed above installed and found nothing strange. Btw, there is a bunch of issues reported to VS Code (https://github.com/microsoft/vscode/issues/80165, https://github.com/microsoft/vscode/issues/79782) regarding ActivationHost failures on startup. As I see it is similar to experiences we had here. Closing this issue for now. Feel free to reopen in case you have issue of such kind.
I'm having the same issue. I get this error when i tell it to go to definition... or when I tell it to generate type info. I've tried disabling all of my other extensions and the other things mentioned in this issue, no luck. (It's possible my problem is because I'm using commands.ts and not commands.js, though?)
I'm having the same issue. I get this error when i tell it to go to definition... or when I tell it to generate type info. I've tried disabling all of my other extensions and the other things mentioned in this issue, no luck. (It's possible my problem is because I'm using commands.ts and not commands.js, though?)
Hey @FFdhorkin ! Sorry for late reply. You are right - extension even don't check typescript files. However, since cypress 4.4.0 typescript works out-of-box so I will consider adding support for ts too.
@FFdhorkin In extension version 0.6.0 typescript support was added.
Cool, thanks for making sure I saw!
Hi! I would very much like to be able to utilize the 'Go to Custom Command Definition' option but I can't seem to get it to work.
After installing it, I get the error in the picture. I've tried uninstalling/installing it multiple times and even tried older versions but I get the same error.
Would you know what else I can try? Thanks in advance!