Skip to content

Commit

Permalink
Apply disabled to all methods of locating fields
Browse files Browse the repository at this point in the history
  • Loading branch information
jnicklas committed Sep 9, 2012
1 parent a8f970d commit ee35f7b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/xpath/html.rb
Expand Up @@ -167,8 +167,9 @@ def definition_description(locator)
protected

def locate_field(xpath, locator)
locate_field = xpath[~attr(:disabled)][attr(:id).equals(locator) | attr(:name).equals(locator) | attr(:placeholder).equals(locator) | attr(:id).equals(anywhere(:label)[string.n.contains(locator)].attr(:for))]
locate_field = xpath[attr(:id).equals(locator) | attr(:name).equals(locator) | attr(:placeholder).equals(locator) | attr(:id).equals(anywhere(:label)[string.n.contains(locator)].attr(:for))]
locate_field += descendant(:label)[string.n.contains(locator)].descendant(xpath)
locate_field[~attr(:disabled)]
end
end
end

0 comments on commit ee35f7b

Please sign in to comment.