-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Refactor custom command rules, remove undocumented cy.chain
#465
Comments
Warning displays on use of
|
Hopefully this can be resolved soon and we can switch to the new command API. In the meantime, can someone spot the problem with the code below? So this works: cy.get('body')
.find('.Select-control input')
.first()
.type('Some text') This sadly does not work: Cypress.addChildCommand('findReactSelect', (subject) => {
cy
.chain()
.wrap(subject)
.find('.Select-control input')
.first()
});
cy.get('body')
.findReactSelect()
.type('Some text') //CypressError: Subject is null. You cannot call cy.type() without a subject. |
The code for this is done, but this has yet to be released. We'll update this issue and reference the changelog when it's released. |
It is so weird that i cannot fork and adopt features early. I wonder what is holding you back to have the tool open sourced already. |
Fixed in |
I'm not sure I am doing this right... I use Cypress 3.1.0 but I cannot get it to work with either wrap or chain (which is logical since chain is deprecated and removed). Im trying to select a piece of subdom (from the shadow dom in this case): Cypress.Commands.add('shadowdom', {
prevSubject: true
}, (subject, query) => {
const result = shadowDomSelector(subject.get(0), query);
return result;
}); But I always get the following error: (In this case chaining it to .contains) I've been reading the documentation for about half a day, but cannot seem to find a proper solution. |
Currently there is an undocumented
cy.chain
command that is necessary to get chaining to work correctly.The reasoning for this is fairly complex and has to do with internal rules in Cypress for determining
parent
,child
, anddual
commands and is a side effect of a peculiar implementation detail.We need to simplify this entire API, the rules surrounding it, and make things "just work" the way it appears to work.
To do:
cy.chain
Related to #463, #436, #435, #198
These examples should "just work"
The text was updated successfully, but these errors were encountered: