Skip to content

Commit 863e2bd

Browse files
authored
Merge pull request #3854 from magento-arcticfoxes/2.3.1-qwerty-pr
[2.3.1-qwerty] Sync with 2.3.1-release
2 parents c099de8 + 9c27f61 commit 863e2bd

File tree

25 files changed

+565
-342
lines changed

25 files changed

+565
-342
lines changed

app/code/Magento/AuthorizenetAcceptjs/etc/config.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,13 @@
77
-->
88
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd">
99
<default>
10+
<dev>
11+
<js>
12+
<minify_exclude>
13+
<authorizenet_acceptjs>\.authorize\.net/v1/Accept</authorizenet_acceptjs>
14+
</minify_exclude>
15+
</js>
16+
</dev>
1017
<payment>
1118
<authorizenet_acceptjs>
1219
<active>0</active>

app/code/Magento/AuthorizenetAcceptjs/view/base/requirejs-config.js

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,16 @@
44
*/
55

66
var config = {
7-
map: {
8-
'*': {
9-
acceptjssandbox: 'https://jstest.authorize.net/v1/Accept.js',
10-
acceptjs: 'https://js.authorize.net/v1/Accept.js'
7+
shim: {
8+
acceptjs: {
9+
exports: 'Accept'
10+
},
11+
acceptjssandbox: {
12+
exports: 'Accept'
1113
}
14+
},
15+
paths: {
16+
acceptjssandbox: 'https://jstest.authorize.net/v1/Accept',
17+
acceptjs: 'https://js.authorize.net/v1/Accept'
1218
}
1319
};

app/code/Magento/AuthorizenetAcceptjs/view/base/web/js/view/payment/acceptjs-factory.js

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ define([
1616
dependency = 'acceptjssandbox';
1717
}
1818

19-
require([dependency], function () {
19+
require([dependency], function (accept) {
2020
var $body = $('body');
2121

2222
/*
@@ -26,16 +26,7 @@ define([
2626
* Dynamically-loading-Accept-js-E-WC-03-Accept-js-is-not-loaded/td-p/63283
2727
*/
2828
$body.on('handshake.acceptjs', function () {
29-
/*
30-
* Accept.js doesn't return the library when loading
31-
* and requirejs "shim" can't be used because it only works with the "paths" config option
32-
* and we can't use "paths" because require will try to load ".min.js" in production
33-
* and that doesn't work because it doesn't exist
34-
* and we can't add a query string to force a URL because accept.js will reject it
35-
* and we can't include it locally because they check in the script before loading more scripts
36-
* So, we use the global version as "shim" would
37-
*/
38-
deferred.resolve(window.Accept);
29+
deferred.resolve(accept);
3930
$body.off('handshake.acceptjs');
4031
});
4132
},

app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontMiniCartActionGroup.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,11 @@
3535
<click selector="{{StoreFrontRemoveItemModalSection.ok}}" stepKey="confirmDelete"/>
3636
<waitForPageLoad stepKey="waitForDeleteToFinish"/>
3737
</actionGroup>
38+
39+
<!--Check that the minicart is empty-->
40+
<actionGroup name="assertMiniCartEmpty">
41+
<dontSeeElement selector="{{StorefrontMinicartSection.productCount}}" stepKey="dontSeeMinicartProductCount"/>
42+
<click selector="{{StorefrontMinicartSection.showCart}}" stepKey="expandMinicart"/>
43+
<see selector="{{StorefrontMinicartSection.minicartContent}}" userInput="You have no items in your shopping cart." stepKey="seeEmptyCartMessage"/>
44+
</actionGroup>
3845
</actionGroups>

app/code/Magento/Config/Model/Config.php

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -520,24 +520,29 @@ public function setDataByPath($path, $value)
520520
if ($path === '') {
521521
throw new \UnexpectedValueException('Path must not be empty');
522522
}
523+
523524
$pathParts = explode('/', $path);
524525
$keyDepth = count($pathParts);
525-
if ($keyDepth !== 3) {
526+
if ($keyDepth < 3) {
526527
throw new \UnexpectedValueException(
527-
"Allowed depth of configuration is 3 (<section>/<group>/<field>). Your configuration depth is "
528-
. $keyDepth . " for path '$path'"
528+
'Minimal depth of configuration is 3. Your configuration depth is ' . $keyDepth
529529
);
530530
}
531+
532+
$section = array_shift($pathParts);
531533
$data = [
532-
'section' => $pathParts[0],
533-
'groups' => [
534-
$pathParts[1] => [
535-
'fields' => [
536-
$pathParts[2] => ['value' => $value],
537-
],
538-
],
534+
'fields' => [
535+
array_pop($pathParts) => ['value' => $value],
539536
],
540537
];
538+
while ($pathParts) {
539+
$data = [
540+
'groups' => [
541+
array_pop($pathParts) => $data,
542+
],
543+
];
544+
}
545+
$data['section'] = $section;
541546
$this->addData($data);
542547
}
543548

app/code/Magento/Config/Test/Unit/Model/ConfigTest.php

Lines changed: 54 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -330,22 +330,59 @@ public function testSaveToCheckScopeDataSet()
330330
$this->model->save();
331331
}
332332

333-
public function testSetDataByPath()
333+
/**
334+
* @param string $path
335+
* @param string $value
336+
* @param string $section
337+
* @param array $groups
338+
* @dataProvider setDataByPathDataProvider
339+
*/
340+
public function testSetDataByPath(string $path, string $value, string $section, array $groups)
334341
{
335-
$value = 'value';
336-
$path = '<section>/<group>/<field>';
337342
$this->model->setDataByPath($path, $value);
338-
$expected = [
339-
'section' => '<section>',
340-
'groups' => [
341-
'<group>' => [
342-
'fields' => [
343-
'<field>' => ['value' => $value],
343+
$this->assertEquals($section, $this->model->getData('section'));
344+
$this->assertEquals($groups, $this->model->getData('groups'));
345+
}
346+
347+
/**
348+
* @return array
349+
*/
350+
public function setDataByPathDataProvider(): array
351+
{
352+
return [
353+
'depth 3' => [
354+
'a/b/c',
355+
'value1',
356+
'a',
357+
[
358+
'b' => [
359+
'fields' => [
360+
'c' => ['value' => 'value1'],
361+
],
362+
],
363+
],
364+
],
365+
'depth 5' => [
366+
'a/b/c/d/e',
367+
'value1',
368+
'a',
369+
[
370+
'b' => [
371+
'groups' => [
372+
'c' => [
373+
'groups' => [
374+
'd' => [
375+
'fields' => [
376+
'e' => ['value' => 'value1'],
377+
],
378+
],
379+
],
380+
],
381+
],
344382
],
345383
],
346384
],
347385
];
348-
$this->assertSame($expected, $this->model->getData());
349386
}
350387

351388
/**
@@ -359,14 +396,13 @@ public function testSetDataByPathEmpty()
359396

360397
/**
361398
* @param string $path
362-
* @param string $expectedException
363-
*
364399
* @dataProvider setDataByPathWrongDepthDataProvider
365400
*/
366-
public function testSetDataByPathWrongDepth($path, $expectedException)
401+
public function testSetDataByPathWrongDepth(string $path)
367402
{
368-
$expectedException = 'Allowed depth of configuration is 3 (<section>/<group>/<field>). ' . $expectedException;
369-
$this->expectException('\UnexpectedValueException');
403+
$currentDepth = count(explode('/', $path));
404+
$expectedException = 'Minimal depth of configuration is 3. Your configuration depth is ' . $currentDepth;
405+
$this->expectException(\UnexpectedValueException::class);
370406
$this->expectExceptionMessage($expectedException);
371407
$value = 'value';
372408
$this->model->setDataByPath($path, $value);
@@ -375,13 +411,11 @@ public function testSetDataByPathWrongDepth($path, $expectedException)
375411
/**
376412
* @return array
377413
*/
378-
public function setDataByPathWrongDepthDataProvider()
414+
public function setDataByPathWrongDepthDataProvider(): array
379415
{
380416
return [
381-
'depth 2' => ['section/group', "Your configuration depth is 2 for path 'section/group'"],
382-
'depth 1' => ['section', "Your configuration depth is 1 for path 'section'"],
383-
'depth 4' => ['section/group/field/sub-field', "Your configuration depth is 4 for path"
384-
. " 'section/group/field/sub-field'", ],
417+
'depth 2' => ['section/group'],
418+
'depth 1' => ['section'],
385419
];
386420
}
387421
}
Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
# Copyright © Magento, Inc. All rights reserved.
22
# See COPYING.txt for license details.
3-
type Mutation {
4-
addConfigurableProductsToCart(input: AddConfigurableProductsToCartInput): AddConfigurableProductsToCartOutput @resolver(class: "Magento\\QuoteGraphQl\\Model\\Resolver\\AddSimpleProductsToCart")
5-
}
63

74
type ConfigurableProduct implements ProductInterface, PhysicalProductInterface, CustomizableProductInterface @doc(description: "ConfigurableProduct defines basic features of a configurable product and its simple product variants") {
85
variants: [ConfigurableVariant] @doc(description: "An array of variants of products") @resolver(class: "Magento\\ConfigurableProductGraphQl\\Model\\Resolver\\ConfigurableVariant")
@@ -38,30 +35,3 @@ type ConfigurableProductOptionsValues @doc(description: "ConfigurableProductOpti
3835
store_label: String @doc(description: "The label of the product on the current store")
3936
use_default_value: Boolean @doc(description: "Indicates whether to use the default_label")
4037
}
41-
42-
input AddConfigurableProductsToCartInput {
43-
cart_id: String!
44-
cartItems: [ConfigurableProductCartItemInput!]!
45-
}
46-
47-
type AddConfigurableProductsToCartOutput {
48-
cart: Cart!
49-
}
50-
51-
input ConfigurableProductCartItemInput {
52-
data: CartItemDetailsInput!
53-
variant_sku: String!
54-
customizable_options:[CustomizableOptionInput!]
55-
}
56-
57-
type ConfigurableCartItem implements CartItemInterface {
58-
customizable_options: [SelectedCustomizableOption]!
59-
configurable_options: [SelectedConfigurableOption!]!
60-
}
61-
62-
type SelectedConfigurableOption {
63-
id: Int!
64-
option_label: String!
65-
value_id: Int!
66-
value_label: String!
67-
}

app/code/Magento/Paypal/Test/Mftf/ActionGroup/OpenPayPalButtonCheckoutPageActionGroup.xml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,15 @@
88
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
99
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
1010
<actionGroup name="OpenPayPalButtonCheckoutPage">
11-
<click selector="{{PayPalExpressCheckoutConfigSection.configureBtn}}" stepKey="clickPayPalConfigureBtn"/>
12-
<waitForElementVisible selector="{{PayPalAdvancedSettingConfigSection.advancedSettingTab}}" stepKey="waitForAdvancedSettingTab"/>
13-
<click selector="{{PayPalAdvancedSettingConfigSection.advancedSettingTab}}" stepKey="openAdvancedSettingTab"/>
14-
<waitForElementVisible selector="{{PayPalAdvancedSettingConfigSection.frontendExperienceSettingsTab}}" stepKey="waitForFrontendExperienceSettingsTab"/>
15-
<click selector="{{PayPalAdvancedSettingConfigSection.frontendExperienceSettingsTab}}" stepKey="openFrontendExperienceSettingsTab"/>
16-
<waitForElementVisible selector="{{PayPalAdvancedSettingConfigSection.checkoutPageTab}}" stepKey="waitForCheckoutPageTab"/>
17-
<click selector="{{PayPalAdvancedSettingConfigSection.checkoutPageTab}}" stepKey="openCheckoutPageTab"/>
11+
<arguments>
12+
<argument name="countryCode" type="string" defaultValue="us"/>
13+
</arguments>
14+
<click selector="{{PayPalExpressCheckoutConfigSection.configureBtn(countryCode)}}" stepKey="clickPayPalConfigureBtn"/>
15+
<waitForElementVisible selector="{{PayPalAdvancedSettingConfigSection.advancedSettingTab(countryCode)}}" stepKey="waitForAdvancedSettingTab"/>
16+
<click selector="{{PayPalAdvancedSettingConfigSection.advancedSettingTab(countryCode)}}" stepKey="openAdvancedSettingTab"/>
17+
<waitForElementVisible selector="{{PayPalAdvancedSettingConfigSection.frontendExperienceSettingsTab(countryCode)}}" stepKey="waitForFrontendExperienceSettingsTab"/>
18+
<click selector="{{PayPalAdvancedSettingConfigSection.frontendExperienceSettingsTab(countryCode)}}" stepKey="openFrontendExperienceSettingsTab"/>
19+
<waitForElementVisible selector="{{PayPalAdvancedSettingConfigSection.checkoutPageTab(countryCode)}}" stepKey="waitForCheckoutPageTab"/>
20+
<click selector="{{PayPalAdvancedSettingConfigSection.checkoutPageTab(countryCode)}}" stepKey="openCheckoutPageTab"/>
1821
</actionGroup>
1922
</actionGroups>
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
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="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
10+
<actionGroup name="EnablePayPalConfiguration">
11+
<arguments>
12+
<argument name="payPalConfigType"/>
13+
<argument name="countryCode" type="string" defaultValue="us"/>
14+
</arguments>
15+
<waitForElementVisible selector="{{OtherPayPalPaymentsConfigSection.expandTab(countryCode)}}" stepKey="waitForOtherPayPalPaymentsSection"/>
16+
<conditionalClick selector="{{OtherPayPalPaymentsConfigSection.expandTab(countryCode)}}" dependentSelector="{{OtherPayPalPaymentsConfigSection.expandedTab(countryCode)}}" visible="false" stepKey="clickOtherPayPalPaymentsSection"/>
17+
<waitForElementVisible selector="{{payPalConfigType.configureBtn(countryCode)}}" stepKey="waitForWPSExpressConfigureBtn"/>
18+
<click selector="{{payPalConfigType.configureBtn(countryCode)}}" stepKey="clickWPSExpressConfigureBtn"/>
19+
<waitForElementVisible selector="{{payPalConfigType.enableSolution(countryCode)}}" stepKey="waitForWPSExpressEnable"/>
20+
<selectOption selector="{{payPalConfigType.enableSolution(countryCode)}}" userInput="Yes" stepKey="enableWPSExpressSolution"/>
21+
<seeInPopup userInput="There is already another PayPal solution enabled. Enable this solution instead?" stepKey="seeAlertMessage"/>
22+
<acceptPopup stepKey="acceptEnablePopUp"/>
23+
<click selector="{{AdminConfigSection.saveButton}}" stepKey="saveConfig"/>
24+
<waitForPageLoad stepKey="waitForPageLoad2"/>
25+
</actionGroup>
26+
<actionGroup name="CheckEnableOptionPayPalConfiguration">
27+
<arguments>
28+
<argument name="payPalConfigType"/>
29+
<argument name="enabledOption" type="string"/>
30+
<argument name="countryCode" type="string" defaultValue="us"/>
31+
</arguments>
32+
<waitForElementVisible selector="{{OtherPayPalPaymentsConfigSection.expandTab(countryCode)}}" stepKey="waitForOtherPayPalPaymentsSection"/>
33+
<conditionalClick selector="{{OtherPayPalPaymentsConfigSection.expandTab(countryCode)}}" dependentSelector="{{OtherPayPalPaymentsConfigSection.expandedTab(countryCode)}}" visible="false" stepKey="clickOtherPayPalPaymentsSection"/>
34+
<waitForElementVisible selector="{{payPalConfigType.configureBtn(countryCode)}}" stepKey="waitForWPSExpressConfigureBtn"/>
35+
<click selector="{{payPalConfigType.configureBtn(countryCode)}}" stepKey="clickWPSExpressConfigureBtn1"/>
36+
<waitForElementVisible selector="{{payPalConfigType.enableSolution(countryCode)}}" stepKey="waitForWPSExpressEnable"/>
37+
<seeOptionIsSelected selector="{{payPalConfigType.enableSolution(countryCode)}}" userInput="{{enabledOption}}" stepKey="seeSelectedOption"/>
38+
<click selector="{{payPalConfigType.configureBtn(countryCode)}}" stepKey="clickWPSExpressConfigureBtn2"/>
39+
</actionGroup>
40+
</actionGroups>

app/code/Magento/Paypal/Test/Mftf/ActionGroup/PayPalExpressCheckoutConfigurationActionGroup.xml

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,22 @@
88
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
99
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
1010
<actionGroup name="ConfigPayPalExpressCheckout">
11+
<arguments>
12+
<argument name="credentials" defaultValue="_CREDS"/>
13+
<argument name="countryCode" type="string" defaultValue="us"/>
14+
</arguments>
1115
<amOnPage url="{{AdminConfigPaymentMethodsPage.url}}" stepKey="navigateToPaymentConfigurationPage"/>
1216
<waitForPageLoad stepKey="waitForPageLoad1"/>
13-
<click selector="{{PayPalExpressCheckoutConfigSection.configureBtn}}" stepKey="clickPayPalConfigureBtn"/>
14-
<waitForElementVisible selector="{{PayPalAdvancedSettingConfigSection.advancedSettingTab}}" stepKey="waitForAdvancedSettingTab"/>
15-
<fillField selector ="{{PayPalExpressCheckoutConfigSection.email}}" userInput="{{_CREDS.paypal_express_email}}" stepKey="inputEmailAssociatedWithPayPalMerchantAccount"/>
16-
<selectOption selector ="{{PayPalExpressCheckoutConfigSection.apiMethod}}" userInput="API Signature" stepKey="inputAPIAuthenticationMethods"/>
17-
<fillField selector ="{{PayPalExpressCheckoutConfigSection.username}}" userInput="{{_CREDS.paypal_express_api_username}}" stepKey="inputAPIUsername"/>
18-
<fillField selector ="{{PayPalExpressCheckoutConfigSection.password}}" userInput="{{_CREDS.paypal_express_api_password}}" stepKey="inputAPIPassword"/>
19-
<fillField selector ="{{PayPalExpressCheckoutConfigSection.signature}}" userInput="{{_CREDS.paypal_express_api_signature}}" stepKey="inputAPISignature"/>
20-
<selectOption selector ="{{PayPalExpressCheckoutConfigSection.sandboxMode}}" userInput="Yes" stepKey="enableSandboxMode"/>
21-
<selectOption selector="{{PayPalExpressCheckoutConfigSection.enableSolution}}" userInput="Yes" stepKey="enableSolution"/>
22-
<fillField selector ="{{PayPalExpressCheckoutConfigSection.merchantID}}" userInput="{{_CREDS.paypal_express_merchantID}}" stepKey="inputMerchantID"/>
17+
<click selector="{{PayPalExpressCheckoutConfigSection.configureBtn(countryCode)}}" stepKey="clickPayPalConfigureBtn"/>
18+
<waitForElementVisible selector="{{PayPalAdvancedSettingConfigSection.advancedSettingTab(countryCode)}}" stepKey="waitForAdvancedSettingTab"/>
19+
<fillField selector ="{{PayPalExpressCheckoutConfigSection.email(countryCode)}}" userInput="{{credentials.paypal_express_email}}" stepKey="inputEmailAssociatedWithPayPalMerchantAccount"/>
20+
<selectOption selector ="{{PayPalExpressCheckoutConfigSection.apiMethod(countryCode)}}" userInput="API Signature" stepKey="inputAPIAuthenticationMethods"/>
21+
<fillField selector ="{{PayPalExpressCheckoutConfigSection.username(countryCode)}}" userInput="{{credentials.paypal_express_api_username}}" stepKey="inputAPIUsername"/>
22+
<fillField selector ="{{PayPalExpressCheckoutConfigSection.password(countryCode)}}" userInput="{{credentials.paypal_express_api_password}}" stepKey="inputAPIPassword"/>
23+
<fillField selector ="{{PayPalExpressCheckoutConfigSection.signature(countryCode)}}" userInput="{{credentials.paypal_express_api_signature}}" stepKey="inputAPISignature"/>
24+
<selectOption selector ="{{PayPalExpressCheckoutConfigSection.sandboxMode(countryCode)}}" userInput="Yes" stepKey="enableSandboxMode"/>
25+
<selectOption selector="{{PayPalExpressCheckoutConfigSection.enableSolution(countryCode)}}" userInput="Yes" stepKey="enableSolution"/>
26+
<fillField selector ="{{PayPalExpressCheckoutConfigSection.merchantID(countryCode)}}" userInput="{{credentials.paypal_express_merchantID}}" stepKey="inputMerchantID"/>
2327
<!--Save configuration-->
2428
<click selector="{{AdminConfigSection.saveButton}}" stepKey="saveConfig"/>
2529
</actionGroup>

app/code/Magento/Paypal/Test/Mftf/Data/PaypalData.xml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@
3838
<entity name="SampleUseProxy" type="use_proxy">
3939
<data key="value">0</data>
4040
</entity>
41+
<entity name="SampleMerchantID" type="use_proxy">
42+
<data key="value">someMerchantId</data>
43+
</entity>
4144

4245
<!-- default configuration used to restore Magento config -->
4346
<entity name="DefaultPayPalConfig" type="paypal_config_state">
@@ -89,4 +92,11 @@
8992
<data key="silver">silver</data>
9093
<data key="black">black</data>
9194
</entity>
95+
<entity name="SamplePaypalExpressConfig" type="paypal_express_config">
96+
<data key="paypal_express_email">[email protected]</data>
97+
<data key="paypal_express_api_username">myApiUsername.magento.com</data>
98+
<data key="paypal_express_api_password">somePassword</data>
99+
<data key="paypal_express_api_signature">someApiSignature</data>
100+
<data key="paypal_express_merchantID">someMerchantId</data>
101+
</entity>
92102
</entities>

0 commit comments

Comments
 (0)