Skip to content

Commit 7d385ce

Browse files
committed
Merge remote-tracking branch 'origin/develop' into bugfix/55-missing-url-attribute
# Conflicts: # src/Magento/FunctionalTestingFramework/Test/Objects/ActionObject.php
2 parents c8a8ba9 + fc598db commit 7d385ce

File tree

153 files changed

+2489
-378
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

153 files changed

+2489
-378
lines changed

composer.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@
1111
"require": {
1212
"php": "7.0.2||7.0.4||~7.0.6||~7.1.0||~7.2.0||~7.3.0",
1313
"ext-curl": "*",
14+
"ext-json": "*",
15+
"ext-openssl": "*",
1416
"allure-framework/allure-codeception": "~1.3.0",
17+
"aws/aws-sdk-php": "^3.132",
1518
"codeception/codeception": "~2.4.5",
1619
"composer/composer": "^1.4",
1720
"consolidation/robo": "^1.0.0",

composer.lock

Lines changed: 146 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="../../../../../../../src/Magento/FunctionalTestingFramework/Test/etc/actionGroupSchema.xsd">
10+
<actionGroup name="DeprecatedCommentActionGroup" deprecated="This Action Group is outdated and will be deleted next release.">
11+
<comment userInput="Action group to demonstrate deprecation notices." stepKey="comment" />
12+
</actionGroup>
13+
</actionGroups>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="../../../../../../../src/Magento/FunctionalTestingFramework/DataGenerator/etc/dataProfileSchema.xsd">
11+
<entity name="DeprecatedMessageData" deprecated="Entity is deprecated. Please use 'MessageData'.">
12+
<data key="message">Introduction to the Magento Functional Testing Framework</data>
13+
</entity>
14+
</entities>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="../../../../../../../src/Magento/FunctionalTestingFramework/DataGenerator/etc/dataProfileSchema.xsd">
11+
<entity name="MessageData">
12+
<data key="message">Introduction to the Magento Functional Testing Framework</data>
13+
</entity>
14+
</entities>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="../../../../../../../src/Magento/FunctionalTestingFramework/Page/etc/PageObject.xsd">
11+
<page name="DeprecatedMFTFDocPage" url="mftf/docs/introduction.html" area="storefront" module="MFTF_DevDocs" deprecated="New page was introduced. Please use 'MFTFDocPage'">
12+
<section name="contentSection" />
13+
</page>
14+
</pages>

dev/tests/functional/tests/MFTF/DevDocs/Section/ContentSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,6 @@
1010
xsi:noNamespaceSchemaLocation="../../../../../../../src/Magento/FunctionalTestingFramework/Page/etc/SectionObject.xsd">
1111
<section name="contentSection">
1212
<element name="pageIntro" type="text" selector=".page-intro"/>
13+
<element name="deprecatedPageIntro" type="text" selector=".page-intro-old" deprecated="New element was introduced. Please use 'contentSection.pageIntro'"/>
1314
</section>
1415
</sections>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="../../../../../../../src/Magento/FunctionalTestingFramework/Page/etc/SectionObject.xsd">
11+
<section name="DeprecatedContentSection" deprecated="New section was introduces. Please use 'contentSection'">
12+
<element name="pageIntro" type="text" selector=".page-intro"/>
13+
</section>
14+
</sections>
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="../../../../../../../src/Magento/FunctionalTestingFramework/Test/etc/testSchema.xsd">
11+
<test name="DeprecatedDevDocsTest" deprecated="Test is deprecated due to more stable test was introduces. Please use 'DevDocsTest'.">
12+
<annotations>
13+
<!-- Comment in Annotations for DevDocs Test are not affecting test generation -->
14+
<features value="DevDocs available"/>
15+
<stories value="[Deprecated] MFTF DevDocs available"/>
16+
<title value="[Deprecated] Magento Functional Testing Framework Documentation is available."/>
17+
<description value="[Deprecated] Magento Functional Testing Framework Documentation is available."/>
18+
<severity value="CRITICAL"/>
19+
<group value="mftf"/>
20+
</annotations>
21+
22+
<!-- Open MFTF DevDocs Page -->
23+
<amOnPage stepKey="openMFTFDevDocPage" url="{{DeprecatedMFTFDocPage.url}}" />
24+
<see stepKey="verifyPageIntroText" selector="{{DeprecatedContentSection.pageIntro}}" userInput="{{DeprecatedMessageData.message}}" />
25+
<actionGroup ref="DeprecatedCommentActionGroup" stepKey="commentActionGroup" />
26+
</test>
27+
</tests>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@
2121

2222
<!-- Open MFTF DevDocs Page -->
2323
<amOnPage stepKey="openMFTFDevDocPage" url="{{MFTFDocPage.url}}" />
24-
<see stepKey="verifyPageIntroText" selector="{{contentSection.pageIntro}}" userInput="Introduction to the Magento Functional Testing Framework" />
24+
<see stepKey="verifyPageIntroText" selector="{{contentSection.pageIntro}}" userInput="{{MessageData.message}}" />
2525
</test>
2626
</tests>

dev/tests/unit/Magento/FunctionalTestFramework/Console/BaseGenerateCommandTest.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,24 @@ public function testThreeTestOneSuiteOneGroupMix()
156156
$this->assertEquals($expected, $actual);
157157
}
158158

