mercredi 26 février 2020

How can I hover over an element then click using Cypress

I want to hover over the "My Account" button and the click the "Login" button opened popup. I have tried the below code but it did not work. Does anyone know a way to handle this situation? Thanks,

 Cypress.Commands.add('loginol', (email, password) => { 
     cy.get('#myAccount').click()
     cy.get('#myAccount').trigger('mouseover')
     cy.wait(3000)
     cy.get('#login').click()
     cy.get('#email').type(email)
     cy.get('#password').type(password)
     cy.get('.btn.full.btn-login-submit').click()

 })

I have uploaded the pictures in case it helps:

"Giriş Yap(My Account)" Button

After it is hovered below "Giriş Yap(Login)" Button

Website I'm working on: https://www.hepsiburada.com/

Aucun commentaire:

Enregistrer un commentaire