-
Notifications
You must be signed in to change notification settings - Fork 1.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
docs: add example to expand the usage of the get method #5469
Changes from all commits
1244040
bc28c32
7bfdc97
46a1bb8
46c1f4f
a0208be
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -143,6 +143,12 @@ cy.get('form').within(() => { | |||||
}) | ||||||
``` | ||||||
|
||||||
#### Find an anchor element by its label/text, remove some attribute and click it | ||||||
|
||||||
```javascript | ||||||
cy.get('a', { name: 'My link text' }).invoke('removeAttr', 'target').click(); | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The syntax here is not correct - it looks like a mix of Cypress and Testing Library syntax, the following would work though:
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If the example is changed from |
||||||
``` | ||||||
|
||||||
### Get vs Find | ||||||
|
||||||
The `cy.get` command always starts its search from the | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be good to an add explanation of why this is useful. Something like: