Sha256: f140a4ccc0fff9017a361994a525fc05bd1f29f02bff0d69375b07ebb25d6ee5

Contents?: true

Size: 1.45 KB

Versions: 20

Compression:

Stored size: 1.45 KB

Contents

/// <reference types="Cypress" />

context('Navigation', () => {
  beforeEach(() => {
    cy.visit('https://example.cypress.io')
    cy.get('.navbar-nav').contains('Commands').click()
    cy.get('.dropdown-menu').contains('Navigation').click()
  })

  it('cy.go() - go back or forward in the browser\'s history', () => {
    // https://on.cypress.io/go

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

    cy.go('back')
    cy.location('pathname').should('not.include', 'navigation')

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

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

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

  it('cy.reload() - reload the page', () => {
    // https://on.cypress.io/reload
    cy.reload()

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

  it('cy.visit() - visit a remote url', () => {
    // https://on.cypress.io/visit

    // Visit any sub-domain of your current domain

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

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
cypress-on-rails-1.12.1 lib/generators/cypress_on_rails/templates/spec/cypress/integration/examples/navigation.spec.js
cypress-on-rails-1.12.0 lib/generators/cypress_on_rails/templates/spec/cypress/integration/examples/navigation.spec.js
cypress-on-rails-1.11.0 lib/generators/cypress_on_rails/templates/spec/cypress/integration/examples/navigation.spec.js
cypress-on-rails-1.10.1 lib/generators/cypress_on_rails/templates/spec/cypress/integration/examples/navigation.spec.js
cypress-on-rails-1.9.1 lib/generators/cypress_on_rails/templates/spec/cypress/integration/examples/navigation.spec.js
cypress-on-rails-1.9.0 lib/generators/cypress_on_rails/templates/spec/cypress/integration/examples/navigation.spec.js
cypress-on-rails-1.8.1 lib/generators/cypress_on_rails/templates/spec/cypress/integration/examples/navigation.spec.js
cypress-on-rails-1.8.0 lib/generators/cypress_on_rails/templates/spec/cypress/integration/examples/navigation.spec.js
cypress-on-rails-1.7.0 lib/generators/cypress_on_rails/templates/spec/cypress/integration/examples/navigation.spec.js
cypress-on-rails-1.6.0 lib/generators/cypress_on_rails/templates/spec/cypress/integration/examples/navigation.spec.js
cypress-on-rails-1.5.1 lib/generators/cypress_on_rails/templates/spec/cypress/integration/examples/navigation.spec.js
cypress-on-rails-1.5.0 lib/generators/cypress_on_rails/templates/spec/cypress/integration/examples/navigation.spec.js
cypress-on-rails-1.4.2 lib/generators/cypress_on_rails/templates/spec/cypress/integration/examples/navigation.spec.js
cypress-on-rails-1.4.1 lib/generators/cypress_on_rails/templates/spec/cypress/integration/examples/navigation.spec.js
cypress-on-rails-1.4.0 lib/generators/cypress_on_rails/templates/spec/cypress/integration/examples/navigation.spec.js
cypress-on-rails-1.3.0 lib/generators/cypress_dev/templates/spec/cypress/integration/examples/navigation.spec.js
cypress-on-rails-1.2.1 lib/generators/cypress_dev/templates/spec/cypress/integration/examples/navigation.spec.js
cypress-on-rails-1.2.0 lib/generators/cypress_dev/templates/spec/cypress/integration/examples/navigation.spec.js
cypress-on-rails-1.1.1 lib/generators/cypress_dev/templates/spec/cypress/integration/examples/navigation.spec.js
cypress-on-rails-1.1.0 lib/generators/cypress_dev/templates/spec/cypress/integration/examples/navigation.spec.js