Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

149
Vistas
How to focus button in CSS class by JavaScript

I have problem, how to focus to CSS style by Jquery and JavaScript. I have this code:

   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',
            )
          })

Original CSS from web is in this picture:

CSS from web page

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

You can do something like this:

cy.get('#dxToolbarMenu')
  .find('.dx-item.dx-menu-item.dx-menu-item-has-text.dx-menu-item-has-icon')

You can also add focus() to focus on the Element.

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()
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda