Tengo un problema, cómo enfocarme en el estilo CSS de Jquery y JavaScript. tengo este codigo:
it('Add new group', () => { cy.waitForInitLoad(); cy.get('#dxToolbarMenu').then(($el) => { expect($el[0].className).to.equal( 'dx-item dx-menu-item dx-menu-item-has-text dx-menu-item-has-icon', ) })El CSS original de la web está en esta imagen:
Puedes hacer algo como esto:
cy.get('#dxToolbarMenu') .find('.dx-item.dx-menu-item.dx-menu-item-has-text.dx-menu-item-has-icon') También puede agregar focus() para enfocarse en el Elemento.
cy.get('#dxToolbarMenu') .find('.dx-item.dx-menu-item.dx-menu-item-has-text.dx-menu-item-has-icon') .first() //In case of multiple elements with the same selector consider take the first one .focus()