Reputation: 13
I am developing the e2e test suite for one of my applications. We have a sso that is a non angular site, our site is an angular site. in the start of my test i make a call to SSO settings:
browser.ignoreSynchronization = true;
browser.get(browser.baseUrl + '/agoda/home?mock=mock-jax);
I am able to log on sucessfully and it redirects to my application which is an angular site. I set browser.ignoreSynchronization = false; as soon as i redirect to my application and its loaded. After this nothing works.
I try to read following:
var books= element.all(by.repeater('book in books'));
console.log(licenses.count());
results into
{ ptor_:
{ controlFlow: [Function],
schedule: [Function],
setFileDetector: [Function],
getSession: [Function],
getCapabilities: [Function],
quit: [Function],
actions: [Function],
touchActions: [Function],
executeScript: [Function],
executeAsyncScript: [Function],
call: [Function],
wait: [Function],
sleep: [Function],
getWindowHandle: [Function],
getAllWindowHandles: [Function],
getPageSource: [Function],
close: [Function],
getCurrentUrl: [Function],
getTitle: [Function],
findElementInternal_: [Function],
findDomElement_: [Function],
findElementsInternal_: [Function],
takeScreenshot: [Function],
..
}
I believe this has something to do with the ignoreSynchronization but not sure what i am doing wrong?
Upvotes: 0
Views: 312
Reputation: 6962
You are not catching the promise that the count()
function returns as a callback after its execution. Protractor is built on WebDriverJs model of async with promises. It has nothing to do with your ignoreSynchronization
and you are console logging a protractor instance object instead of its value. You need to console log the value that is returned through the promise. Here's how -
var books= element.all(by.repeater('book in books'));
books.count().then(function(booksCount){
console.log(booksCount);
});
The above way of using .then()
in above code should solve your problem. More about promises. Hope it helps.
Upvotes: 1