cypress with typescript

The solution for “cypress with typescript” can be found here. The following code will assist you in solving the problem.

yarn add –dev typescript

// tsconfig.json
“compilerOptions”: {
“target”: “es5”,
“lib”: [“es5”, “dom”],
“types”: [“cypress”]
“include”: [“**/*.ts”]


Cypress.Commands.add(‘dataCy’, (value) => {
return cy.get(`[data-cy=${value}]`)

Thank you for using DeclareCode; We hope you were able to resolve the issue.

More questions on [categories-list]

inline scripts encapsulated in