Skip to content

Commit cd42bf6

Browse files
committed
MQE-1472: Action Group context in Tests and Allure
- ActionGroup StepKey added to index in steps, fixes duplicate AG collisions
1 parent 79c2af9 commit cd42bf6

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

src/Magento/FunctionalTestingFramework/Test/Objects/ActionGroupObject.php

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ private function getResolvedActionsWithArgs($arguments, $actionReferenceKey)
192192
);
193193
}
194194

195-
$resolvedActions = $this->addContextCommentsToActionList($resolvedActions);
195+
$resolvedActions = $this->addContextCommentsToActionList($resolvedActions, $actionReferenceKey);
196196

197197
return $resolvedActions;
198198
}
@@ -491,17 +491,18 @@ private function replaceCreateDataKeys($action, $replacementStepKeys)
491491
* @param array $actionList
492492
* @return array
493493
*/
494-
private function addContextCommentsToActionList($actionList)
494+
private function addContextCommentsToActionList($actionList, $actionReferenceKey)
495495
{
496+
$actionStartComment = self::ACTION_GROUP_CONTEXT_START . $this->name . " (" . $actionReferenceKey . ")";
496497
$startAction = new ActionObject(
497-
self::ACTION_GROUP_CONTEXT_START . $this->name,
498+
$actionStartComment,
498499
ActionObject::ACTION_TYPE_COMMENT,
499-
[ActionObject::ACTION_ATTRIBUTE_USERINPUT => self::ACTION_GROUP_CONTEXT_START . $this->name]
500+
[ActionObject::ACTION_ATTRIBUTE_USERINPUT => $actionStartComment]
500501
);
501502
$endAction = new ActionObject(
502-
self::ACTION_GROUP_CONTEXT_END,
503+
self::ACTION_GROUP_CONTEXT_END . $this->name,
503504
ActionObject::ACTION_TYPE_COMMENT,
504-
[ActionObject::ACTION_ATTRIBUTE_USERINPUT => self::ACTION_GROUP_CONTEXT_END]
505+
[ActionObject::ACTION_ATTRIBUTE_USERINPUT => self::ACTION_GROUP_CONTEXT_END . $this->name]
505506
);
506507
return [$startAction->getStepKey() => $startAction] + $actionList + [$endAction->getStepKey() => $endAction];
507508
}

0 commit comments

Comments
 (0)