Skip to content
This repository was archived by the owner on Jul 29, 2024. It is now read-only.

refactor(browser): Remove wrapDriver #3827

Merged
merged 1 commit into from
Dec 16, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 0 additions & 17 deletions lib/browser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
2 changes: 0 additions & 2 deletions lib/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
Expand Down
3 changes: 1 addition & 2 deletions lib/runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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;
Expand Down
6 changes: 0 additions & 6 deletions spec/basic/lib_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
5 changes: 0 additions & 5 deletions spec/dependencyTest/protractor_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
1 change: 0 additions & 1 deletion spec/install/typescript_spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down