Access element whose parent is hidden - cypress.io

前端 未结 6 1338
悲哀的现实
悲哀的现实 2020-12-17 10:38

The question is as given in the title, ie, to access element whose parent is hidden. The problem is that, as per the cypress.io docs :

An element is

6条回答
  •  北荒
    北荒 (楼主)
    2020-12-17 11:14

    From the docs, Cypress select syntax, the syntax is

    cy.get('mdc-select-item').select('ITEM1')
    

    You may need the {force: true} as well. See here select_spec.coffee for examples of their own tests, e.g

    it "can forcibly click even when element is invisible", (done) ->
      select = cy.$$("select:first").hide()
      select.click -> done()
      cy.get("select:first").select("de_dust2", {force: true})
    

提交回复
热议问题