add-cypress-custom-command-in-typescript icon indicating copy to clipboard operation
add-cypress-custom-command-in-typescript copied to clipboard

Testing how new Cypress commands are added in TypeScript

Build Status renovate-app badge

To add TypeScript support to Cypress

  • npm i -D @bahmutov/add-typescript-to-cypress
  • add tsconfig.json
  • start using TypeScript in your cypress/integration/spec.ts
  • you can write custom Cypress commands in TypeScript, see example in cypress/support/commands.ts to add custom commands.

Screenshots

  • passing tests that exercise custom commands

test

  • VSCode IntelliSense correctly shows cy.foo() docs

IntelliSense

Problems

If you hit a problem, please open an issue either in this repo or in cypress-io/cypress with reproducible source code. The best issues are the ones we can "git clone ...", install dependencies and run to see the problem. This ensures we can fix it quicker.

Additional information