javascript - 无法从自动完成赛普拉斯中选择
问题描述
it('Test to grab the autocomplete values', ()=> {
cy.visit('https://jqueryui.com/autocomplete/');
cy.get('#tags').type('c')
cy.get('#ui-id-2').first().click()
})
})
它显示它被点击但它没有被选中
解决方案
你的代码基本没问题,但是需要在iframe
cy.visit('https://jqueryui.com/autocomplete/')
cy.get('iframe.demo-frame')
.its('0.contentDocument.body')
.within(() => {
cy.get('#tags').type('c')
cy.get('#ui-id-2').first().click()
cy.get('#tags').should('have.value', 'ActionScript')
})
推荐阅读
- python - 如何获取关键字元素之间的python列表中的所有元素?
- symfony - Symfony phpredis 客户端应该兼容 redis
- amazon-web-services - 如何为多个用户管理 EC2 密钥对?
- javascript - 我如何知道弹出窗口何时打开?
- jmx - 绑定名称 weblogic.management.home.localhome 无法在 weblogic 12c 控制台中看到
- docker - Docker 无法创建 nginx
- c# - VS 2019 发布构建成功,MSBuild 失败
- macos - 当我尝试在我正在开发的应用程序的 iOS 模拟器上运行我的颤振代码时,我得到 ERROR RUNNING POD INSTALL
- android-videoview - 当网络出现问题或其他错误时如何使用 vimeo 播放器而不显示链接
- amazon-web-services - 应用程序负载均衡器 - 运行状况检查失败并出现以下代码:[301]