Skip to content
This repository has been archived by the owner on Jul 29, 2024. It is now read-only.

Commit

Permalink
fix(locators): findind elements by text should trim whitespace
Browse files Browse the repository at this point in the history
WebDriver always trims whitespace from around the text of an element, so to be
consistent we should trim the text from button elements before doing
a by.buttonText.

Closes #903, Closes #904.
  • Loading branch information
juliemr committed Jun 23, 2014
1 parent 6906c93 commit bf26f76
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/clientsidescripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ functions.findByButtonText = function(searchText, using) {
} else {
elementText = element.value;
}
if (elementText === searchText) {
if (elementText.trim() === searchText) {
matches.push(element);
}
}
Expand Down

0 comments on commit bf26f76

Please sign in to comment.