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

Commit 41d8128

Browse files
committed
refactor(mockmodules): add a base mock module to turn on debug info
This will be necessary after Angular commit angular/angular.js#8430 It should be a noop (which adds one webdriver command) for versions of Angular before that one.
1 parent 9a8f45a commit 41d8128

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

lib/protractor.js

+19
Original file line numberDiff line numberDiff line change
@@ -893,6 +893,8 @@ var Protractor = function(webdriverInstance, opt_baseUrl, opt_rootElement) {
893893
* @type {Array<{name: string, script: function|string, args: Array.<string>}>}
894894
*/
895895
this.mockModules_ = [];
896+
897+
this.addBaseMockModules_();
896898
};
897899

898900
/**
@@ -991,6 +993,7 @@ Protractor.prototype.addMockModule = function(name, script) {
991993
*/
992994
Protractor.prototype.clearMockModules = function() {
993995
this.mockModules_ = [];
996+
this.addBaseMockModules_();
994997
};
995998

996999
/**
@@ -1005,6 +1008,22 @@ Protractor.prototype.removeMockModule = function(name) {
10051008
}
10061009
};
10071010

1011+
/**
1012+
* Add the base mock modules used for all Protractor tests.
1013+
*
1014+
* @private
1015+
*/
1016+
Protractor.prototype.addBaseMockModules_ = function() {
1017+
this.addMockModule('protractorBaseModule_', function() {
1018+
angular.module('protractorBaseModule_', []).
1019+
config(['$compileProvider', function($compileProvider) {
1020+
if ($compileProvider.debugInfoEnabled) {
1021+
$compileProvider.debugInfoEnabled(true);
1022+
};
1023+
}]);
1024+
});
1025+
};
1026+
10081027
/**
10091028
* See webdriver.WebDriver.get
10101029
*

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
"start": "testapp/scripts/web-server.js"
5252
},
5353
"license": "MIT",
54-
"version": "1.1.1",
54+
"version": "1.2.0-beta1",
5555
"webdriverVersions": {
5656
"selenium": "2.42.2",
5757
"chromedriver": "2.10",

0 commit comments

Comments
 (0)