Fixed failing tests so input[@type='button'] can now be found via the value of the 'alt' attribute

This commit is contained in:
Bodaniel Jeanes 2010-02-25 15:36:57 +10:00
parent 125478fe26
commit ffe2a89d38
1 changed files with 1 additions and 0 deletions

View File

@ -80,6 +80,7 @@ module Capybara
xpath = append("//input[@type='submit' or @type='image' or @type='button'][@id=#{s(locator)} or contains(@value,#{s(locator)})]")
xpath = xpath.append("//button[@id=#{s(locator)} or contains(@value,#{s(locator)}) or contains(.,#{s(locator)})]")
xpath = xpath.prepend("//input[@type='submit' or @type='image' or @type='button'][@value=#{s(locator)}]")
xpath = xpath.prepend("//input[@type='image'][@alt=#{s(locator)} or contains(@alt,#{s(locator)})]")
xpath = xpath.prepend("//button[@value=#{s(locator)} or text()=#{s(locator)}]")
end