This repository was archived by the owner on Jul 29, 2024. It is now read-only.
File tree 3 files changed +24
-1
lines changed
3 files changed +24
-1
lines changed Original file line number Diff line number Diff line change @@ -224,6 +224,23 @@ exports.waitForCondition = function() {};
224
224
* @type {string}
225
225
*/
226
226
exports .name = ' ' ;
227
+
228
+
229
+ /**
230
+ * Used to turn off default checks for angular stability
231
+ *
232
+ * Normally Protractor waits for all $timeout and $http calls to be processed
233
+ * before executing the next command. This can be disabled using
234
+ * browser.ignoreSynchronization, but that will also disable any
235
+ * <Plugin>.waitForPromise or <Plugin>.waitForCondition checks. If you want to
236
+ * disable synchronization with angular, but leave in tact any custom plugin
237
+ * synchronization, this is the option for you.
238
+ *
239
+ * This is used by users who want to replace Protractor's synchronization code
240
+ * with their own.
241
+ *
242
+ * @type {boolean}
243
+ */
227
244
```
228
245
229
246
Each of these exported properties are optional.
Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ var Plugins = function(config) {
22
22
this . pluginObjs = [ ] ;
23
23
this . assertions = { } ;
24
24
this . resultsReported = false ;
25
+ this . skipAngularStability = false ;
25
26
this . pluginConfs . forEach ( function ( pluginConf , i ) {
26
27
var path ;
27
28
if ( pluginConf . path ) {
@@ -45,6 +46,9 @@ var Plugins = function(config) {
45
46
}
46
47
47
48
annotatePluginObj ( self , pluginObj , pluginConf , i ) ;
49
+ self . skipAngularStability = self . skipAngularStability ||
50
+ pluginObj . skipAngularStability ;
51
+
48
52
log . debug ( 'Plugin "' + pluginObj . name + '" loaded.' ) ;
49
53
self . pluginObjs . push ( pluginObj ) ;
50
54
} ) ;
Original file line number Diff line number Diff line change @@ -355,7 +355,9 @@ Protractor.prototype.waitForAngular = function(opt_description) {
355
355
}
356
356
357
357
function runWaitForAngularScript ( ) {
358
- if ( self . rootEl ) {
358
+ if ( self . plugins_ . skipAngularStability ) {
359
+ return webdriver . promise . fulfilled ( ) ;
360
+ } else if ( self . rootEl ) {
359
361
return self . executeAsyncScript_ (
360
362
clientSideScripts . waitForAngular ,
361
363
'Protractor.waitForAngular()' + description ,
You can’t perform that action at this time.
0 commit comments