Cypress doesn't see custom cy. commands #18876
TayoOtegbayo
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Please all,
I have a test which does not recognize my custom command:
index.js content:
import './commands.js'
Here is my command.js content:
Cypress.Commands.add('login',(usrname, password) => {
cy.clearCookies()
cy.clearLocalStorage()
cy.visit(' https://something.com/login') // Launch the URL
cy.get('#client_id').type('[email protected]') //Enter the email
cy.get('#password').type('Pkkkw0rd') //Enter the password
cy.get('form > :nth-child(3) > .styles__StyledButton-sc-1mfj3x4-0').click() //Click the login button
cy.wait(6000) //App wait for 5s
})
here is my test file.js
///
describe('The first scenario', function(){
the cy.login is not working, the error I'm getting is 'Property 'login' does not exist on type 'cy & EventEmitter'
kindly help please
Beta Was this translation helpful? Give feedback.
All reactions