automation - 无法使用 Cypress 在 CK 编辑器中输入数据
问题描述
下面的解决方案一直工作到 chrome 版本 70,现在 70+ 我收到错误
CypressError: Timed out retrying: Expected to find element: 'p:eq(0)', but never found it. Queried from element: <body.cke_editable.cke_editable_themed.cke_contents_ltr>
现在停止工作的解决方案:
.then(function ($iframe) {
const $body = $iframe.contents().find('body')
cy
.wrap($body)
.find('p:eq(0)').type( "test", { force: true })
})
解决方案
您使用的是哪个版本的 CKEditor,您使用的是 javascript 框架吗?我们使用此命令在 Angular 应用程序中将文本输入到 CKEditor 实例中并获得预期结果:
cy.get('parent-element')
.find('[contenteditable=true]')
.type('text')
也许它有帮助。
推荐阅读
- php - 组合字母数字时如何选择真值?
- java - 在 Intellij (Linux - VM) 中创建 Maven 项目时出错
- spring - 无法使用spring hibernate在broswer上显示数据。下面是我的代码和输出
- python - 将亚马逊美食评论数据集从 kaggle 加载到 colab 笔记本中
- powershell - 如何将特定的 WMIobject 驱动程序解析为字符串?
- python - 使用烧瓶服务器时从 html 写入 python 文件的更改
- c# - 如何强制验证 UserControl?
- asp.net - 尽管视图模型已更新,但在 POST 后视图未更新
- elasticsearch - 添加任何自定义实体后的 jHipter Elasticsearch 问题
- docker-compose - NGINX 反向代理不适用于其他 docker 容器