jasmine - how to get the text of bootstrap alert message for testing with protractor -
this spec
it('should save edited majorobject', function () { var description = element(by.id('objectdescription')); description.clear(); description.sendkeys('edited'); var add = element(by.id('saveobject')); add.click().then(function () { expect(element(by.css('.alert-success')).isdisplayed()).tobe(true); expect(element(by.css('.alert-success')).totext()).tobe("saved successfully"); }) });
i used
expect(element(by.css('.alert-success')).totext()).tobe("saved successfully");
but showing undefined , alternative way this?
you meant use gettext()
instead of totext()
:
expect(element(by.css('.alert-success')).gettext()).tobe("saved successfully");
Comments
Post a Comment