diff --git a/lib/browser.ts b/lib/browser.ts index 2aa658f1e..76f51e01b 100644 --- a/lib/browser.ts +++ b/lib/browser.ts @@ -955,21 +955,4 @@ export class ProtractorBrowser extends Webdriver { }; this.debugHelper.init(debuggerClientPath, onStartFn, opt_debugPort); } - - /** - * Create a new instance of Browser by wrapping a webdriver instance. - * - * @param {webdriver.WebDriver} webdriver The configured webdriver instance. - * @param {string=} baseUrl A URL to prepend to relative gets. - * @param {string=} rootElement The css selector for the element which is the - * root of the Angular app. - * @param {boolean=} untrackOutstandingTimeouts Whether Browser should - * stop tracking outstanding $timeouts. - * @returns {Browser} a new Browser instance - */ - static wrapDriver( - webdriver: WebDriver, baseUrl?: string, rootElement?: string, - untrackOutstandingTimeouts?: boolean): ProtractorBrowser { - return new ProtractorBrowser(webdriver, baseUrl, rootElement, untrackOutstandingTimeouts); - } } diff --git a/lib/index.ts b/lib/index.ts index f5a17abdd..dbf197023 100644 --- a/lib/index.ts +++ b/lib/index.ts @@ -15,8 +15,6 @@ export {ProtractorExpectedConditions} from './expectedConditions'; export {ProtractorBy} from './locators'; export {Ptor} from './ptor'; -export let wrapDriver = ProtractorBrowser.wrapDriver; - export let utils = { firefox: require('selenium-webdriver/firefox'), http: require('selenium-webdriver/http'), diff --git a/lib/runner.ts b/lib/runner.ts index 7ad8d2eac..1ccb2a5d5 100644 --- a/lib/runner.ts +++ b/lib/runner.ts @@ -166,7 +166,6 @@ export class Runner extends EventEmitter { protractor.$$ = browser_.$$; protractor.element = browser_.element; protractor.by = protractor.By = ProtractorBrowser.By; - protractor.wrapDriver = ProtractorBrowser.wrapDriver; protractor.ExpectedConditions = browser_.ExpectedConditions; if (!this.config_.noGlobals) { @@ -207,7 +206,7 @@ export class Runner extends EventEmitter { var config = this.config_; var driver = this.driverprovider_.getNewDriver(); - var browser_ = ProtractorBrowser.wrapDriver( + var browser_ = new ProtractorBrowser( driver, config.baseUrl, config.rootElement, config.untrackOutstandingTimeouts); browser_.params = config.params; diff --git a/spec/basic/lib_spec.js b/spec/basic/lib_spec.js index 6afb5891f..219e9b985 100644 --- a/spec/basic/lib_spec.js +++ b/spec/basic/lib_spec.js @@ -110,12 +110,6 @@ describe('protractor library', function() { toEqual('repeater'); }); - it('should allow self-wrapped webdriver instances', function() { - var driver = protractor.wrapDriver(browser.driver); - var url = require('url').resolve(browser.baseUrl, 'index.html'); - driver.get(url); - }); - describe('helper functions', function() { it('should get the absolute URL', function() { browser.get('index.html'); diff --git a/spec/dependencyTest/protractor_spec.js b/spec/dependencyTest/protractor_spec.js index 202f1e4c6..7dcc1ec4c 100644 --- a/spec/dependencyTest/protractor_spec.js +++ b/spec/dependencyTest/protractor_spec.js @@ -36,11 +36,6 @@ describe('require(\'protractor\')', () => { }); describe('browser class', () => { - it('should have static method defined', () => { - var staticMethod = 'wrapDriver'; - expect(typeof protractor.ProtractorBrowser['wrapDriver']).toEqual('function'); - }); - it('should have static variables defined', () => { var staticVariables = ['By']; for (var pos in staticVariables) { diff --git a/spec/install/typescript_spec.ts b/spec/install/typescript_spec.ts index ff5370631..f1cca8214 100644 --- a/spec/install/typescript_spec.ts +++ b/spec/install/typescript_spec.ts @@ -8,7 +8,6 @@ describe('typescript imports', () => { expect(protractor.$ === $).toBeTruthy(); expect(protractor.$$ === $$).toBeTruthy(); expect(protractor.ExpectedConditions === ExpectedConditions).toBeTruthy(); - expect(typeof protractor.wrapDriver).toEqual('function'); }); it('should have selenium-webdriver components for the protractor namespace', () => { expect(typeof protractor.promise.all).toEqual('function');