/* * MIT License * * Copyright (c) 2020-present Cloudogu GmbH and Contributors * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ /// 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 expect(typeof contentWindow === 'object').to.be.true }, onLoad (contentWindow) { // contentWindow is the remote page's window object expect(typeof contentWindow === 'object').to.be.true }, }) }) })