Skip to content

Files

Latest commit

 

History

History

fundamentals__add-custom-command-ts

add custom command in TypeScript

Write your own Cypress commands using TypeScript

In this recipe we do not use tsconfig.json file, thus we need to specify additional command types using /// <reference ...> commands, like this:

// cypress/e2e/spec.ts
/// <reference path="../support/index.d.ts" />

IntelliSense for custom command cy.dataCy

See cypress/support/e2e.ts and cypress/support/index.d.ts.