Correct problem with partial matches
This commit is contained in:
parent
ac357b8e11
commit
ae48b83ded
|
@ -84,7 +84,7 @@ module Capybara
|
|||
|
||||
def add_field(locator)
|
||||
xpath = append(yield(s(locator)))
|
||||
xpath.append(yield("//label[contains(.,#{s(locator)})]/@for"))
|
||||
xpath = xpath.append(yield("//label[contains(.,#{s(locator)})]/@for"))
|
||||
xpath.prepend(yield("//label[text()=#{s(locator)}]/@for"))
|
||||
end
|
||||
|
||||
|
|
|
@ -2,8 +2,10 @@
|
|||
|
||||
<form action="/form" method="post">
|
||||
<p>
|
||||
<label for="form_first_name">First Name</label>
|
||||
<input type="text" name="form[first_name]" value="John" id="form_first_name"/>
|
||||
<label for="form_first_name">
|
||||
First Name
|
||||
<input type="text" name="form[first_name]" value="John" id="form_first_name"/>
|
||||
</label>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
|
|
Loading…
Reference in New Issue