Skip to content

Latest commit

 

History

History
 
 

fundamentals__add-custom-command-ts

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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/integration/spec.ts
/// <reference path="../support/index.d.ts" />

IntelliSense for custom command cy.dataCy

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