@@ -37,6 +37,15 @@ class TestObject
37
37
'getOTP ' => 1000 ,
38
38
];
39
39
40
+ const WEBAPI_AUTH_TEST_ACTIONS = [
41
+ 'createData ' ,
42
+ 'deleteData ' ,
43
+ 'updateData ' ,
44
+ 'getData ' ,
45
+ ];
46
+
47
+ const WEBAPI_AUTH_TEST_ACTION_WEIGHT = 6000 ;
48
+
40
49
/**
41
50
* Name of the test
42
51
*
@@ -93,6 +102,11 @@ class TestObject
93
102
*/
94
103
private $ deprecated ;
95
104
105
+ /**
106
+ * Indicates if a test contains an action that requires Web API authentication.
107
+ */
108
+ private bool $ hasWebApiAuthAction ;
109
+
96
110
/**
97
111
* TestObject constructor.
98
112
*
@@ -120,6 +134,7 @@ public function __construct(
120
134
$ this ->filename = $ filename ;
121
135
$ this ->parentTest = $ parentTest ;
122
136
$ this ->deprecated = $ deprecated ;
137
+ $ this ->hasWebApiAuthAction = false ;
123
138
}
124
139
125
140
/**
@@ -230,7 +245,11 @@ public function getEstimatedDuration()
230
245
231
246
$ testTime = $ this ->calculateWeightedActionTimes ($ this ->getOrderedActions ());
232
247
233
- return $ hookTime + $ testTime ;
248
+ if ($ this ->hasWebApiAuthAction ) {
249
+ return $ hookTime + $ testTime + self ::WEBAPI_AUTH_TEST_ACTION_WEIGHT ;
250
+ } else {
251
+ return $ hookTime + $ testTime ;
252
+ }
234
253
}
235
254
236
255
/**
@@ -245,6 +264,11 @@ private function calculateWeightedActionTimes($actions)
245
264
// search for any actions of special type
246
265
foreach ($ actions as $ action ) {
247
266
/** @var ActionObject $action */
267
+
268
+ if (!$ this ->hasWebApiAuthAction && in_array ($ action ->getType (), self ::WEBAPI_AUTH_TEST_ACTIONS )) {
269
+ $ this ->hasWebApiAuthAction = true ;
270
+ }
271
+
248
272
if (array_key_exists ($ action ->getType (), self ::TEST_ACTION_WEIGHT )) {
249
273
$ weight = self ::TEST_ACTION_WEIGHT [$ action ->getType ()];
250
274
if ($ weight === self ::WAIT_TIME_ATTRIBUTE ) {
0 commit comments