# Cypress > title: 'and | Cypress Documentation' --- # Cypress Documentation # Source: https://raw.githubusercontent.com/cypress-io/cypress-documentation/main/docs/api/commands/and.mdx # Path: docs/api/commands/and.mdx --- title: 'and | Cypress Documentation' description: 'Create an assertion. Assertions are automatically retried as part of the previous command until they pass or time out.' sidebar_label: and slug: /api/commands/and --- # and Create an assertion. Assertions are automatically retried as part of the previous command until they pass or time out. :::info An alias of [`.should()`](/api/commands/should) ::: :::info **Note:** `.and()` assumes you are already familiar with core concepts such as [assertions](/app/core-concepts/introduction-to-cypress#Assertions) ::: ## Syntax ```javascript .and(chainers) .and(chainers, value) .and(chainers, method, value) .and(callbackFn) ``` ### Usage **Correct Usage** ```javascript cy.get('.err').should('be.empty').and('be.hidden') // Assert '.err' is empty & hidden cy.contains('Login').and('be.visible') // Assert el is visible cy.wrap({ foo: 'bar' }) .should('have.property', 'foo') // Assert 'foo' property exists .and('eq', 'bar') // Assert 'foo' property is 'bar' ``` **Incorrect Usage** ```javascript cy.and('eq', '42') // Can not be chained off 'cy' cy.get('button').click().and('be.focused') // Should not be chained off // action commands that may update the DOM ``` ### Arguments **chainers _(String)_** Any valid chainer that comes from [Chai](/app/references/assertions#Chai) or [Chai-jQuery](/app/references/assertions#Chai-jQuery) or [Sinon-Chai](/app/references/assertions#Sinon-Chai). **value _(String)_** Value to assert against chainer. **method _(String)_** A method to be called on the chainer. **callbackFn _(Function)_** Pass a function that can have any number of explicit assertions within it. Whatever was passed to the function is what is yielded. - In most cases, `.and()` yields the same subject it was given. - `.and()` is an assertion, and it is _safe_ to chain further commands that use the subject. ```javascript cy.get('nav') // yields