-
-
Notifications
You must be signed in to change notification settings - Fork 65
Description
I'm using Nextjs & cypress.
I have a contact form with captcha startMode: "focus". When all fields are filled in and the user is verfied as not being a robot, the submit button is enabled. I want to make sure this works with my cypress tests.
In a browser, if any of the input fields get focus, the captcha check is kicked off. Works great!
However, in Cypress, I set up an intercept to always return 'success'. But, the captcha api call is never kicked off.
I've seen the issue #189
The solution to force the button to be enabled does not allow me to check that the form is working correctly. What I want to do is two tests:
- make sure the button is enabled when all fields are correctly filled in and the intercept returns 'success'
- make sure the button remains disabled when all fields are correctly filled in and the intercept returns 'fail'
Forcing the button to be enabled/disabled is not really testing the validation functionality nor response from the api.
Is there a better solution?