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

138
Vistas
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 Respuestas
Responde la pregunta

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 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