I\'m beginner in the e2e testing and have a problem. When I do login - I make redirect from login.php to index.php page. But my test is fails with following errors:
OK, I have resolved this issue by myself, but not sure why element and browser don't work. I have changed
expect(element(by.css('body')).getText()).toContain('Welcome Test User');
to
expect(browser.driver.findElement(by.css('body')).getText()).toContain('Welcome Test User');
So I have changed element to browser.driver.findElement and everything works.
I don't know why it happens, but it works :)
UPD
As I understand, browser.driver.findElement - is not angular way and we should use it if we use non-angular pages. Although I use angular it seems that element and browser doesn't re-initialize. Some info I found here http://engineering.wingify.com/posts/angularapp-e2e-testing-with-protractor/#test-both-angularjs-and-non-angularjs-based-pages