I am facing an issue with my protractor/jasmine test code where it only prints out 1 and 2, then hangs and times out.
It seems like there might be a problem with the click() action on the button element or the promise on the getTitle method of the browser object, or maybe both.
Does anyone have a solution for this or a more efficient way to achieve what I'm trying to do?
Code:
it('should allow successful login', function() {
browser.get('http://192.168.0.100/src/');
browser.waitForAngular();
var titlePromise = browser.getTitle();
titlePromise.then(function(text){
console.log("1**************", text);
});
var titlePromise = browser.getTitle();
titlePromise.then(function(text){
console.log("2**************", text);
});
element.all(by.model('credentials.username')).first().sendKeys('foo');
element.all(by.model('credentials.password')).first().sendKeys('bar');
var loginBtn = element.all(by.cssContainingText('.btn', 'Login')).first();
loginBtn.click();
browser.sleep(5000);
var titlePromise = browser.getTitle();
titlePromise.then(function(text){
console.log("3**************", text);
});
});
});
Error:
Error: Timed out waiting for Protractor to synchronize with the page after 11 seconds. Please see https://github.com/angular/protractor/blob/master/docs/faq.md