Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Protractor test that an element is empty

<div id='messagesDiv'></div>

I want to test that this div element is empty.

var messagesDiv = element(by.id('messagesDiv'));
expect(messagesDiv).to...

How would I achieve that?

like image 250
Yorkshireman Avatar asked Oct 11 '15 20:10

Yorkshireman


1 Answers

I think this:

expect(messagesDiv.getText()).toBe('');

should do the trick. More information here.

like image 102
jeerbl Avatar answered Nov 15 '22 13:11

jeerbl