代码之家  ›  专栏  ›  技术社区  ›  soccerway

如何使用Cypress.io测试Google地图上标记的显示?

  •  0
  • soccerway  · 技术社区  · 6 年前

    我不知道用什么方法来查找Google地图上显示的标记。

    describe('Display of marker on Google map', function(){
      it.only('Check the display of marker on Google map', function(){
      cy.visit('https://www.google.co.nz/maps/@-36.9139788,174.8740846,15z?hl=en')
        cy.get('#searchboxinput').type('gold coast')
         //don't know how to select Gold Coast from the populated search items
        //How to find a marker displayed on Google Map ?
      })
    })
    
    1 回复  |  直到 6 年前
        1
  •  0
  •   jmargolisvt    6 年前

    According to the docs ,这是反模式:

    Also from the docs ,这可能是您从衍生页面获取信息的最佳选择:

    cy.visit('index.html').then((contentWindow) => {
      // contentWindow is the remote page's window object
    })