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

163
Vistas
¿Es posible hacer una prueba semiautomática en Cypress que implique resolver recaptcha manualmente?

Sé que, de acuerdo con las mejores prácticas de Cypress , se recomienda no probar aplicaciones de terceros que no estén bajo nuestro control, pero como futuro evaluador, estoy afirmando mi autoridad al hacerlo de todos modos.

Entonces, solo quería probar el procedimiento log in y la respuesta POST con el estado 200 para esta página en particular , así que escribí el siguiente caso de prueba aquí:

 describe('Log in and Log out Tests', () => { it('Log in Test', () => { /// Go to 'https://bandcamp.com/' cy.visit('https://bandcamp.com/') /// Get the 'log in' element and click it cy.get("[class='log-in-link']").click() /// Assert the log in page is 'https://bandcamp.com/login' cy.url().should('include', '/login') /// Set up the API variable, in this case the url was '**/login_cb' cy.intercept('POST', '**/login_cb').as('POSTresponse') /// Get the 'Username/email' textbox and type the email then verifies such textbox contains the previous cy.get('[name="username-field"]').type('xxxx@outlook.com') .should('have.value', 'xxxx@outlook.com') /// Get the 'Password' textbox and type the password cy.get('[name="password-field"]').type('xyz') .should('have.value', 'xyz') /// Click the 'Log in' button cy.get('#loginform > div.buttons > button').click() /// Here comes the human tester that kills the reCaptcha manually IF NEEDED /// /// Now wait for the POSTresponse variable cy.wait('@POSTresponse') /// Print the value of POSTresponse variable as a JQuery object cy.get('@POSTresponse').then( XHR => { console.log(XHR) // Check that the status code is equal to 200 (success) expect(XHR.response.statusCode).to.equal(200) }) }) })

La cuestión es que, al ejecutar la prueba automatizada anterior, dicha página a veces lanza un reCaptcha para resolverlo, a veces no, por lo que me gustaría saber si hay alguna forma de agregar una excepción if/else para tal evento donde la prueba literalmente espera hasta que el reCaptcha se resuelva manualmente (por mí), para luego ejecutar el resto del código.

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Abajo

Aquí viene el probador humano que mata el reCaptcha manualmente SI ES NECESARIO

insertar

 cy.intercept('POST' , 'https://www.google.com/recaptcha/*').as('googleCaptcha') cy.wait('@googleCaptcha').its('response.statusCode').should('eq', 200)
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