When I run the tests in local they work perfectly. I did the push to my pipeline and now it doesn't work and this error appears.
This is the error I'm having in my pipeline
TypeError: cy.login is not a function
Because this error occurred during abefore each
hook we are skipping the remaining tests in the current suite
It looks like a Typescript error, although you are using .js
extensions and not .ts
. If Gitlab is applying the type checking, try to define the type of the cy.login()
custom command.
Here is the doumentation Types for Custom Commands
// cypress/support/index.ts
declare global {
namespace Cypress {
interface Chainable {
login(username: string, password: string): Chainable<any>
}
}
}