66
77namespace Magento \FunctionalTestingFramework \Test \Util ;
88
9+ use Magento \FunctionalTestingFramework \Exceptions \TestReferenceException ;
910use Magento \FunctionalTestingFramework \Exceptions \XmlException ;
1011use Magento \FunctionalTestingFramework \Test \Handlers \ActionGroupObjectHandler ;
1112use Magento \FunctionalTestingFramework \Test \Objects \ActionObject ;
@@ -69,6 +70,7 @@ public function resolveActionSteps($parsedSteps, $skipActionGroupResolution = fa
6970 * Method to resolve action group references and insert relevant actions into step flow
7071 *
7172 * @param array $mergedSteps
73+ * @throws TestReferenceException
7274 * @return array
7375 */
7476 private function resolveActionGroups ($ mergedSteps )
@@ -78,9 +80,11 @@ private function resolveActionGroups($mergedSteps)
7880 foreach ($ mergedSteps as $ key => $ mergedStep ) {
7981 /**@var ActionObject $mergedStep**/
8082 if ($ mergedStep ->getType () == ActionObjectExtractor::ACTION_GROUP_TAG ) {
81- $ actionGroup = ActionGroupObjectHandler::getInstance ()->getObject (
82- $ mergedStep ->getCustomActionAttributes ()[ActionObjectExtractor::ACTION_GROUP_REF ]
83- );
83+ $ actionGroupRef = $ mergedStep ->getCustomActionAttributes ()[ActionObjectExtractor::ACTION_GROUP_REF ];
84+ $ actionGroup = ActionGroupObjectHandler::getInstance ()->getObject ($ actionGroupRef );
85+ if ($ actionGroup == null ) {
86+ throw new TestReferenceException ("Could not find ActionGroup by ref \"{$ actionGroupRef }\"" );
87+ }
8488 $ args = $ mergedStep ->getCustomActionAttributes ()[ActionObjectExtractor::ACTION_GROUP_ARGUMENTS ] ?? null ;
8589 $ actionsToMerge = $ actionGroup ->getSteps ($ args , $ key );
8690 $ newOrderedList = $ newOrderedList + $ actionsToMerge ;
0 commit comments