# Waiting

Examples of waiting for an amount of time or resource to resolve in Cypress, for a full reference of commands, go to docs.cypress.io

#### cy.wait()

To wait for a specific amount of time or resource to resolve, use the `cy.wait()` command.

    cy.get('.wait-input1').type('Wait 1000ms after typing')
    cy.wait(1000)
    cy.get('.wait-input2').type('Wait 1000ms after typing')
    cy.wait(1000)
    cy.get('.wait-input3').type('Wait 1000ms after typing')
    cy.wait(1000)

    // Listen to GET to comments/1
    cy.intercept('GET', '**/comments/*').as('getComment')

    // we have code that gets a comment when
    // the button is clicked in scripts.js
    cy.get('.network-btn').click()

    // wait for GET comments/1
    cy.wait('@getComment').its('response.statusCode').should('be.oneOf', [200, 304])

More information:

- Asserting Network Calls from Cypress Tests blog post
- Unit testing application code recipe
- Avoid hard-coded waits using built-in retry-ability