You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
At the moment, our Cypress custom commands don't get autocomplete and typehints in VSCode.
The commands are not recognized by the ide, to pick a command developer has to manually search by exact command names in the project.
Describe the solution you'd like
Generate a index.d.ts file and autoupdate it on save with the help of CypressHelper VSCode extension (which is recommended by Cypress docs).
This will only require installing CypressHelper to VSCode and updating .vscode/settings.json with
and adding /// <reference types="../../support/index.d.ts" /> to a file to enable hints
This simple update will not require us to rewrite all tests to typescript, but this will make VSCode recognise latest list of commands and offer them to the developer in dropdown menus (todo: drop a gif with demo).
Describe alternatives you've considered
No response
Additional context
A separate task is providing definitions to commands in custom plugins inside cypress/plugins. Cypress Helper can autogenerate type definitions but it requires one custom commands folder. So extra effort is needed to additionally maintain type definitions for plugins. I've already filed an issue to Cypress Helper support team, but in the meantime we have some options to get type definitions:
Manually maintain a cypress/plugins/index.d.ts with typed cy.task's as suggested here
Write a script to autogenerate those typedefs, could be done using existing logic from Cypress Helper iself. The script can be run e.g. in a .husky pre-commit
The text was updated successfully, but these errors were encountered:
Actions before raising this issue
Is your feature request related to a problem? Please describe.
At the moment, our Cypress custom commands don't get autocomplete and typehints in VSCode.
The commands are not recognized by the ide, to pick a command developer has to manually search by exact command names in the project.
Describe the solution you'd like
Generate a
index.d.ts
file and autoupdate it on save with the help ofCypressHelper
VSCode extension (which is recommended by Cypress docs).This will only require installing CypressHelper to VSCode and updating
.vscode/settings.json
withand adding
/// <reference types="../../support/index.d.ts" />
to a file to enable hintsThis simple update will not require us to rewrite all tests to
typescript
, but this will make VSCode recognise latest list of commands and offer them to the developer in dropdown menus (todo: drop a gif with demo).Describe alternatives you've considered
No response
Additional context
A separate task is providing definitions to commands in custom plugins inside
cypress/plugins
. Cypress Helper can autogenerate type definitions but it requires one custom commands folder. So extra effort is needed to additionally maintain type definitions for plugins. I've already filed an issue to Cypress Helper support team, but in the meantime we have some options to get type definitions:cypress/plugins/index.d.ts
with typedcy.task
's as suggested here.husky
pre-commitThe text was updated successfully, but these errors were encountered: