我将以下代码作为 .erb 文件:
<div class="gridster">
<form>
    <fieldset>
        <legend>Add Repository</legend>
        <div class="field">
          <label for="gitrepoURL">GitHub URL</label>
      <input type="url" name="GithubRepo" id="gitrepoURL" placeholder="http://github.com/<organization>/<repo>" required/>
        </div>
        <div class="field">
          <input type="button" name="Add" id="add" value="Add Repository" class="add" />
        </div>
    </fieldset>
</div>
在一个黄瓜单元测试用例中,我写道:
When /^I update the input field with a github url $/ do
  visit '/github/index' 
  fill_in "field[GithubRepo]", :with => "http://github.com/name1/name2"
end
我知道我使用不正确的 dom 来访问 GithubRepo。我尝试在 firebug 中查找以正确访问 GithubRepo 字段以填充 url,但不能,当使用 cucumber 运行测试用例时,它说
When(/^I update the input field with a github url$/) do
  pending # express the regexp above with the code you wish you had
end
并停止执行低于此测试用例的测试用例。让我知道我的理解是否错误。如果我是对的,请告诉我如何访问 dom 元素,以便我可以使用它来访问其他元素并编写其他测试用例