File tree Expand file tree Collapse file tree 2 files changed +6
-14
lines changed Expand file tree Collapse file tree 2 files changed +6
-14
lines changed Original file line number Diff line number Diff line change @@ -18,20 +18,16 @@ import events from 'events';
1818class WaitForDocumentLoaded extends events . EventEmitter {
1919 constructor ( ) {
2020 super ( ) ;
21- this . timeoutRetryInMilliseconds = 100 ;
22- this . defaultTimeoutInMilliseconds = 5000 ;
21+ this . timeoutRetryInMilliseconds = this . api . globals . waitForConditionPollInterval || 100 ;
22+ this . defaultTimeoutInMilliseconds = this . api . globals . waitForConditionTimeout || 5000 ;
2323 this . startTimeInMilliseconds = null ;
2424 }
2525
2626 command ( timeoutInMilliseconds , message ) {
2727 this . startTimeInMilliseconds = new Date ( ) . getTime ( ) ;
2828
2929 if ( typeof timeoutInMilliseconds !== 'number' ) {
30- if ( typeof this . api . globals . waitForConditionTimeout === 'number' ) {
31- timeoutInMilliseconds = this . api . globals . waitForConditionTimeout ;
32- } else {
33- timeoutInMilliseconds = this . defaultTimeoutInMilliseconds ;
34- }
30+ timeoutInMilliseconds = this . defaultTimeoutInMilliseconds ;
3531 }
3632
3733 if ( message && typeof message !== 'string' ) {
Original file line number Diff line number Diff line change @@ -41,8 +41,8 @@ var WaitForDocumentLoaded = function (_events$EventEmitter) {
4141
4242 var _this = _possibleConstructorReturn ( this , ( WaitForDocumentLoaded . __proto__ || Object . getPrototypeOf ( WaitForDocumentLoaded ) ) . call ( this ) ) ;
4343
44- _this . timeoutRetryInMilliseconds = 100 ;
45- _this . defaultTimeoutInMilliseconds = 5000 ;
44+ _this . timeoutRetryInMilliseconds = _this . api . globals . waitForConditionPollInterval || 100 ;
45+ _this . defaultTimeoutInMilliseconds = _this . api . globals . waitForConditionTimeout || 5000 ;
4646 _this . startTimeInMilliseconds = null ;
4747 return _this ;
4848 }
@@ -55,11 +55,7 @@ var WaitForDocumentLoaded = function (_events$EventEmitter) {
5555 this . startTimeInMilliseconds = new Date ( ) . getTime ( ) ;
5656
5757 if ( typeof timeoutInMilliseconds !== 'number' ) {
58- if ( typeof this . api . globals . waitForConditionTimeout === 'number' ) {
59- timeoutInMilliseconds = this . api . globals . waitForConditionTimeout ;
60- } else {
61- timeoutInMilliseconds = this . defaultTimeoutInMilliseconds ;
62- }
58+ timeoutInMilliseconds = this . defaultTimeoutInMilliseconds ;
6359 }
6460
6561 if ( message && typeof message !== 'string' ) {
You can’t perform that action at this time.
0 commit comments