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

172
Visualizações
extract text with the same name used multiple times

What i want is to check that "ZZ" is showing in the table row considering that i can have other rows with the same "ZZ" in the same cell name.

i have done this so far:

 cy.contains('tr', 'abc...')
            .parent()
            .within(()=> {
                cy.get('td.v-cell').should('have.text', 'ZZ')
        })

I am getting: expected [ <td.v-cell>, 19 more... ] to have text ZZ, but the text was 20%20%5%0%20%-0-20%-20%-ZZ

I have this html: https://i.stack.imgur.com/k224U.png

How do i verify the text even if the text can appear in other rows as well..Also if i change ZZ to 20% it should be getting error as the text is ZZ.

Thank you

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

Instead if have.text you can use include.text something like:

cy.get('td.v-cell').should('include.text', 'ZZ')

Assuming abc is a td element, you can do like this:

cy.contains('td', 'abc...')
  .parent()
  .within(() => {
    cy.get('td.v-cell').should('include.text', 'ZZ')
  })

Again assuming that the tr you want to go is the immediate next:

cy.contains('td', 'abc...')
  .parent('tr')
  .next()
  .within(() => {
    cy.get('td.v-cell').should('include.text', 'ZZ')
  })
about 4 years ago · Juan Pablo Isaza Relatório
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