Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

197
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda