@@ -21,14 +21,35 @@ class TestObject
21
21
22
22
const TEST_ACTION_WEIGHT = [
23
23
'waitForPageLoad ' => 1500 ,
24
- 'amOnPage ' => 1000 ,
24
+ 'amOnPage ' => 1500 ,
25
25
'waitForLoadingMaskToDisappear ' => 500 ,
26
26
'wait ' => self ::WAIT_TIME_ATTRIBUTE ,
27
+ 'waitForAjaxLoad ' => 500 ,
28
+ 'waitForElementNotVisible ' => 500 ,
29
+ 'waitForElementVisible ' => 500 ,
30
+ 'waitForText ' => 500 ,
31
+ 'waitForElement ' => 500 ,
32
+ 'waitForJS ' => 500 ,
27
33
'comment ' => 5 ,
28
34
'assertCount ' => 5 ,
29
- 'closeAdminNotification ' => 10
35
+ 'closeAdminNotification ' => 10 ,
36
+ 'magentoCLI ' => 1000 ,
37
+ 'magentoCron ' => 3000 ,
38
+ 'createData ' => 500 ,
39
+ 'deleteData ' => 200 ,
40
+ 'updateData ' => 200 ,
41
+ 'getOTP ' => 1000 ,
30
42
];
31
43
44
+ const WEBAPI_AUTH_TEST_ACTIONS = [
45
+ 'createData ' ,
46
+ 'deleteData ' ,
47
+ 'updateData ' ,
48
+ 'getData ' ,
49
+ ];
50
+
51
+ const WEBAPI_AUTH_TEST_ACTION_WEIGHT = 6000 ;
52
+
32
53
/**
33
54
* Name of the test
34
55
*
@@ -85,6 +106,13 @@ class TestObject
85
106
*/
86
107
private $ deprecated ;
87
108
109
+ /**
110
+ * Indicates if a test contains an action that requires Web API authentication.
111
+ *
112
+ * @var boolean
113
+ */
114
+ private $ hasWebApiAuthAction ;
115
+
88
116
/**
89
117
* TestObject constructor.
90
118
*
@@ -112,6 +140,7 @@ public function __construct(
112
140
$ this ->filename = $ filename ;
113
141
$ this ->parentTest = $ parentTest ;
114
142
$ this ->deprecated = $ deprecated ;
143
+ $ this ->hasWebApiAuthAction = false ;
115
144
}
116
145
117
146
/**
@@ -222,7 +251,11 @@ public function getEstimatedDuration()
222
251
223
252
$ testTime = $ this ->calculateWeightedActionTimes ($ this ->getOrderedActions ());
224
253
225
- return $ hookTime + $ testTime ;
254
+ if ($ this ->hasWebApiAuthAction ) {
255
+ return $ hookTime + $ testTime + self ::WEBAPI_AUTH_TEST_ACTION_WEIGHT ;
256
+ } else {
257
+ return $ hookTime + $ testTime ;
258
+ }
226
259
}
227
260
228
261
/**
@@ -237,6 +270,11 @@ private function calculateWeightedActionTimes($actions)
237
270
// search for any actions of special type
238
271
foreach ($ actions as $ action ) {
239
272
/** @var ActionObject $action */
273
+
274
+ if (!$ this ->hasWebApiAuthAction && in_array ($ action ->getType (), self ::WEBAPI_AUTH_TEST_ACTIONS )) {
275
+ $ this ->hasWebApiAuthAction = true ;
276
+ }
277
+
240
278
if (array_key_exists ($ action ->getType (), self ::TEST_ACTION_WEIGHT )) {
241
279
$ weight = self ::TEST_ACTION_WEIGHT [$ action ->getType ()];
242
280
if ($ weight === self ::WAIT_TIME_ATTRIBUTE ) {
0 commit comments