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

192
Vistas
How to invoke text of a div properly on cypress

I'm having troubles with the invoke('text') of this div and I don't know why:

<div class="MuiDataGrid-cell MuiDataGrid-cell--textLeft" role="cell" data-field="description" data-colindex="2" aria-colindex="3" tabindex="-1" style="min-width: 234px; max-width: 234px; min-height: 36px; max-height: 36px; line-height: 35px;">TEXT</div>

My code is this:

cy.get('[data-rowindex="0"]').find('[data-field="description"]').invoke('text').then(text => {
            cy.get('.css-1e8jzdq').eq(1).find('input').type(text)
        })

What I want it to take the text of the div and use it to type into a search input but it doesn't work because cy.type() cannot accept an empty string. You need to actually type something.

I don't know what I'm missing with this invoke... any help?

about 4 years ago · Juan Pablo Isaza
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