I am currently trying to get into protractor (because our automation framework is not really that awesome when it comes to angular ;)), and have now run into an interesting issue: I get the message "TypeError: Cannot call method 'waitForAngular' of undefined" in my 2nd describe block for no really apparent reason to me.
The (stripped down) code I am running can be found here, along with a stacktrace: https://gist.github.com/FrankyBoy/8675399e2236e8235e79
Any help appreciated because I am thoroughly confused.
The beforeEach functions only run before it functions, and not before describe functions. So the call to ptor = protractor.getInstance() just hasn't happened by the time you're trying to use the ptor object.
I suspect to fix this, you'll need to move the waitForAngular call into an it function, as follows:
describe('Bonus landing page', function () {
it('should wait', function() {
ptor.waitForAngular(); // dies with "Cannot call method 'waitForAngular' of undefined"
// more checks were here, but it also works like this
});
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With