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

Commit

Permalink
Explicitly remove newlines from getText() (#3618)
Browse files Browse the repository at this point in the history
MSEdge does not properly remove newlines, which causes false negatives when using `textToBePresentInElement()`
  • Loading branch information
Evan Jacobs authored and heathkit committed Oct 6, 2016
1 parent f36e981 commit 5cef1bf
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/expectedConditions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,8 @@ export class ProtractorExpectedConditions {
Function {
var hasText = () => {
return elementFinder.getText().then((actualText: string): boolean => {
return actualText.indexOf(text) > -1;
// MSEdge does not properly remove newlines, which causes false negatives
return actualText.replace(/\r?\n|\r/g, '').indexOf(text) > -1;
});
};
return this.and(this.presenceOf(elementFinder), hasText);
Expand Down

0 comments on commit 5cef1bf

Please sign in to comment.