# Navigation

Examples of navigating to pages within your application in Cypress, for a full reference of commands, go to docs.cypress.io

#### cy.go()

To go back or forward in the browser's history, use the `cy.go()` command.

    cy.location().its('pathname').should('include', 'navigation')

      // https://on.cypress.io/api/go
      cy.go('back')
      cy.location().its('pathname').should('not.include', 'navigation')

      cy.go('forward')
      cy.location().its('pathname').should('include', 'navigation')

      // equivalent to clicking back
      cy.go(-1)
      cy.location().its('pathname').should('not.include', 'navigation')

      // equivalent to clicking forward
      cy.go(1)
      cy.location().its('pathname').should('include', 'navigation')

#### cy.reload()

To reload the page, use the `cy.reload()` command.

    cy.reload()

    // reload the page without using the cache
    cy.reload(true)

#### cy.visit()

To visit a remote page, use the `cy.visit()` command.

    // Visit any url
    cy.visit('https://www.google.com')

    // Pass options to the visit
    cy.visit('http://localhost:8080/commands/navigation', {
      timeout: 50000, // increase total time for the visit to resolve
      onBeforeLoad: function(contentWindow){
        // contentWindow is the remote page's window object
      },
      onLoad: function(contentWindow){
        // contentWindow is the remote page's window object
      }
    })

    // serve your files. The path should be relative
    // to your project's root folder.
    cy.visit("index.html")