@@ -23,6 +23,11 @@ class ActionMergeUtil
23
23
const WAIT_ATTR = 'timeout ' ;
24
24
const WAIT_ACTION_NAME = 'waitForPageLoad ' ;
25
25
const WAIT_ACTION_SUFFIX = 'WaitForPageLoad ' ;
26
+ const SKIP_READINESS_ACTION_NAME = 'skipReadinessCheck ' ;
27
+ const SKIP_READINESS_OFF_SUFFIX = 'SkipReadinessOff ' ;
28
+ const SKIP_READINESS_ON_SUFFIX = 'SkipReadinessOn ' ;
29
+ const DEFAULT_SKIP_ON_ORDER = 'before ' ;
30
+ const DEFAULT_SKIP_OFF_ORDER = 'after ' ;
26
31
const DEFAULT_WAIT_ORDER = 'after ' ;
27
32
28
33
/**
@@ -78,6 +83,7 @@ public function resolveActionSteps($parsedSteps, $skipActionGroupResolution = fa
78
83
{
79
84
$ this ->mergeActions ($ parsedSteps );
80
85
$ this ->insertWaits ();
86
+ $ this ->insertReadinessSkips ();
81
87
82
88
if ($ skipActionGroupResolution ) {
83
89
return $ this ->orderedSteps ;
@@ -217,6 +223,39 @@ private function insertWaits()
217
223
}
218
224
}
219
225
226
+ /**
227
+ * Runs through the prepared orderedSteps and calls insertWait if a step requires a wait after it.
228
+ *
229
+ * @return void
230
+ */
231
+ private function insertReadinessSkips ()
232
+ {
233
+ foreach ($ this ->orderedSteps as $ step ) {
234
+ if (array_key_exists ("skipReadiness " , $ step ->getCustomActionAttributes ())) {
235
+ if ($ step ->getCustomActionAttributes ()['skipReadiness ' ]) {
236
+ $ skipReadinessOn = new ActionObject (
237
+ $ step ->getStepKey () . self ::SKIP_READINESS_ON_SUFFIX ,
238
+ self ::SKIP_READINESS_ACTION_NAME ,
239
+ ['state ' => "true " ],
240
+ $ step ->getStepKey (),
241
+ self ::DEFAULT_SKIP_ON_ORDER
242
+ );
243
+
244
+ $ skipReadinessOff = new ActionObject (
245
+ $ step ->getStepKey () . self ::SKIP_READINESS_OFF_SUFFIX ,
246
+ self ::SKIP_READINESS_ACTION_NAME ,
247
+ ['state ' => "false " ],
248
+ $ step ->getStepKey (),
249
+ self ::DEFAULT_SKIP_OFF_ORDER
250
+ );
251
+
252
+ $ this ->insertStep ($ skipReadinessOn );
253
+ $ this ->insertStep ($ skipReadinessOff );
254
+ }
255
+ }
256
+ }
257
+ }
258
+
220
259
/**
221
260
* This method takes the steps from the parser and splits steps which need merge from steps that are ordered.
222
261
*
0 commit comments