Closed
Description
Current behavior
I was following along with the installation instructions from cypress/schematic for "ng new" project
Then I decided to add a custom command however cypress throws the error: "cy.login is not a function"
-
To add a custom command I wrote the following code in the
commands.ts
file
Cypress.Commands.add("login", () => { cy.log('login...') })
-
Added it to the namespace
declare namespace Cypress { interface Chainable<Subject = any> { login(): any; } }
-
Uncommented this line
import './commands';
in thee2e.ts
file -
Used
cy.login()
in thespec.cy.ts
file
Desired behavior
Cypress should not throw the error "cy.login is not a function"
Test code to reproduce
https://github.com/yurakhomitsky/cypress-angular-schematic-issue
Cypress Version
12.2.0
Node version
16.15.0
Operating System
macOS 13.0.1
Debug Logs
No response
Other
No response
Metadata
Metadata
Assignees
Labels
No labels