How can protractor.ExpectedConditions be extended in Protractor?
I tried a similar approach to how ElementFinder is extended:
function myFunction(elementFinder){
function clientScript(e){
return someCondition(e);
}
return () => browser.executeScript(clientScript, elementFinder.getWebElement());
}
protractor.ExpectedConditions.prototype.myFunction = myFunction;
but it fails with:
"E/launcher - Error: TypeError: Cannot set property 'myFunction' of undefined"
I did notice that by assigning protractor.ExpectedConditions.myFunction it seems to work but is that safe to do?