90poe / vscode-cy-helper

VS Code IDE Extension for Cypress.io

Home Page:https://marketplace.visualstudio.com/items?itemName=Shelex.vscode-cy-helper

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

I have more than one custom commands files, how to make Cypress: Go to custom command definition feature work?

Zuthen opened this issue · comments

Hi,
I'm using many custom commands in many js files in my project - when I choosing option "Cypress: Go to custom command definition" nothing happens.
I suppouse that may be caused by:

  • my custom commands deffinition files are named different than 'commands.js'
  • there are more than one custom commands file in my project

Is there any solution for my problem?

Hello.
The place of custom command usage does not matter - it is trying to find where Cypress.Commands.add was called for this command.
Extension has only configuration for custom command detection:
cypressHelper.customCommandsFolder. In case you are using Cypress.commands.add outside support folder, you can configure it as "cypressHelper.customCommandsFolder": "cypress" and it will find commands inside all files of cypress folder. In case it not help - please share your cypress.json file.
Also, may it be the case you have no/renamed cypress folder, or it is located not in workspace root, like myFolder/tests/cypress?