Skip to content

Commit c1c97a0

Browse files
authored
Merge branch 'develop' into MQE-2150
2 parents ca63481 + fd2da03 commit c1c97a0

File tree

9 files changed

+124
-124
lines changed

9 files changed

+124
-124
lines changed

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@
3232
"symfony/finder": "^5.0",
3333
"symfony/mime": "^5.0",
3434
"symfony/process": "^4.4",
35-
"vlucas/phpdotenv": "^2.4"
35+
"vlucas/phpdotenv": "^2.4",
36+
"weew/helpers-array": "^1.3"
3637
},
3738
"require-dev": {
3839
"brainmaestro/composer-git-hooks": "^2.3.1",

composer.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dev/tests/functional/tests/MFTF/DevDocs/Data/MessageData.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,10 @@
1717
<item name="three">3</item>
1818
</array>
1919
</entity>
20+
21+
<entity name="ExtendedMessageData" extends="MessageData">
22+
<array key="numbers">
23+
<item name="TESTING CASE">TESTING CASE</item>
24+
</array>
25+
</entity>
2026
</entities>

dev/tests/functional/tests/MFTF/DevDocs/Test/DevDocsTest.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@
4848
</actionGroup>
4949

5050
<assertEqualsCanonicalizing stepKey="assertMergedArray">
51-
<actualResult type="array">{{MessageData.numbers}}</actualResult>
52-
<expectedResult type="array">["Something New", "0", "1", "2", "3"]</expectedResult>
51+
<actualResult type="array">{{ExtendedMessageData.numbers}}</actualResult>
52+
<expectedResult type="array">["Something New", "0", "1", "2", "3", "TESTING CASE"]</expectedResult>
5353
</assertEqualsCanonicalizing>
5454
</test>
5555
</tests>

etc/config/functional.suite.dist.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,4 @@ modules:
3737
capabilities:
3838
unhandledPromptBehavior: "ignore"
3939
chromeOptions:
40-
args: ["--window-size=1280,1024", "--disable-extensions", "--enable-automation", "--disable-gpu", "--enable-Passthrough", "--disable-dev-shm-usage"]
40+
args: ["--window-size=1280,1024", "--disable-extensions", "--enable-automation", "--disable-gpu", "--enable-Passthrough", "--disable-dev-shm-usage", "--ignore-certificate-errors"]

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,8 +226,8 @@ private function processParserOutput($parserOutput)
226226
private function processArray($arrayItems, $data, $key)
227227
{
228228
$items = [];
229-
foreach ($arrayItems as $item) {
230-
$items[] = $item[self::_VALUE];
229+
foreach ($arrayItems as $key => $item) {
230+
$items[$key] = $item[self::_VALUE];
231231
}
232232

233233
return array_merge($items, $data[$key] ?? []);

src/Magento/FunctionalTestingFramework/DataGenerator/Util/DataExtensionUtil.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public function extendEntity($entityObject)
6262

6363
// Get all data for both parent and child and merge
6464
$referencedData = $parentEntity->getAllData();
65-
$newData = array_merge($referencedData, $entityObject->getAllData());
65+
$newData = array_extend($referencedData, $entityObject->getAllData());
6666

6767
// Get all linked references for both parent and child and merge
6868
$referencedLinks = $parentEntity->getLinkedEntities();

src/Magento/FunctionalTestingFramework/Module/MagentoActionProxies.php

Lines changed: 109 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
use Magento\FunctionalTestingFramework\DataGenerator\Handlers\PersistedObjectHandler;
1111
use Magento\FunctionalTestingFramework\DataGenerator\Handlers\CredentialStore;
1212
use Magento\FunctionalTestingFramework\Exceptions\TestFrameworkException;
13+
use Magento\FunctionalTestingFramework\Exceptions\TestReferenceException;
1314

1415
/**
1516
* Class MagentoActionProxies
@@ -20,5 +21,112 @@
2021
*/
2122
class MagentoActionProxies extends CodeceptionModule
2223
{
23-
// TODO: placeholder for proxy functions currently in MagentoWebDriver (MQE-1904)
24+
/**
25+
* Create an entity
26+
*
27+
* @param string $key StepKey of the createData action.
28+
* @param string $scope
29+
* @param string $entity Name of xml entity to create.
30+
* @param array $dependentObjectKeys StepKeys of other createData actions that are required.
31+
* @param array $overrideFields Array of FieldName => Value of override fields.
32+
* @param string $storeCode
33+
* @return void
34+
* @throws TestReferenceException
35+
*/
36+
public function createEntity(
37+
$key,
38+
$scope,
39+
$entity,
40+
$dependentObjectKeys = [],
41+
$overrideFields = [],
42+
$storeCode = ''
43+
) {
44+
PersistedObjectHandler::getInstance()->createEntity(
45+
$key,
46+
$scope,
47+
$entity,
48+
$dependentObjectKeys,
49+
$overrideFields,
50+
$storeCode
51+
);
52+
}
53+
54+
/**
55+
* Retrieves and updates a previously created entity
56+
*
57+
* @param string $key StepKey of the createData action.
58+
* @param string $scope
59+
* @param string $updateEntity Name of the static XML data to update the entity with.
60+
* @param array $dependentObjectKeys StepKeys of other createData actions that are required.
61+
* @return void
62+
*/
63+
public function updateEntity($key, $scope, $updateEntity, $dependentObjectKeys = [])
64+
{
65+
PersistedObjectHandler::getInstance()->updateEntity(
66+
$key,
67+
$scope,
68+
$updateEntity,
69+
$dependentObjectKeys
70+
);
71+
}
72+
73+
/**
74+
* Performs GET on given entity and stores entity for use
75+
*
76+
* @param string $key StepKey of getData action.
77+
* @param string $scope
78+
* @param string $entity Name of XML static data to use.
79+
* @param array $dependentObjectKeys StepKeys of other createData actions that are required.
80+
* @param string $storeCode
81+
* @param integer $index
82+
* @return void
83+
*/
84+
public function getEntity($key, $scope, $entity, $dependentObjectKeys = [], $storeCode = '', $index = null)
85+
{
86+
PersistedObjectHandler::getInstance()->getEntity(
87+
$key,
88+
$scope,
89+
$entity,
90+
$dependentObjectKeys,
91+
$storeCode,
92+
$index
93+
);
94+
}
95+
96+
/**
97+
* Retrieves and deletes a previously created entity
98+
*
99+
* @param string $key StepKey of the createData action.
100+
* @param string $scope
101+
* @return void
102+
*/
103+
public function deleteEntity($key, $scope)
104+
{
105+
PersistedObjectHandler::getInstance()->deleteEntity($key, $scope);
106+
}
107+
108+
/**
109+
* Retrieves a field from an entity, according to key and scope given
110+
*
111+
* @param string $stepKey
112+
* @param string $field
113+
* @param string $scope
114+
* @return string
115+
*/
116+
public function retrieveEntityField($stepKey, $field, $scope)
117+
{
118+
return PersistedObjectHandler::getInstance()->retrieveEntityField($stepKey, $field, $scope);
119+
}
120+
121+
/**
122+
* Get encrypted value by key
123+
*
124+
* @param string $key
125+
* @return string|null
126+
* @throws TestFrameworkException
127+
*/
128+
public function getSecret($key)
129+
{
130+
return CredentialStore::getInstance()->getSecret($key);
131+
}
24132
}

src/Magento/FunctionalTestingFramework/Module/MagentoWebDriver.php

Lines changed: 0 additions & 115 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
use Magento\FunctionalTestingFramework\DataTransport\Protocol\CurlTransport;
2727
use Yandex\Allure\Adapter\Support\AttachmentSupport;
2828
use Magento\FunctionalTestingFramework\Exceptions\TestFrameworkException;
29-
use Magento\FunctionalTestingFramework\DataGenerator\Handlers\PersistedObjectHandler;
3029

3130
/**
3231
* MagentoWebDriver module provides common Magento web actions through Selenium WebDriver.
@@ -953,120 +952,6 @@ public function getOTP()
953952
return OTP::getOTP();
954953
}
955954

956-
/**
957-
* Create an entity
958-
* TODO: move this function to MagentoActionProxies after MQE-1904
959-
*
960-
* @param string $key StepKey of the createData action.
961-
* @param string $scope
962-
* @param string $entity Name of xml entity to create.
963-
* @param array $dependentObjectKeys StepKeys of other createData actions that are required.
964-
* @param array $overrideFields Array of FieldName => Value of override fields.
965-
* @param string $storeCode
966-
* @return void
967-
*/
968-
public function createEntity(
969-
$key,
970-
$scope,
971-
$entity,
972-
$dependentObjectKeys = [],
973-
$overrideFields = [],
974-
$storeCode = ''
975-
) {
976-
PersistedObjectHandler::getInstance()->createEntity(
977-
$key,
978-
$scope,
979-
$entity,
980-
$dependentObjectKeys,
981-
$overrideFields,
982-
$storeCode
983-
);
984-
}
985-
986-
/**
987-
* Retrieves and updates a previously created entity
988-
* TODO: move this function to MagentoActionProxies after MQE-1904
989-
*
990-
* @param string $key StepKey of the createData action.
991-
* @param string $scope
992-
* @param string $updateEntity Name of the static XML data to update the entity with.
993-
* @param array $dependentObjectKeys StepKeys of other createData actions that are required.
994-
* @return void
995-
*/
996-
public function updateEntity($key, $scope, $updateEntity, $dependentObjectKeys = [])
997-
{
998-
PersistedObjectHandler::getInstance()->updateEntity(
999-
$key,
1000-
$scope,
1001-
$updateEntity,
1002-
$dependentObjectKeys
1003-
);
1004-
}
1005-
1006-
/**
1007-
* Performs GET on given entity and stores entity for use
1008-
* TODO: move this function to MagentoActionProxies after MQE-1904
1009-
*
1010-
* @param string $key StepKey of getData action.
1011-
* @param string $scope
1012-
* @param string $entity Name of XML static data to use.
1013-
* @param array $dependentObjectKeys StepKeys of other createData actions that are required.
1014-
* @param string $storeCode
1015-
* @param integer $index
1016-
* @return void
1017-
*/
1018-
public function getEntity($key, $scope, $entity, $dependentObjectKeys = [], $storeCode = '', $index = null)
1019-
{
1020-
PersistedObjectHandler::getInstance()->getEntity(
1021-
$key,
1022-
$scope,
1023-
$entity,
1024-
$dependentObjectKeys,
1025-
$storeCode,
1026-
$index
1027-
);
1028-
}
1029-
1030-
/**
1031-
* Retrieves and deletes a previously created entity
1032-
* TODO: move this function to MagentoActionProxies after MQE-1904
1033-
*
1034-
* @param string $key StepKey of the createData action.
1035-
* @param string $scope
1036-
* @return void
1037-
*/
1038-
public function deleteEntity($key, $scope)
1039-
{
1040-
PersistedObjectHandler::getInstance()->deleteEntity($key, $scope);
1041-
}
1042-
1043-
/**
1044-
* Retrieves a field from an entity, according to key and scope given
1045-
* TODO: move this function to MagentoActionProxies after MQE-1904
1046-
*
1047-
* @param string $stepKey
1048-
* @param string $field
1049-
* @param string $scope
1050-
* @return string
1051-
*/
1052-
public function retrieveEntityField($stepKey, $field, $scope)
1053-
{
1054-
return PersistedObjectHandler::getInstance()->retrieveEntityField($stepKey, $field, $scope);
1055-
}
1056-
1057-
/**
1058-
* Get encrypted value by key
1059-
* TODO: move this function to MagentoActionProxies after MQE-1904
1060-
*
1061-
* @param string $key
1062-
* @return string|null
1063-
* @throws TestFrameworkException
1064-
*/
1065-
public function getSecret($key)
1066-
{
1067-
return CredentialStore::getInstance()->getSecret($key);
1068-
}
1069-
1070955
/**
1071956
* Waits proper amount of time to perform Cron execution
1072957
*

0 commit comments

Comments
 (0)