@@ -1991,7 +1991,11 @@ class Scheduler {
1991
1991
}
1992
1992
1993
1993
1994
+ let USE_PROMISE_MANAGER ;
1994
1995
function usePromiseManager ( ) {
1996
+ if ( typeof USE_PROMISE_MANAGER !== 'undefined' ) {
1997
+ return ! ! USE_PROMISE_MANAGER ;
1998
+ }
1995
1999
return process . env [ 'SELENIUM_PROMISE_MANAGER' ] === undefined
1996
2000
|| ! / ^ 0 | f a l s e $ / i. test ( process . env [ 'SELENIUM_PROMISE_MANAGER' ] ) ;
1997
2001
}
@@ -3243,8 +3247,21 @@ module.exports = {
3243
3247
setDefaultFlow : setDefaultFlow ,
3244
3248
when : when ,
3245
3249
3246
- /** @return {boolean } Whether the promise manager is enabled. */
3250
+ /**
3251
+ * Indicates whether the promise manager is currently enabled. When disabled,
3252
+ * attempting to use the {@link ControlFlow} or {@link ManagedPromise Promise}
3253
+ * classes will generate an error.
3254
+ *
3255
+ * The promise manager is currently enabled by default, but may be disabled
3256
+ * by setting the environment variable `SELENIUM_PROMISE_MANAGER=0` or by
3257
+ * setting this property to false. Setting this property will always take
3258
+ * precedence ove the use of the environment variable.
3259
+ *
3260
+ * @return {boolean } Whether the promise manager is enabled.
3261
+ * @see <https://github.com/SeleniumHQ/selenium/issues/2969>
3262
+ */
3247
3263
get USE_PROMISE_MANAGER ( ) { return usePromiseManager ( ) ; } ,
3264
+ set USE_PROMISE_MANAGER ( /** boolean */ value ) { USE_PROMISE_MANAGER = value ; } ,
3248
3265
3249
3266
get LONG_STACK_TRACES ( ) { return LONG_STACK_TRACES ; } ,
3250
3267
set LONG_STACK_TRACES ( v ) { LONG_STACK_TRACES = v ; } ,
0 commit comments