Skip to content

Commit dd3dd48

Browse files
committed
MQE-880: Url parameter no longer resolved correctly if only page name is used
MQE-881: Cannot Pass Arguments In Action Groups To X, Y Attributes On Actions MQE-882: Cannot input <data> tags in entity xml
1 parent 2a0ec6c commit dd3dd48

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
class ActionObject
2121
{
2222
const __ENV = "_ENV";
23-
const DATA_ENABLED_ATTRIBUTES = ["userInput", "parameterArray", "expected", "actual"];
23+
const DATA_ENABLED_ATTRIBUTES = ["userInput", "parameterArray", "expected", "actual", "x", "y"];
2424
const SELECTOR_ENABLED_ATTRIBUTES = [
2525
'selector',
2626
'dependentSelector',
@@ -40,7 +40,7 @@ class ActionObject
4040
const ACTION_ATTRIBUTE_URL = 'url';
4141
const ACTION_ATTRIBUTE_SELECTOR = 'selector';
4242
const ACTION_ATTRIBUTE_VARIABLE_REGEX_PARAMETER = '/\(.+\)/';
43-
const ACTION_ATTRIBUTE_VARIABLE_REGEX_PATTERN = '/{{[\w]+\.[\w\[\]]+}}/';
43+
const ACTION_ATTRIBUTE_VARIABLE_REGEX_PATTERN = '/{{[\w]+\.?[\w\[\]]+}}/';
4444
const ACTION_ATTRIBUTE_VARIABLE_REGEX_PATTERN_WITH_PARAMS= '/{{[\w]+\.[\w]+\(.+\)}}/';
4545

4646
/**
@@ -371,7 +371,7 @@ private function resolveDataInputReferences()
371371
foreach ($relevantDataAttributes as $dataAttribute) {
372372
$varInput = $this->actionAttributes[$dataAttribute];
373373
$replacement = $this->findAndReplaceReferences(DataObjectHandler::getInstance(), $varInput);
374-
if ($replacement != null) {
374+
if ($replacement !== null) {
375375
$this->resolvedCustomAttributes[$dataAttribute] = $replacement;
376376
}
377377
}
@@ -482,7 +482,7 @@ private function findAndReplaceReferences($objectHandler, $inputString)
482482
$replacement = $this->resolveEntityDataObjectReference($obj, $match);
483483
}
484484

485-
if ($replacement == null) {
485+
if ($replacement === null) {
486486
if (get_class($objectHandler) != DataObjectHandler::class) {
487487
return $this->findAndReplaceReferences(DataObjectHandler::getInstance(), $outputString);
488488
} else {

src/Magento/FunctionalTestingFramework/Util/TestGenerator.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1588,6 +1588,9 @@ private function wrapFunctionCall($actor, $action, ...$args)
15881588
if (!$isFirst) {
15891589
$output .= ', ';
15901590
}
1591+
if ($args[$i] === "") {
1592+
$args[$i] = '"' . $args[$i] . '"';
1593+
}
15911594
$output .= $args[$i];
15921595
$isFirst = false;
15931596
}
@@ -1619,6 +1622,9 @@ private function wrapFunctionCallWithReturnValue($returnVariable, $actor, $actio
16191622
if (!$isFirst) {
16201623
$output .= ', ';
16211624
}
1625+
if ($args[$i] === "") {
1626+
$args[$i] = '"' . $args[$i] . '"';
1627+
}
16221628
$output .= $args[$i];
16231629
$isFirst = false;
16241630
}

0 commit comments

Comments
 (0)