When I execute the statements without using promises, it just returns a promise.
Like the following does not work:
devices = element.all(devicesRepeater)
expect(devices.length).toEqual factories.devices.length
But promise style works:
element.all(devicesRepeater).then (devices)->
expect(devices.length).toEqual factories.devices.length
But its shown in the protractor API that it should resolve e.g.: http://angular.github.io/protractor/#/api?view=ProtractorBy.prototype.
// Returns a promise that resolves to an array var
rows = element.all(by.repeater('cat in pets'))
Same is true for waiting and all. Like in the following question, waiting blocks and then the expect call works:
How can I wait for a condition?
Whereas in my project, I have to put all the logic inside the promise callback block.
Should I write a then block for each of them or is there a way to block until promise resolves.