cypress icon indicating copy to clipboard operation
cypress copied to clipboard

Click on submit form does not recognize HTTP 302 response code

Open AngeloBadellino opened this issue 1 year ago • 1 comments

Current behavior

When attempting to automate a login using Auth0's Universal Login, the automation fails to execute the click on the submit button, preventing the completion of the process.

On a live environment the user input the username and click on the form submit. The click triggers a POST that return a 302 response. Then the user can see the password field and conclude the login by performing another click on the submit button.

During the cypress e2e run the first submit seems to be performed since the password field become visible, but the test timeout after 60 second while waiting for the page to be loaded.

image

Desired behavior

On submit click Cypress should recognize the response code returned after posting the form and continue the login process.

Test code to reproduce

The described behavior can be seen by cloning and running the following repo.

Its enough to run npm install and npm run serve and then open cypress to run the only test,

https://github.com/AngeloBadellino/cypress_auth0

Cypress Version

13.8.1

Node version

v18.20.2

Operating System

Windows 10 enterpsice 19045.4291

Debug Logs

No response

Other

No response

AngeloBadellino avatar May 08 '24 10:05 AngeloBadellino

I had a similar behavior in one of my internal application and I managed to found out what was going on : Location response header value has http:// and it seems that Cypress refuses to load the page (which may be an expected behavior, I guess).

Of course, I'm not telling that it is the same issue but it is worth to check your Location header value ?

bsdmon avatar Aug 21 '24 13:08 bsdmon

Running the test under HTTPS make cypress correctly intercept the responses from the external domain. Thanks!

AngeloBadellino avatar Sep 06 '24 11:09 AngeloBadellino