I\'m using Protractor JS. And the site is written in Angular JS.
So I have a toggle switch. And I noticed the value in the toggle switch goes from true to false and
isDisplayed() did not work for me. The API may have been changed. isPresent() is my solution:
isDisplayed()
isPresent()
var logoutButton = element(by.css('[ng-click="log_out()"]')); logoutButton.isPresent().then(function(result) { if ( result ) { logoutButton.click(); } else { //do nothing } });