Skip to content

Commit 5a60dec

Browse files
committed
Merge remote-tracking branch 'origin/sprint-develop' into MQE-448
2 parents 541a42b + f371c4d commit 5a60dec

File tree

10 files changed

+41
-8
lines changed

10 files changed

+41
-8
lines changed

bin/all-checks

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Copyright © Magento, Inc. All rights reserved.
2+
# See COPYING.txt for license details.
3+
4+
bin/static-checks
5+
bin/phpunit-checks

bin/phpunit-checks

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Copyright © Magento, Inc. All rights reserved.
2+
# See COPYING.txt for license details.
3+
4+
echo "===============================UNIT TESTS==============================="
5+
vendor/bin/phpunit --configuration dev/tests/phpunit.xml --testsuite unit
6+
7+
echo "===============================VERIFICATION TESTS==============================="
8+
vendor/bin/phpunit --configuration dev/tests/phpunit.xml --testsuite verification

bin/static-checks

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Copyright © Magento, Inc. All rights reserved.
2+
# See COPYING.txt for license details.
3+
4+
echo "===============================PHP CODE SNIFFER REPORT==============================="
5+
vendor/bin/phpcs ./src --standard=./dev/tests/static/Magento
6+
7+
echo "===============================COPY PASTE DETECTOR REPORT==============================="
8+
vendor/bin/phpcpd ./src
9+
10+
echo "===============================MAGENTO COPYRIGHT REPORT==============================="
11+
bin/copyright-check

dev/tests/verification/Resources/BasicFunctionalCest.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ class BasicFunctionalCest
7575
$I->dragAndDrop(".functionalTestSelector", ".functionalTestSelector2");
7676
$I->executeJS("someJSFunction");
7777
$I->fillField(".functionalTestSelector", "someInput");
78+
$I->fillField(".functionalTestSelector", "0");
7879
$grabAttributeVar = $I->grabAttributeFrom(".functionalTestSelector", "someInput");
7980
$grabCookieVar = $I->grabCookie("grabCookieInput", ['domain' => 'www.google.com']);
8081
$grabUrlVar = $I->grabFromCurrentUrl("/grabCurrentUrl");

dev/tests/verification/Resources/PersistedReplacementCest.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,5 +65,7 @@ class PersistedReplacementCest
6565
$I->click("#element ." . $uniqueData->getCreatedDataByName('firstname'));
6666
$I->click("#" . $uniqueData->getCreatedDataByName('firstname') . " .success");
6767
$I->click("#" . $uniqueData->getCreatedDataByName('firstname'));
68+
$I->dragAndDrop($uniqueData->getCreatedDataByName('firstname'), $uniqueData->getCreatedDataByName('firstname'));
69+
$I->dragAndDrop("#element ." . $uniqueData->getCreatedDataByName('firstname'), "#" . $uniqueData->getCreatedDataByName('firstname') . " .success");
6870
}
6971
}

dev/tests/verification/TestModule/Cest/basicFunctionalCest.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@
6060
<dragAndDrop selector1=".functionalTestSelector" selector2=".functionalTestSelector2" mergeKey="dragAndDropKey1" />
6161
<executeJS function="someJSFunction" mergeKey="executeJSKey1"/>
6262
<fillField selector=".functionalTestSelector" userInput="someInput" mergeKey="fillFieldKey1" />
63+
<fillField selector=".functionalTestSelector" userInput="0" mergeKey="fillFieldKey2" />
6364
<grabAttributeFrom returnVariable="grabAttributeVar" selector=".functionalTestSelector" userInput="someInput" mergeKey="grabAttributeFromKey1" />
6465
<grabCookie returnVariable="grabCookieVar" userInput="grabCookieInput" parameterArray="['domain' => 'www.google.com']" mergeKey="grabCookieKey1" />
6566
<grabFromCurrentUrl returnVariable="grabUrlVar" url="/grabCurrentUrl" mergeKey="grabFromCurrentUrlKey1" />

