Closed navdeepdevrepublic closed 2 years ago
The error says that your task is returning undefined, which definitely doesn't look right - you show it returning a Promise
, which seems correct.
My steps to troubleshoot would be to start simple - with a task that returns a string. If that's working, then a promise that resolves to a string. Add in the pupeteer code bit by bit until you figure out what exactly is going wrong.
That's all common debugging advice, because the code above isn't quite enough for me to reproduce the issue - I don't happen to have a site with hcatcha enabled. If you can provide a sample repository I can run, I'd be happy to look into it more, but beyond that I can only offer the above tips to help debug the problem yourself. It's probably something simple and obvious that we're both just being blind to.
@navdeepdevrepublic, we are beginning to implement a policy to close non-reproducible issues within 7 days of inactivity. Unfortunately, if we cannot reproduce an issue there isn't a whole lot that we can do, and in an effort to keep our issue backlog manageable we will be closing the issue.
Current behavior
It displays the hCaptcha page and the one has to manually resolve the hCaptcha with images in order to proceed.
Desired behavior
In this situation, Cypress should have any workaround or third party integration so that this hCaptcha should get handled.
Test code to reproduce
I have tried opening the page with Puppeteer (Integration with Cypress), it worked well however I had trouble sending the token back to the cypress spec file.
Note: Regarding the hCaptcha integration with cypress, I have followed the below links https://www.npmjs.com/package/puppeteer-hcaptcha https://github.com/aw1875/puppeteer-hcaptcha/blob/master/demos/solve.js https://www.techtonic.com/puppeteer-can-fill-in-cypress-gaps/ https://jsoverson.medium.com/bypassing-captchas-with-headless-chrome-93f294518337
Below is the code:
I am installing the 'puppeteer hCaptcha' through npm and the code is as below: File :- cypress.config.js
The spec file is login.cy.js
Cypress Version
10.3.0
Other
package.json