Grails geb对redactor textarea的功能测试
我试图在redctor文本字段中输入文本以测试geb的功能测试。但我无法这样做,因为textarea是不可见的。当它是简单的html文本字段时,我可以通过个人{$personalStatement.valuehi我在这里}但在本例中,它不起作用。我在testspec中使用了类似于以下的personalStatement=我在这里但没有工作Grails geb对redactor textarea的功能测试,grails,spock,geb,Grails,Spock,Geb,我试图在redctor文本字段中输入文本以测试geb的功能测试。但我无法这样做,因为textarea是不可见的。当它是简单的html文本字段时,我可以通过个人{$personalStatement.valuehi我在这里}但在本例中,它不起作用。我在testspec中使用了类似于以下的personalStatement=我在这里但没有工作 <div class="redactor_redactor_content_cv redactor_ui-wizard-content redactor
<div class="redactor_redactor_content_cv redactor_ui-wizard-content redactor_editor"
contenteditable="true" dir="ltr" style="min-height: 200px;"> <p></p> </div> <textarea
id="personalStatement" class="redactor_content_cv ui-wizard-content" width="98%"
height="100px" name="personalStatement" dir="ltr" style="display: none;"> </textarea>
使用send keys方法在textarea中输入值 $personalStatement.firstElement.SendKeyTest如果它真的起作用,我会感到惊讶。Geb和Selenium与UI交互。在这里,您可以有效地模拟用户在一个不可见字段中键入内容,这是不应该做的。我怀疑在使用Geb与字段交互之前,您必须使用js.exec或一些聪明的CSS技巧来秘密显示字段。