dev/tests/verification/TestModule/Cest/persistedReplacementCest.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,11 @@
5757
<click selector="{{SampleSection.oneParamElement($uniqueData.firstname$)}}" mergeKey="h3"/>
5858
<click selector="{{SampleSection.twoParamElement($uniqueData.firstname$,'success')}}" mergeKey="h4"/>
5959
<click selector="#$uniqueData.firstname$" mergeKey="h5"/>
60+
61+
<!-- selector1/2 replacement -->
62+
<dragAndDrop selector1="$uniqueData.firstname$" selector2="$uniqueData.firstname$" mergeKey="j1"/>
63+
<dragAndDrop selector1="{{SampleSection.oneParamElement($uniqueData.firstname$)}}" selector2="{{SampleSection.twoParamElement($uniqueData.firstname$,'success')}}" mergeKey="j2"/>
64+
6065
</test>
6166
</cest>
6267
</config>

src/Magento/FunctionalTestingFramework/DataGenerator/Handlers/DataObjectHandler.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ private function parseDataEntities()
174174
if (array_key_exists(self::DATA_VALUES, $entity)) {
175175
foreach ($entity[self::DATA_VALUES] as $dataElement) {
176176
$dataElementKey = strtolower($dataElement[self::DATA_ELEMENT_KEY]);
177-
$dataElementValue = $dataElement[self::DATA_ELEMENT_VALUE];
177+
$dataElementValue = $dataElement[self::DATA_ELEMENT_VALUE] ?? "";
178178
if (array_key_exists(self::DATA_ELEMENT_UNIQUENESS_ATTR, $dataElement)) {
179179
$uniquenessValues[$dataElementKey] = $dataElement[self::DATA_ELEMENT_UNIQUENESS_ATTR];
180180
}
@@ -201,7 +201,7 @@ private function parseDataEntities()
201201
$arrayValues[] = $arrayValue[self::ARRAY_ELEMENT_ITEM_VALUE];
202202
}
203203

204-
$dataValues[$arrayKey] = $arrayValues;
204+
$dataValues[strtolower($arrayKey)] = $arrayValues;
205205
}
206206
}
207207

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ private function getResolvedActionsWithArgs($arguments, $actionReferenceKey)
8484
// $regexPattern match on: $matches[0] {{section.element(arg.field)}}
8585
// $matches[1] = section.element
8686
// $matches[2] = arg.field
87-
$regexPattern = '/{{([\w.]+)\(*([\w.$\']+)*\)*}}/';
87+
$regexPattern = '/{{([\w.\[\]]+)\(*([\w.$\']+)*\)*}}/';
8888

8989
foreach ($this->parsedActions as $action) {
9090
$varAttributes = array_intersect(self::VAR_ATTRIBUTES, array_keys($action->getCustomActionAttributes()));
@@ -140,10 +140,10 @@ private function replaceAttributeArguments($arguments, $attributeValue, $matches
140140
if (empty($variable)) {
141141
continue;
142142
}
143-
// Truncate arg.field into arg
143+
// Truncate arg.field into arg. If 'Literal' was passed, variableName will be null.
144144
$variableName = strstr($variable, '.', true);
145145
// Check if arguments has a mapping for the given variableName
146-
if (!array_key_exists($variableName, $arguments)) {
146+
if ($variableName == null || !array_key_exists($variableName, $arguments)) {
147147
continue;
148148
}
149149
$isPersisted = strstr($arguments[$variableName], '$');

src/Magento/FunctionalTestingFramework/Util/TestGenerator.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -391,11 +391,11 @@ private function generateStepsPhp($stepsObject, $stepsData, $hookObject = false)
391391
}
392392

393393
if (isset($customActionAttributes['selector1'])) {
394-
$selector1 = $this->wrapWithDoubleQuotes($customActionAttributes['selector1']);
394+
$selector1 = $this->addUniquenessFunctionCall($customActionAttributes['selector1']);
395395
}
396396

397397
if (isset($customActionAttributes['selector2'])) {
398-
$selector2 = $this->wrapWithDoubleQuotes($customActionAttributes['selector2']);
398+
$selector2 = $this->addUniquenessFunctionCall($customActionAttributes['selector2']);
399399
}
400400

401401
if (isset($customActionAttributes['x'])) {
@@ -1206,7 +1206,7 @@ private function addUniquenessFunctionCall($input)
12061206
*/
12071207
private function wrapWithDoubleQuotes($input)
12081208
{
1209-
if (empty($input)) {
1209+
if ($input == null) {
12101210
return '';
12111211
}
12121212
//Only replace &quot; with \" so that it doesn't break outer string.

0 commit comments

Comments
 (0)