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

Commit 1487e5a

Browse files
sjelinjuliemr
authored andcommitted
fix(protractor.wrapDriver): allow browser instances to work even if they were not set up through the runner
Fixes #2456
1 parent 88c7ae7 commit 1487e5a

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

lib/protractor.js

+8
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ var ElementArrayFinder = require('./element').ElementArrayFinder;
77
var ElementFinder = require('./element').ElementFinder;
88
var build$ = require('./element').build$;
99
var build$$ = require('./element').build$$;
10+
var Plugins = require('./plugins');
1011

1112
var clientSideScripts = require('./clientsidescripts.js');
1213
var ProtractorBy = require('./locators.js').ProtractorBy;
@@ -189,6 +190,13 @@ var Protractor = function(webdriverInstance, opt_baseUrl, opt_rootElement) {
189190
*/
190191
this.ready = null;
191192

193+
/*
194+
* Set by the runner.
195+
*
196+
* @type {Plugins} Object containing plugin funtions from config.
197+
*/
198+
this.plugins_ = new Plugins({});
199+
192200
/**
193201
* The reset URL to use between page loads.
194202
*

spec/basic/lib_spec.js

+5
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,11 @@ describe('protractor library', function() {
108108
toEqual('repeater');
109109
});
110110

111+
it('should allow self-wrapped webdriver instances', function() {
112+
var driver = protractor.wrapDriver(browser.driver);
113+
driver.get('https://angularjs.org/');
114+
});
115+
111116
describe('helper functions', function() {
112117
it('should get the absolute URL', function() {
113118
browser.get('index.html');

0 commit comments

Comments
 (0)