zoukankan      html  css  js  c++  java
  • Cypress web自动化10-Navigation 导航功能(go,reload,visit)

    前言

    web页面上的导航功能,上一页,下一页,重新加载页面,直接访问页面。

    cy.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')
    

    cy.reload()

    不使用检测,重新加载页面

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

    cy.visit()

    直接通过 url 地址访问页面

    cy.visit('https://example.cypress.io/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
      }
    })
    
  • 相关阅读:
    存储引擎-Buffered tree
    存储引擎-Bitcast
    飞锐GIS开发基础系列
    arcgisserver
    综​合​管​网​方​案​说​明
    Leaflet交流
    .NET开源工程推荐(Accord,AForge,Emgu CV)
    GIS科研站
    C语言I博客作业008
    预习原码补码
  • 原文地址:https://www.cnblogs.com/yoyoketang/p/12877370.html
Copyright © 2011-2022 走看看