-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Chaining is broken when reusing same options object in .type()
command
#365
Comments
If I try freezing the options object, it throws an error "TypeError: Cannot read property 'is' of undefined". const dontLog = Object.freeze({log: false})
cy
.visit(url)
.get('[name=email]', dontLog).clear().type(email, dontLog)
.get('[name=password]', dontLog).clear().type(password, dontLog) |
Yah we are internally mutating those objects which makes sense why this fails. Probably should not be doing that, should clone them first. Curious why you can't use |
this is a custom login command, which includes CSRF token. You probably want to use at least |
I see. You can still use Here's an example. https://github.com/cypress-io/cypress-example-recipes#logging-in---csrf-tokens |
of course, I saw that example yesterday :) But it a lot flakier than going through UI :) |
How's it flakier? It should be much less flakier and much faster. |
Here is a good one (Cypress 0.18.4)
This works
This does not work (enters the password in the email field instead
The above code is inside custom command
Cypress.addParentCommand('login') {...}
I am attaching the video (without clicking submit so it stops and shows the problem)
The text was updated successfully, but these errors were encountered: