mardi 28 février 2017

Matching a text having line breaks with another String

I am trying to get text from a popup message and then compare it with another string to check whether or not both are same.

Pop-up Screen

enter image description here

Testing Code

var text = element(by.css('.modal.fade.AppLockPopup.in'));
//expect(text.getText()).toEqual("Warning" + "\n" + " You haven't saved your changes.Are "+ "\n" +" you sure you want to discard your changes? "+ "\n" +" Yes No");
expect(text.getText()).toEqual("Warning You haven't saved your changes.Are you sure you want to discard your changes? Yes No");

Current Output (Fails)

enter image description here

How do I compare these strings?

Aucun commentaire:

Enregistrer un commentaire