Skip to content

Commit 22f53db

Browse files
committed
Merge remote-tracking branch 'origin/2.3-develop' into MC-17269
# Conflicts: # app/code/Magento/Backend/Test/Mftf/ActionGroup/SetAdminAccountActionGroup.xml
2 parents af07d6e + dc2e73a commit 22f53db

File tree

268 files changed

+10624
-1398
lines changed

Some content is hidden

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

268 files changed

+10624
-1398
lines changed

app/code/Magento/Backend/Test/Mftf/ActionGroup/SetAdminAccountActionGroup.xml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,16 @@
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
1111
<actionGroup name="SetAdminAccountActionGroup">
1212
<arguments>
13-
<argument name="InterfaceLocaleByValue" type="string"/>
13+
<argument name="InterfaceLocaleByValue" defaultValue="en_US" type="string"/>
1414
</arguments>
1515
<!-- Navigate to admin System Account Page-->
1616
<amOnPage url="{{AdminSystemAccountPage.url}}" stepKey="openAdminSystemAccountPage" />
1717
<waitForElementVisible selector="{{AdminSystemAccountSection.interfaceLocale}}" stepKey="waitForInterfaceLocale"/>
18+
<!-- Change Admin locale to Français (France) / French (France) -->
1819
<selectOption userInput="{{InterfaceLocaleByValue}}" selector="{{AdminSystemAccountSection.interfaceLocale}}" stepKey="setInterfaceLocate"/>
1920
<fillField selector="{{AdminSystemAccountSection.currentPassword}}" userInput="{{_ENV.MAGENTO_ADMIN_PASSWORD}}" stepKey="fillPassword"/>
2021
<click selector="{{AdminMainActionsSection.save}}" stepKey="clickSave"/>
21-
<waitForElement selector="{{AdminMessagesSection.successMessage}}" stepKey="waitSuccessMessage"/>
22-
<see selector="{{AdminMessagesSection.successMessage}}" userInput="You saved the account." stepKey="seeSuccessMessage"/>
22+
<waitForElementVisible selector="{{AdminMessagesSection.success}}" stepKey="waitSuccessMessage"/>
23+
<see selector="{{AdminMessagesSection.success}}" userInput="You saved the account." stepKey="seeSuccessMessage"/>
2324
</actionGroup>
2425
</actionGroups>
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
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="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd">
11+
<entity name="ChangedCookieDomainForMainWebsiteConfigData">
12+
<data key="path">web/cookie/cookie_domain</data>
13+
<data key="scope">website</data>
14+
<data key="scope_code">base</data>
15+
<data key="value">testDomain.com</data>
16+
</entity>
17+
<entity name="EmptyCookieDomainForMainWebsiteConfigData">
18+
<data key="path">web/cookie/cookie_domain</data>
19+
<data key="scope">website</data>
20+
<data key="scope_code">base</data>
21+
<data key="value">''</data>
22+
</entity>
23+
</entities>
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
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="urn:magento:mftf:Test/etc/testSchema.xsd">
11+
<test name="AdminLoginAfterChangeCookieDomainTest">
12+
<annotations>
13+
<features value="Backend"/>
14+
<stories value="Login on the Admin Backend"/>
15+
<title value="Admin user can login after changing cookie domain on main website scope without changing cookie domain on default scope"/>
16+
<description value="Admin user can login after changing cookie domain on main website scope without changing cookie domain on default scope"/>
17+
<severity value="CRITICAL"/>
18+
<testCaseId value="MC-17847"/>
19+
<useCaseId value="MC-17275"/>
20+
<group value="backend"/>
21+
</annotations>
22+
<before>
23+
<magentoCLI command="config:set {{ChangedCookieDomainForMainWebsiteConfigData.path}} --scope={{ChangedCookieDomainForMainWebsiteConfigData.scope}} --scope-code={{ChangedCookieDomainForMainWebsiteConfigData.scope_code}} {{ChangedCookieDomainForMainWebsiteConfigData.value}}" stepKey="changeDomainForMainWebsiteBeforeTestRun"/>
24+
<magentoCLI command="cache:flush config" stepKey="flushCacheBeforeTestRun"/>
25+
</before>
26+
<after>
27+
<magentoCLI command="config:set {{EmptyCookieDomainForMainWebsiteConfigData.path}} --scope={{EmptyCookieDomainForMainWebsiteConfigData.scope}} --scope-code={{EmptyCookieDomainForMainWebsiteConfigData.scope_code}} {{EmptyCookieDomainForMainWebsiteConfigData.value}}" stepKey="changeDomainForMainWebsiteAfterTestComplete"/>
28+
<magentoCLI command="cache:flush config" stepKey="flushCacheAfterTestComplete"/>
29+
</after>
30+
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
31+
<actionGroup ref="AssertAdminDashboardPageIsVisibleActionGroup" stepKey="seeDashboardPage"/>
32+
<actionGroup ref="logout" stepKey="logoutFromAdmin"/>
33+
</test>
34+
</tests>

