gpt4 book ai didi

rspec - Rails/rspec fill_in 使用占位符

转载 作者:行者123 更新时间:2023-12-01 23:08:04 24 4
gpt4 key购买 nike

在我的 rspec 测试中,如何使用占位符填写文本字段。我无法使用 id 和 name,因为它们是为嵌套表单自动生成的。

<input class="input-medium inline" id="user_kids_attributes_new_1342116887461_first_name" name="user[kids_attributes][new_1342116887461][first_name]" placeholder="First Name" size="30" type="text">

谢谢

最佳答案

还有另一种方法:

fill_in :placeholder => "Fill in some text", :with => "Text"

关于rspec - Rails/rspec fill_in 使用占位符,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11458726/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com