<div id='messagesDiv'></div>
I want to check that this div element is empty.
div
var messagesDiv = element(by.id('messagesDiv')); expect(messagesDiv).to...
How do I achieve this?
I think:
expect(messagesDiv.getText()).toBe('');
gotta do the trick. More details here .
Try
expect (messagesDiv.text).toBe('')
expect(messagesDiv.getText()).toMatch(/^\s*$/); will handle spaces, tabs, line breaks, etc. that HTML treats as empty, but may actually not be in raw HTML.
expect(messagesDiv.getText()).toMatch(/^\s*$/);
Source: https://habr.com/ru/post/1233479/More articles:passing a parameter using ngroute - javascriptCSS Animate text from left to right in an overflow div container hidden - cssHow to execute commands with double quotes (net start "search windows") using ps "os" module? - pythonFunctional C ++ card combinator using auto - c ++Call a hapi route from another route - javascriptSpring Data Elasticsearch @Document indexName defined at runtime - spring-bootRegular expression for extracting operands from mathematical expressions - javaInject Spel parameter in annotation parameter (for example, what was done with @Value in the field) - javaIs it nice to store the number of lines and the number of lines to speed pagination? - mysqlTomcat: status code 404 at the request of each application - javaAll Articles