我有一些代码尝试捕获 iframe 内的元素,但我只是不断返回错误
it('Send Medication',function(){
cy.get('.aut-iframe')
.should(iframe => expect(iframe.contents().find('body')).to.exist)
.then(iframe => cy.wrap(iframe.contents().find('body')))
.within({}, $iframe => {
cy.get('.pending-medication-check-box').click({force:true})
Run Code Online (Sandbox Code Playgroud)
这是我得到的错误:
最后,这是 iframe 信息:
javascript iframe cypress cypress-component-test-runner cypress-iframe