Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

169
Views
¿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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!