Recently, we've upgraded to Protractor 4.0.0 and our tests started to fail immediately with:
Error: TypeError: Cannot read property 'prototype' of undefined
Failing in onPrepare()
on the following line:
protractor.ElementArrayFinder.prototype.takewhile = function(whileFn) {
// ...
};
Here we are extending ElementArrayFinder
to support takewhile
function.
Looks like protractor.ElementArrayFinder
is now undefined.
How should we be extending ElementArrayFinder
in Protractor 4?
I don't see anything related in the breaking changes in the changelog.
Issue tracker link: Cannot read property 'prototype' of undefined (Protractor 4 upgrade problem).