Skip to content
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

cy.get() does not accept a DOM element #2759

Closed
alexkrolick opened this issue Nov 12, 2018 · 1 comment
Closed

cy.get() does not accept a DOM element #2759

alexkrolick opened this issue Nov 12, 2018 · 1 comment
Labels
stage: wontfix Cypress does not regard this as an issue or will not implement this feature

Comments

@alexkrolick
Copy link

Current behavior:

cy.get() accepts string selectors but not actual DOM node references

Desired behavior:

cy.get seems to be based on jQuery, which accepts a DOM element and returns it wrapped: https://codepen.io/alexkrolick/pen/dQprqX?editors=0011

It may not be idiomatic for some reason but it seems like if a valid reference has been obtained, it should be usable.

Steps to reproduce:

Versions

3.1.1

@chrisbreiding
Copy link
Contributor

cy.get() only accepts a selector string, so that it can re-query for that selector as part of retrying the command chain. While it is related to jQuery, it does not mimic its signature exactly or all of its features. You can use cy.wrap() to wrap a DOM element reference instead.

@jennifer-shehane jennifer-shehane added the stage: wontfix Cypress does not regard this as an issue or will not implement this feature label Nov 15, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stage: wontfix Cypress does not regard this as an issue or will not implement this feature
Projects
None yet
Development

No branches or pull requests

3 participants