https://cypress.io logo
Problem with custom commands with typescript
# i-need-help
s
Hi everyone, I am trying to use custom_commands with typescript and cucumber configuration, when i change the supportFile: "./cypress/support/e2e.ts" the execution get stuck in the loading phase (see screenshot). however when i set it to supportFile: false, i get the message loginToWimoQa is not a function. you can see also in the screenshots my test, e2e.ts and index.d.ts. thank you

https://cdn.discordapp.com/attachments/1104064720341844039/1104064720530591824/image.png

https://cdn.discordapp.com/attachments/1104064720341844039/1104064720861925476/image.png

https://cdn.discordapp.com/attachments/1104064720341844039/1104064721142956052/image.png

https://cdn.discordapp.com/attachments/1104064720341844039/1104064721675636867/image.png

https://cdn.discordapp.com/attachments/1104064720341844039/1104064721948250152/image.png

m
Hi @silly-lawyer-32382 If you have an
e2e.ts
then probably you should have a `commands.ts`to match and not a
commands.js
.
s
Hello @many-airline-45402 thank you for you response, i change it to commands.ts still facing the same issue
m
Which issue do you still have? 1) Execution gets stuck or 2) loginToWimoQa is not a function?
s
both in fact the first one when i set supportFile to false and the second when i set it to : "./cypress/support/e2e.ts"
i did some things to solve this problem (I don't necessarily understand the link between what i did and the problem that i had), first i deleted the commands.ts file and created a new one called testCom.ts and added (import './testCom') to the e2e.ts file, second i deleted the import 'cypress-plugin-steps' from the e2e.ts file and now it's working ( I hope it's not magic)