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

Commit

Permalink
fix(protractor.wrapDriver): allow browser instances to work even if t…
Browse files Browse the repository at this point in the history
…hey were not set up through the runner

Fixes #2456
  • Loading branch information
sjelin authored and juliemr committed Sep 28, 2015
1 parent 88c7ae7 commit 1487e5a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/protractor.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ var ElementArrayFinder = require('./element').ElementArrayFinder;
var ElementFinder = require('./element').ElementFinder;
var build$ = require('./element').build$;
var build$$ = require('./element').build$$;
var Plugins = require('./plugins');

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

/*
* Set by the runner.
*
* @type {Plugins} Object containing plugin funtions from config.
*/
this.plugins_ = new Plugins({});

/**
* The reset URL to use between page loads.
*
Expand Down
5 changes: 5 additions & 0 deletions spec/basic/lib_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,11 @@ describe('protractor library', function() {
toEqual('repeater');
});

it('should allow self-wrapped webdriver instances', function() {
var driver = protractor.wrapDriver(browser.driver);
driver.get('https://angularjs.org/');
});

describe('helper functions', function() {
it('should get the absolute URL', function() {
browser.get('index.html');
Expand Down

0 comments on commit 1487e5a

Please sign in to comment.