app/code/Magento/Backend/etc/adminhtml/di.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@
8686
<arguments>
8787
<argument name="lifetimePath" xsi:type="const">Magento\Backend\Model\Auth\Session::XML_PATH_SESSION_LIFETIME</argument>
8888
<argument name="sessionName" xsi:type="const">Magento\Backend\Model\Session\AdminConfig::SESSION_NAME_ADMIN</argument>
89+
<argument name="scopeType" xsi:type="const">Magento\Framework\App\Config\ScopeConfigInterface::SCOPE_TYPE_DEFAULT</argument>
8990
</arguments>
9091
</type>
9192
<type name="Magento\Framework\View\Result\PageFactory">

app/code/Magento/Backend/view/adminhtml/templates/widget/form/renderer/fieldset.phtml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@ if ($isField) {
5353

5454
<?php if (!$element->getNoContainer()) : ?>
5555
<fieldset class="<?= $block->escapeHtmlAttr($cssClass) ?>" id="<?= $block->escapeHtmlAttr($id) ?>">
56+
<?php if (strlen($element->getBeforeElementHtml())) : ?>
57+
<?= $element->getBeforeElementHtml() ?>
58+
<?php endif ?>
5659
<?php if ($element->getLegend() && !$isWrapped) : ?>
5760
<legend class="<?= /* @noEscape */ $isField ? 'label admin__field-label' : 'admin__legend legend' ?>">
5861
<span><?= $block->escapeHtml($element->getLegend()) ?></span>

app/code/Magento/Braintree/Model/LocaleResolver.php

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
use Magento\Framework\Locale\ResolverInterface;
99
use Magento\Braintree\Gateway\Config\PayPal\Config;
1010

11+
/**
12+
* Resolves locale for PayPal Express.
13+
*/
1114
class LocaleResolver implements ResolverInterface
1215
{
1316
/**
@@ -20,6 +23,17 @@ class LocaleResolver implements ResolverInterface
2023
*/
2124
private $config;
2225

26+
/**
27+
* Mapping Magento locales on PayPal locales.
28+
*
29+
* @var array
30+
*/
31+
private $localeMap = [
32+
'zh_Hans_CN' => 'zh_CN',
33+
'zh_Hant_HK' => 'zh_HK',
34+
'zh_Hant_TW' => 'zh_TW'
35+
];
36+
2337
/**
2438
* @param ResolverInterface $resolver
2539
* @param Config $config
@@ -66,10 +80,11 @@ public function setLocale($locale = null)
6680
* Gets store's locale or the `en_US` locale if store's locale does not supported by PayPal.
6781
*
6882
* @return string
83+
* @see https://braintree.github.io/braintree-web/current/PayPalCheckout.html#createPayment
6984
*/
7085
public function getLocale()
7186
{
72-
$locale = $this->resolver->getLocale();
87+
$locale = $this->localeMap[$this->resolver->getLocale()] ?? $this->resolver->getLocale();
7388
$allowedLocales = $this->config->getValue('supported_locales');
7489

7590
return strpos($allowedLocales, $locale) !== false ? $locale : 'en_US';

app/code/Magento/Braintree/Test/Mftf/ActionGroup/ConfigureBraintreeActionGroup.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
-->
88
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
99
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
10-
10+
<!-- Skip by MQE-1576 -->
1111
<actionGroup name="ConfigureBraintree">
1212
<!-- GoTo ConfigureBraintree fields -->
1313
<click stepKey="clickOnSTORES" selector="{{AdminMenuSection.stores}}"/>
@@ -50,4 +50,4 @@
5050
<magentoCLI stepKey="disableBrainTree" command="config:set payment/braintree/active 0"/>
5151
<magentoCLI stepKey="disableBrainTreePaypal" command="config:set payment/braintree_paypal/active 0"/>
5252
</actionGroup>
53-
</actionGroups>
53+
</actionGroups>

app/code/Magento/Braintree/Test/Mftf/Data/BraintreeData.xml

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@
66
*/
77
-->
88

9-
<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10-
xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd">
9+
<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd">
1110
<entity name="SampleBraintreeConfig" type="braintree_config_state">
1211
<requiredEntity type="title">SampleTitle</requiredEntity>
1312
<requiredEntity type="payment_action">SamplePaymentAction</requiredEntity>
@@ -54,13 +53,13 @@
5453
<data key="value">sandbox</data>
5554
</entity>
5655
<entity name="MerchantId" type="merchant_id">
57-
<data key="value">d4pdjhxgjfrsmzbf</data>
56+
<data key="value">MERCH_ID</data>
5857
</entity>
5958
<entity name="PublicKey" type="public_key">
60-
<data key="value">m7q4wmh43xrgyrst</data>
59+
<data key="value">PUBLIC_KEY</data>
6160
</entity>
6261
<entity name="PrivateKey" type="private_key">
63-
<data key="value">67de364080b1b4e2492d7a3de413a572</data>
62+
<data key="value">PRIVATE_KEY</data>
6463
</entity>
6564

6665
<!-- default configuration used to restore Magento config -->
@@ -138,14 +137,17 @@
138137
<data key="year">20</data>
139138
<data key="cvv">113</data>
140139
</entity>
140+
<entity name="StoredPaymentMethods">
141+
<data key="cardNumberEnding">5100</data>
142+
<data key="cardExpire">12/2020</data>
143+
</entity>
141144

142145
<entity name="BraintreeConfigurationData" type="data">
143146
<data key="title">Credit Card (Braintree)</data>
144-
<data key="merchantID">d4pdjhxgjfrsmzbf</data>
145-
<data key="publicKey">m7q4wmh43xrgyrst</data>
146-
<data key="privateKey">67de364080b1b4e2492d7a3de413a572</data>
147-
<data key="merchantAccountID">Magneto</data>
147+
<data key="merchantID">MERCH_ID</data>
148+
<data key="publicKey">PUBLIC_KEY</data>
149+
<data key="privateKey">PRIVATE_KEY</data>
150+
<data key="merchantAccountID">MERCH_ACCOUNT_ID</data>
148151
<data key="titleForPayPalThroughBraintree">PayPal (Braintree)</data>
149152
</entity>
150-
151153
</entities>

app/code/Magento/Braintree/Test/Mftf/Test/BraintreeCreditCardOnCheckoutTest.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717
<severity value="MAJOR"/>
1818
<testCaseId value="MAGETWO-93767"/>
1919
<group value="braintree"/>
20+
<skip>
21+
<issueId value="MQE-1576"/>
22+
</skip>
2023
</annotations>
2124

2225
<before>

app/code/Magento/Braintree/Test/Mftf/Test/CreateAnAdminOrderUsingBraintreePaymentTest1.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717
<severity value="CRITICAL"/>
1818
<testCaseId value="MAGETWO-93677"/>
1919
<group value="braintree"/>
20+
<skip>
21+
<issueId value="MQE-1576"/>
22+
</skip>
2023
</annotations>
2124

2225

0 commit comments

Comments
 (0)