Open m-gug opened 1 year ago
@m-gug good catch! You should NOT chain off of clear()
I would suggest you do something like this instead:
cy.get('textarea').clear()
cy.get('textarea').type('Hello, World')
This also needs fixing for https://docs.cypress.io/api/commands/clear#Usage
@jennifer-shehane
If @jaffrepaul is no longer available, perhaps you could re-assign or remove the assignment?
Open to a PR for this.
Subject
chaining after .clear()
Description
The documentation (and the linting) says, that it is unsafe to chain commands after .clear(). https://docs.cypress.io/api/commands/clear#__docusaurus_skipToContent_fallback
But the same documentation has an example (https://docs.cypress.io/api/commands/clear#No-Args) where it chains a .type() command after the .clear(), which is a little confusing and inconsistent.
Is it safe to chain a type after a clear?