Skip to content

docs: Add best practices for element interaction patterns and command chaining #6242

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

ziad404
Copy link

@ziad404 ziad404 commented Aug 10, 2025

closes #6189

Copy link

netlify bot commented Aug 10, 2025

👷 Deploy request for cypress-docs pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 364846a

@CLAassistant
Copy link

CLAassistant commented Aug 10, 2025

CLA assistant check
All committers have signed the CLA.

@cypress-app-bot
Copy link
Collaborator

@ziad404 ziad404 changed the title Add best practices for element interaction patterns and command chaining docs:Add best practices for element interaction patterns and command chaining Aug 10, 2025
@ziad404 ziad404 changed the title docs:Add best practices for element interaction patterns and command chaining docs: Add best practices for element interaction patterns and command chaining Aug 10, 2025
Comment on lines +1069 to +1081
```js
describe('form interaction', () => {
it('updates input field correctly', () => {
cy.get('[data-cy="email-input"]')
.should('be.visible')
.focus()
.clear()
.type('[email protected]')
.should('have.value', '[email protected]')
.blur()
})
})
```
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This proposed addition to the documentation contradicts other information about chaining.

The example code does not follow the rules set out in Actions should be at the end of chains, not the middle

and the "unsafe to chain" comments in:

Copy link
Contributor

@MikeMcC399 MikeMcC399 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ziad404

I added a comment about chaining, although I don't have the background to comment on your complete documentation section. The chaining part would need to be revised in order to be correct.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Best practice - then() usage vs chained commands
4 participants