Skip to content

Commit daf9970

Browse files
authored
Merge pull request #241 from magento-gl/3.11.1-RC
ACQE-3401 : 3.11.1 RC
2 parents af9708a + f94fe88 commit daf9970

File tree

10 files changed

+33
-25
lines changed

10 files changed

+33
-25
lines changed

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@ dev/tests/functional.suite.yml
2222
/v2/
2323
dev/.credentials.example
2424
dev/tests/.phpunit.result.cache
25-
dev/tests/verification/TestModule/Test/testFile.xml
25+
dev/tests/verification/TestModule/Test/testFile.xml

CHANGELOG.md

+8
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
Magento Functional Testing Framework Changelog
22
================================================
33

4+
3.11.1
5+
---------
6+
7+
### Fixes
8+
9+
* Removed environment variable MAGENTO_ADMIN_PASSWORD
10+
* Fixed WaitForElementClickable action cannot be used more than once
11+
412
3.11.0
513
---------
614
### Enhancements

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "magento/magento2-functional-testing-framework",
33
"description": "Magento2 Functional Testing Framework",
44
"type": "library",
5-
"version": "3.11.0",
5+
"version": "3.11.1",
66
"license": "AGPL-3.0",
77
"keywords": ["magento", "automation", "functional", "testing"],
88
"config": {

composer.lock

+2-6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/configuration.md

+1-11
Original file line numberDiff line numberDiff line change
@@ -52,16 +52,6 @@ Example:
5252
MAGENTO_ADMIN_USERNAME=admin
5353
```
5454

55-
### MAGENTO_ADMIN_PASSWORD
56-
57-
The password that tests will use to log in to the Magento Admin page.
58-
59-
Example:
60-
61-
```conf
62-
MAGENTO_ADMIN_PASSWORD=1234reTyt%$7
63-
```
64-
6555
## Advanced configuration
6656

6757
Depending on the environment you use, you may need to configure MFTF more precisely by setting additional configuration parameters.
@@ -362,7 +352,7 @@ WAIT_TIMEOUT=30
362352
### ENABLE_PAUSE
363353

364354
Enables the ability to pause test execution at any point, and enter an interactive shell where you can try commands in action.
365-
When pause is enabled, MFTF will generate pause() command in _failed() hook so that test will pause execution when failed.
355+
When pause is enabled, MFTF will generate pause() command in _failed() hook so that test will pause execution when failed.
366356

367357
```conf
368358
ENABLE_PAUSE=true

etc/config/.env.example

-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ MAGENTO_BASE_URL=http://devdocs.magento.com/
1010
#*** Set the Admin Username and Password for your Magento instance ***#
1111
MAGENTO_BACKEND_NAME=admin
1212
MAGENTO_ADMIN_USERNAME=admin
13-
MAGENTO_ADMIN_PASSWORD=123123q
1413

1514
#*** Path to CLI entry point and command parameter name. Uncomment and change if folder structure differs from standard Magento installation
1615
#MAGENTO_CLI_COMMAND_PATH=dev/tests/acceptance/utils/command.php

etc/di.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
<!-- Entity value gets replaced in Dom.php before reading $xml -->
1010
<!DOCTYPE config [
11-
<!ENTITY commonTestActions "acceptPopup|actionGroup|amOnPage|amOnUrl|amOnSubdomain|appendField|assertArrayIsSortasserted|assertElementContainsAttribute|attachFile|cancelPopup|checkOption|clearField|click|clickWithLeftButton|clickWithRightButton|closeAdminNotification|closeTab|comment|conditionalClick|createData|deleteData|updateData|getData|dontSee|dontSeeJsError|dontSeeCheckboxIsChecked|dontSeeCookie|dontSeeCurrentUrlEquals|dontSeeCurrentUrlMatches|dontSeeElement|dontSeeElementInDOM|dontSeeInCurrentUrl|dontSeeInField|dontSeeInFormFields|dontSeeInPageSource|dontSeeInSource|dontSeeInTitle|dontSeeLink|dontSeeOptionIsSelected|doubleClick|dragAndDrop|entity|executeJS|fillField|formatCurrency|generateDate|getOTP|grabAttributeFrom|grabCookie|grabCookieAttributes|grabFromCurrentUrl|grabMultiple|grabPageSource|grabTextFrom|grabValueFrom|return|loadSessionSnapshot|loginAsAdmin|magentoCLI|magentoCron|makeScreenshot|maximizeWindow|moveBack|moveForward|moveMouseOver|mSetLocale|mResetLocale|openNewTab|pause|parseFloat|pressKey|reloadPage|resetCookie|submitForm|resizeWindow|saveSessionSnapshot|scrollTo|scrollToTopOfPage|searchAndMultiSelectOption|see|seeCheckboxIsChecked|seeCookie|seeCurrentUrlEquals|seeCurrentUrlMatches|seeElement|seeElementInDOM|seeInCurrentUrl|seeInField|seeInFormFields|seeInPageSource|seeInPopup|seeInSource|seeInTitle|seeLink|seeNumberOfElements|seeOptionIsSelected|selectOption|setCookie|submitForm|switchToIFrame|switchToNextTab|switchToPreviousTab|switchToWindow|typeInPopup|uncheckOption|unselectOption|wait|waitForAjaxLoad|waitForElement|waitForElementChange|waitForElementNotVisible|waitForElementVisible|waitForPwaElementNotVisible|waitForPwaElementVisible|waitForJS|waitForLoadingMaskToDisappear|waitForPageLoad|waitForText|assertArrayHasKey|assertArrayNotHasKey|assertContains|assertStringContainsString|assertStringContainsStringIgnoringCase|assertCount|assertEmpty|assertEquals|assertFalse|assertFileExists|assertFileNotExists|assertGreaterOrEquals|assertGreaterThan|assertGreaterThanOrEqual|assertInstanceOf|assertIsEmpty|assertLessOrEquals|assertLessThan|assertLessThanOrEqual|assertNotContains|assertStringNotContainsString|assertStringNotContainsStringIgnoringCase|assertNotEmpty|assertNotEquals|assertNotInstanceOf|assertNotNull|assertNotRegExp|assertNotSame|assertNull|assertRegExp|assertSame|assertStringStartsNotWith|assertStringStartsWith|assertTrue|expectException|fail|dontSeeFullUrlEquals|dontSee|dontSeeFullUrlMatches|dontSeeInFullUrl|seeFullUrlEquals|seeFullUrlMatches|seeInFullUrl|grabFromFullUrl|helper|assertEqualsWithDelta|assertEqualsCanonicalizing|assertEqualsIgnoringCase|assertNotEqualsWithDelta|assertNotEqualsCanonicalizing|assertNotEqualsIgnoringCase">
11+
<!ENTITY commonTestActions "acceptPopup|actionGroup|amOnPage|amOnUrl|amOnSubdomain|appendField|assertArrayIsSortasserted|assertElementContainsAttribute|attachFile|cancelPopup|checkOption|clearField|click|clickWithLeftButton|clickWithRightButton|closeAdminNotification|closeTab|comment|conditionalClick|createData|deleteData|updateData|getData|dontSee|dontSeeJsError|dontSeeCheckboxIsChecked|dontSeeCookie|dontSeeCurrentUrlEquals|dontSeeCurrentUrlMatches|dontSeeElement|dontSeeElementInDOM|dontSeeInCurrentUrl|dontSeeInField|dontSeeInFormFields|dontSeeInPageSource|dontSeeInSource|dontSeeInTitle|dontSeeLink|dontSeeOptionIsSelected|doubleClick|dragAndDrop|entity|executeJS|fillField|formatCurrency|generateDate|getOTP|grabAttributeFrom|grabCookie|grabCookieAttributes|grabFromCurrentUrl|grabMultiple|grabPageSource|grabTextFrom|grabValueFrom|return|loadSessionSnapshot|loginAsAdmin|magentoCLI|magentoCron|makeScreenshot|maximizeWindow|moveBack|moveForward|moveMouseOver|mSetLocale|mResetLocale|openNewTab|pause|parseFloat|pressKey|reloadPage|resetCookie|submitForm|resizeWindow|saveSessionSnapshot|scrollTo|scrollToTopOfPage|searchAndMultiSelectOption|see|seeCheckboxIsChecked|seeCookie|seeCurrentUrlEquals|seeCurrentUrlMatches|seeElement|seeElementInDOM|seeInCurrentUrl|seeInField|seeInFormFields|seeInPageSource|seeInPopup|seeInSource|seeInTitle|seeLink|seeNumberOfElements|seeOptionIsSelected|selectOption|setCookie|submitForm|switchToIFrame|switchToNextTab|switchToPreviousTab|switchToWindow|typeInPopup|uncheckOption|unselectOption|wait|waitForAjaxLoad|waitForElement|waitForElementChange|waitForElementNotVisible|waitForElementVisible|waitForPwaElementNotVisible|waitForPwaElementVisible|waitForElementClickable|waitForJS|waitForLoadingMaskToDisappear|waitForPageLoad|waitForText|assertArrayHasKey|assertArrayNotHasKey|assertContains|assertStringContainsString|assertStringContainsStringIgnoringCase|assertCount|assertEmpty|assertEquals|assertFalse|assertFileExists|assertFileNotExists|assertGreaterOrEquals|assertGreaterThan|assertGreaterThanOrEqual|assertInstanceOf|assertIsEmpty|assertLessOrEquals|assertLessThan|assertLessThanOrEqual|assertNotContains|assertStringNotContainsString|assertStringNotContainsStringIgnoringCase|assertNotEmpty|assertNotEquals|assertNotInstanceOf|assertNotNull|assertNotRegExp|assertNotSame|assertNull|assertRegExp|assertSame|assertStringStartsNotWith|assertStringStartsWith|assertTrue|expectException|fail|dontSeeFullUrlEquals|dontSee|dontSeeFullUrlMatches|dontSeeInFullUrl|seeFullUrlEquals|seeFullUrlMatches|seeInFullUrl|grabFromFullUrl|helper|assertEqualsWithDelta|assertEqualsCanonicalizing|assertEqualsIgnoringCase|assertNotEqualsWithDelta|assertNotEqualsCanonicalizing|assertNotEqualsIgnoringCase">
1212
]>
1313

1414
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../src/Magento/FunctionalTestingFramework/ObjectManager/etc/config.xsd">

src/Magento/FunctionalTestingFramework/DataTransport/AdminFormExecutor.php

+4-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
namespace Magento\FunctionalTestingFramework\DataTransport;
88

9+
use Magento\FunctionalTestingFramework\DataGenerator\Handlers\CredentialStore;
910
use Magento\FunctionalTestingFramework\Util\MftfGlobals;
1011
use Magento\FunctionalTestingFramework\DataTransport\Protocol\CurlInterface;
1112
use Magento\FunctionalTestingFramework\DataTransport\Protocol\CurlTransport;
@@ -73,9 +74,11 @@ private function authorize()
7374

7475
// Authenticate admin user
7576
$authUrl = MftfGlobals::getBackendBaseUrl() . 'admin/auth/login/';
77+
$encryptedSecret = CredentialStore::getInstance()->getSecret('magento/MAGENTO_ADMIN_PASSWORD');
78+
$secret = CredentialStore::getInstance()->decryptSecretValue($encryptedSecret);
7679
$data = [
7780
'login[username]' => getenv('MAGENTO_ADMIN_USERNAME'),
78-
'login[password]' => getenv('MAGENTO_ADMIN_PASSWORD'),
81+
'login[password]' => $secret,
7982
'form_key' => $this->formKey,
8083
];
8184
$this->transport->write($authUrl, $data, CurlInterface::POST);

src/Magento/FunctionalTestingFramework/DataTransport/Auth/WebApiAuth.php

+11-2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
namespace Magento\FunctionalTestingFramework\DataTransport\Auth;
88

9+
use Magento\FunctionalTestingFramework\DataGenerator\Handlers\CredentialStore;
910
use Magento\FunctionalTestingFramework\Exceptions\FastFailException;
1011
use Magento\FunctionalTestingFramework\Util\MftfGlobals;
1112
use Magento\FunctionalTestingFramework\DataTransport\Protocol\CurlInterface;
@@ -53,18 +54,26 @@ class WebApiAuth
5354
* @throws FastFailException
5455
*
5556
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
57+
* @SuppressWarnings(PHPMD.NPathComplexity)
5658
*/
5759
public static function getAdminToken($username = null, $password = null)
5860
{
5961
$login = $username ?? getenv('MAGENTO_ADMIN_USERNAME');
60-
$password = $password ?? getenv('MAGENTO_ADMIN_PASSWORD');
62+
try {
63+
$encryptedSecret = CredentialStore::getInstance()->getSecret('magento/MAGENTO_ADMIN_PASSWORD');
64+
$secret = CredentialStore::getInstance()->decryptSecretValue($encryptedSecret);
65+
$password = $password ?? $secret;
66+
} catch (TestFrameworkException $e) {
67+
$message = "Password not found in credentials file";
68+
throw new FastFailException($message . $e->getMessage(), $e->getContext());
69+
}
6170
if (!$login || !$password) {
6271
$message = 'Cannot retrieve API token without credentials. Please fill out .env.';
6372
$context = [
6473
'MAGENTO_BASE_URL' => getenv('MAGENTO_BASE_URL'),
6574
'MAGENTO_BACKEND_BASE_URL' => getenv('MAGENTO_BACKEND_BASE_URL'),
6675
'MAGENTO_ADMIN_USERNAME' => getenv('MAGENTO_ADMIN_USERNAME'),
67-
'MAGENTO_ADMIN_PASSWORD' => getenv('MAGENTO_ADMIN_PASSWORD'),
76+
'MAGENTO_ADMIN_PASSWORD' => $secret,
6877
];
6978
throw new FastFailException($message, $context);
7079
}

src/Magento/FunctionalTestingFramework/Util/ModuleResolver.php

+4-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
namespace Magento\FunctionalTestingFramework\Util;
88

99
use Magento\FunctionalTestingFramework\Config\MftfApplicationConfig;
10+
use Magento\FunctionalTestingFramework\DataGenerator\Handlers\CredentialStore;
1011
use Magento\FunctionalTestingFramework\Exceptions\FastFailException;
1112
use Magento\FunctionalTestingFramework\Exceptions\TestFrameworkException;
1213
use Magento\FunctionalTestingFramework\Util\ModuleResolver\ModuleResolverService;
@@ -198,10 +199,12 @@ public function getEnabledModules()
198199

199200
if (!$response) {
200201
$message = "Could not retrieve Modules from Magento Instance.";
202+
$encryptedSecret = CredentialStore::getInstance()->getSecret('magento/MAGENTO_ADMIN_PASSWORD');
203+
$secret = CredentialStore::getInstance()->decryptSecretValue($encryptedSecret);
201204
$context = [
202205
"Admin Module List Url" => $url,
203206
"MAGENTO_ADMIN_USERNAME" => getenv("MAGENTO_ADMIN_USERNAME"),
204-
"MAGENTO_ADMIN_PASSWORD" => getenv("MAGENTO_ADMIN_PASSWORD"),
207+
"MAGENTO_ADMIN_PASSWORD" => $secret,
205208
];
206209
throw new FastFailException($message, $context);
207210
}

0 commit comments

Comments
 (0)