159+
public function testSuiteToTestSyntax()
160+
{
161+
$testOne = new TestObject('Test1', [], [], []);
162+
$suiteOne = new SuiteObject(
163+
'Suite1',
164+
['Test1' => $testOne],
165+
[],
166+
[]
167+
);
168+
169+
$testArray = ['Test1' => $testOne];
170+
$suiteArray = ['Suite1' => $suiteOne];
171+
$this->mockHandlers($testArray, $suiteArray);
172+
$actual = json_decode($this->callTestConfig(['Suite1:Test1']), true);
173+
$expected = ['tests' => null, 'suites' => ['Suite1' => ['Test1']]];
174+
$this->assertEquals($expected, $actual);
175+
}
176+
159177
/**
160178
* Mock handlers to skip parsing
161179
* @param array $testArray
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
7+
namespace tests\unit\Magento\FunctionalTestFramework\DataGenerator\Handlers\SecretStorage;
8+
9+
use Aws\SecretsManager\SecretsManagerClient;
10+
use Magento\FunctionalTestingFramework\DataGenerator\Handlers\SecretStorage\AwsSecretsManagerStorage;
11+
use Aws\Result;
12+
use Magento\FunctionalTestingFramework\Util\MagentoTestCase;
13+
use ReflectionClass;
14+
15+
class AwsSecretsManagerStorageTest extends MagentoTestCase
16+
{
17+
/**
18+
* Test encryption/decryption functionality in AwsSecretsManagerStorage class.
19+
*/
20+
public function testEncryptAndDecrypt()
21+
{
22+
// Setup test data
23+
$testProfile = 'profile';
24+
$testRegion = 'region';
25+
$testLongKey = 'magento/myKey';
26+
$testShortKey = 'myKey';
27+
$testValue = 'myValue';
28+
$data = [
29+
'Name' => 'mftf/magento/' . $testShortKey,
30+
'SecretString' => json_encode([$testShortKey => $testValue])
31+
];
32+
/** @var Result */
33+
$result = new Result($data);
34+
35+
$mockClient = $this->getMockBuilder(SecretsManagerClient::class)
36+
->disableOriginalConstructor()
37+
->setMethods(['__call'])
38+
->getMock();
39+
40+
$mockClient->expects($this->once())
41+
->method('__call')
42+
->willReturnCallback(function ($name, $args) use ($result) {
43+
return $result;
44+
});
45+
46+
/** @var SecretsManagerClient */
47+
$credentialStorage = new AwsSecretsManagerStorage($testRegion, $testProfile);
48+
$reflection = new ReflectionClass($credentialStorage);
49+
$reflection_property = $reflection->getProperty('client');
50+
$reflection_property->setAccessible(true);
51+
$reflection_property->setValue($credentialStorage, $mockClient);
52+
53+
// Test getEncryptedValue()
54+
$encryptedCred = $credentialStorage->getEncryptedValue($testLongKey);
55+
56+
// Assert the value we've gotten is in fact not identical to our test value
57+
$this->assertNotEquals($testValue, $encryptedCred);
58+
59+
// Test getDecryptedValue()
60+
$actualValue = $credentialStorage->getDecryptedValue($encryptedCred);
61+
62+
// Assert that we are able to successfully decrypt our secret value
63+
$this->assertEquals($testValue, $actualValue);
64+
}
65+
}

0 commit comments

Comments
 (0)