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

Commit

Permalink
Mixing in all webdriver exports to protractor. This means that webdriver
Browse files Browse the repository at this point in the history
classes such as ActionSequence and Keys are accessible on the global
protractor.
  • Loading branch information
juliemr committed Aug 27, 2013
1 parent 1220ecf commit 679c82d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/protractor.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ var webdriver = require('selenium-webdriver');

var DEFER_LABEL = 'NG_DEFER_BOOTSTRAP!';

/**
* Mix in other webdriver functionality to be accessible via protractor.
*/
for (foo in webdriver) {
exports[foo] = webdriver[foo];
}

/**
* All scripts to be run on the client via executeAsyncScript or
* executeScript should be put here. These scripts are transmitted over
Expand Down
6 changes: 6 additions & 0 deletions spec/lib_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,10 @@ describe('protractor library', function() {
expect(ptor.driver.getCurrentUrl()).
toEqual('http://localhost:8000/app/index.html#/http');
});

it('should export other webdriver classes onto the global protractor',
function() {
expect(protractor.ActionSequence).toBeDefined();
expect(protractor.Key.RETURN).toEqual('\uE006');
});
});

0 comments on commit 679c82d

Please sign in to comment.