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

165
Vistas
Is it possible to do a semi-automated test on Cypress that involves solving recaptcha manually?

I know that according to Cypress Best Practices it's recommended to not test 3rd party apps which are not under one's control, but as a a future tester, I'm asserting my authority by doing so anyway!

So I just wanted to test the log in procedure and POST response with status 200 for this particular page, so I wrote the following test case here:

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

    })

})  

The thing is, when executing the automated test above, such page sometimes throws a reCaptcha to solve it, sometimes it doesn't, so I would like to know if there's a way to add an if/else exception for such event where the test just literally waits until that reCaptcha gets solved manually (by me), for then executing the rest of code.

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

0

Below

Here comes the human tester that kills the reCaptcha manually IF NEEDED

insert

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