Skip to content

Clarify usage for commands marked as unsafe to chain further commands #6185

Closed
@rsi21

Description

@rsi21

Description

Hi,

I wanted some more information about commands indicating that:

**It is [unsafe](https://docs.cypress.io/app/core-concepts/retry-ability#Only-queries-are-retried) to chain further commands that rely on the subject after ...**

There are several commands in this case like:

  • type()
  • focus()
  • blur()
  • check()
  • ...

Does it mean these kind of commands must not be chained at all with any other command ? (except for assertions)

I ask that because at the same time they are often code samples showing chaining with these kind of commands like:

  1. here a case with 2 of themn chained:
    https://docs.cypress.io/api/commands/focus#Focus-type-and-blur-a-textarea
    cy.get('textarea').focus().type('Nice Product!').blur()

  2. here with a type() followed by a blur():
    https://docs.cypress.io/api/commands/blur#Blur-the-comment-input
    cy.get('[name="comment"]').type('Nice Product!').blur()

Thanks

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions