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

141
Visualizações
Click on button until new card is up

so I'm back with the question again:) I previously asked similar one but this one a bit tricky for me. so I want to make a specific card visible after clicking on next button in the carousel and stop clicking after that specific card becomes visible, here is the code I have but when executed it shows that that specific card is visible but it won't stop clicking next button. Probably my mistake is chilling but I'm learning and will get better:) thank you guys !

cy.get('.carouselCards').find('.1stCard').each(($el, index, $list) => {
      const cardText =  $el.find('.cardTitle').text()
        if(cardText.includes('specific name of the card I'm looking for')) {
            cy.wrap($el).should('be.visible')
        } else { cy.get ('.carouselButton').click()
            
        }
    })
about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

You can break the loop in Cypress by returning false. Please try below

    cy.get('.carouselCards').find('.1stCard').each(($el, index, $list) => {
      const cardText =  $el.find('.cardTitle').text()
        if(cardText.includes('specific name of the card I'm looking for')) {
            cy.wrap($el).should('be.visible');
            return false;
        } else { 
            cy.get ('.carouselButton').click();
        }
    })
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