mercredi 27 mai 2015

return of getText() cannot be compared to a string

I am using a following code to compare 2 strings in one of protractor/jasmine test cases.

emailnotsentmessage.getText().then(function(text) {
          expect(text).toBe('has not received notification about recent changes to the meeting.');
        });

where emailnotsentmessage contains following text

[ 'has not received notification about recent changes to the meeting.' ]

for some reason , the string comparison fails . those two strings contains absolute same content. i checked it several times . am i missing something here ?. the emailnotsentmessage is a content of a <span> .

error trace

1) Get to the existing meeting by navigating to the edit meeting page should display the same value which was entered du
ring create meeting when go into edit meeting
  Message:
    Expected [ 'has not received notification about recent changes to the meeting.' ] to equal 'has not received notific
ation about recent changes to the meeting.'.
  Stack:
    Error: Failed expectation

Aucun commentaire:

Enregistrer un commentaire