filiphric / cypress-plugin-api

Cypress plugin to show your API information in the Cypress UI runner
ISC License
264 stars 35 forks source link

cy.api is not a function #119

Closed chelsea-designs closed 1 year ago

chelsea-designs commented 1 year ago

Good Morning,

I've tried to add the plugin but I'm getting 'cy.api is not a function'.

Steps I've taken:

image vs image

Any help gratefully received?

filiphric commented 1 year ago

this is strange. it seems like you have done everything right and yet cypress does not recognize the command, have you tried adding your own custom command to e2e.ts and see if it’s found by your test? I could imagine that the support file is somehow not being loaded, maybe check your cypress.config.ts file

chelsea-designs commented 1 year ago

Thanks for your reply. Yes you were right, the supportFile in cypress.config.ts was pointing to index.ts so I've added import 'cypress-plugin-api' to that file instead which worked. Thanks for your help :)