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

Popular posts from this blog

android - Gradle sync Error:Configuration with name 'default' not found -

java - Andrioid studio start fail: Fatal error initializing 'null' -

html - jQuery UI Sortable - Remove placeholder after item is dropped -