如何填写代码验收测试的富文本编辑器字段 [英] How to fill a rich text editor field for a Codeception Acceptance test

查看:577
本文介绍了如何填写代码验收测试的富文本编辑器字段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在Codeception的验收测试中填写一个富文本编辑器字段(TinyMCE)。

I'm trying to fill a rich text editor field (TinyMCE) within my acceptance test in Codeception.

使用 fillField()函数不起作用,因为'field'不是真正的输入字段。这是一个 iframe ,样式看起来像一个花哨的文本区域。

Using the fillField() function doesn't work as this 'field' isn't really an input field. It's an iframe, styled to look like a fancy textarea.

如何设置一些文本到TinyMCE盒?我想我正在寻找一个 $ I-> setContent(xpathOrCSS)函数。

How can I set some text into the body of the TinyMCE box? I think I'm looking for the addition of a $I->setContent(xpathOrCSS) function. Or does something else already exist to do this?

推荐答案

最佳方式:

$I->executeJS('$("#selector").val("Value")');

这篇关于如何填写代码验收测试的富文本编辑器字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