Daria
Daria

Reputation: 276

Get value of input for testing

I am trying to write simple e2e test, using angular, karma and protractor. I figure out that I can get the text from some element using getText() but I can't find the right way to get the value of input. The sample of my code below:

this.page =  $('.content-area');
this.userEmail = this.page.element(by.css('.email > input'));

this.expectHomeEmail = function(text) {
            expect(this.userEmail.isDisplayed()).toBeTrue();
            expect(this.userEmail.getValue()).toBe(text);
};

The error that I get looks like:

Thanks a lot!

Upvotes: 3

Views: 2879

Answers (1)

Magus
Magus

Reputation: 15124

Try this :

this.userEmail.getAttribute('value')

Upvotes: 3

Related Questions