From 679c82d510ea016690fba259db50b4afa36154cc Mon Sep 17 00:00:00 2001 From: Julie Date: Tue, 27 Aug 2013 10:34:59 -0700 Subject: [PATCH] Mixing in all webdriver exports to protractor. This means that webdriver classes such as ActionSequence and Keys are accessible on the global protractor. --- lib/protractor.js | 7 +++++++ spec/lib_spec.js | 6 ++++++ 2 files changed, 13 insertions(+) diff --git a/lib/protractor.js b/lib/protractor.js index 24b8ac085..7daa9bd28 100644 --- a/lib/protractor.js +++ b/lib/protractor.js @@ -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 diff --git a/spec/lib_spec.js b/spec/lib_spec.js index 0d4cbd1a0..46216273b 100644 --- a/spec/lib_spec.js +++ b/spec/lib_spec.js @@ -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'); + }); });