kuceb / cypress-plugin-retries

A Cypress plugin to retry failed tests.
MIT License
237 stars 20 forks source link

plugin fails with "Cypress is not defined" when using Typescript #43

Closed gumieniakm closed 4 years ago

gumieniakm commented 4 years ago

After installing plugin in a project that uses Cypress e2e tests written in Typescript, Cypress fails with "ReferenceError: Cypress is not defined" in /lib/support.js:3:15 image

Steps to reproduce: ng new angular-test - empty app ng add @briebug/cypress-schematic - schematic that installs Typescript support install cypress-plugin-retries using readme steps: npm install -D cypress-plugin-retries and add require('cypress-plugin-retries') to index.js npx cypress open fails

I tried adding "cypress-plugin-retries" in compilerOptions -> types in cypress/tsconfig.json but no avail.

I see has index.d.ts in package lib files, but I can't get it to work - is there something I'm missing? Thanks in advance.

kuceb commented 4 years ago

This isn't a typescript error, notice "ReferenceError" and the stack trace.

I believe you've misconfigured the plugin, make sure you require the plugin in the "cypress/support" folder and follow the optional installation instructions after that.