Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
constructor(webdriverInstance, opt_baseUrl, opt_rootElement, opt_untrackOutstandingTimeouts, opt_blockingProxyUrl) {
super();
// These functions should delegate to the webdriver instance, but should
// wait for Angular to sync up before performing the action. This does not
// include functions which are overridden by protractor below.
let methodsToSync = ['getCurrentUrl', 'getPageSource', 'getTitle'];
let extendWDInstance;
try {
extendWDInstance = webdriver_js_extender_1.extend(webdriverInstance);
}
catch (e) {
// Probably not a driver that can be extended (e.g. gotten using
// `directConnect: true` in the config)
extendWDInstance = webdriverInstance;
}
// Mix all other driver functionality into Protractor.
Object.getOwnPropertyNames(selenium_webdriver_1.WebDriver.prototype).forEach(method => {
if (!this[method] && typeof extendWDInstance[method] === 'function') {
if (methodsToSync.indexOf(method) !== -1) {
ptorMixin(this, extendWDInstance, method, this.waitForAngular.bind(this));
}
else {
ptorMixin(this, extendWDInstance, method);
}
}