Skip to content
This repository was archived by the owner on Apr 29, 2019. It is now read-only.

Commit 8dfe26a

Browse files
authored
Merge pull request #3683 from magento-arcticfoxes/pr
Fixed: MC-5717 Sub-category doesnt display after moving categories MC-4245 Upgrade DHL schema to 6.0 MC-11043 Flaky MFTF Test - MAGETWO-93767: Use saved for Braintree credit card on checkout with selecting billing address MC-13644 Default billing and default shipping address lose their status after edit
2 parents ae0c3c1 + 037ff43 commit 8dfe26a

File tree

24 files changed

+1268
-342
lines changed

24 files changed

+1268
-342
lines changed

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,24 +6,27 @@
66
*/
77
-->
88
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9-
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
1010
<actionGroup name="StorefrontFillCartDataActionGroup">
1111
<arguments>
1212
<argument name="cartData" defaultValue="PaymentAndShippingInfo"/>
1313
</arguments>
1414
<switchToIFrame selector="{{BraintreeConfigurationPaymentSection.cartFrame}}" stepKey="switchToIframe"/>
15+
<waitForElementVisible selector="{{BraintreeConfigurationPaymentSection.cartCode}}" stepKey="waitCartCodeElement"/>
1516
<fillField selector="{{BraintreeConfigurationPaymentSection.cartCode}}" userInput="{{cartData.cardNumber}}" stepKey="setCartCode"/>
1617
<switchToIFrame stepKey="switchBack"/>
1718
<switchToIFrame selector="{{BraintreeConfigurationPaymentSection.monthFrame}}" stepKey="switchToIframe1"/>
19+
<waitForElementVisible selector="{{BraintreeConfigurationPaymentSection.month}}" stepKey="waitMonthElement"/>
1820
<fillField selector="{{BraintreeConfigurationPaymentSection.month}}" userInput="{{cartData.month}}" stepKey="setMonth"/>
1921
<switchToIFrame stepKey="switchBack1"/>
2022
<switchToIFrame selector="{{BraintreeConfigurationPaymentSection.yearFrame}}" stepKey="switchToIframe2"/>
23+
<waitForElementVisible selector="{{BraintreeConfigurationPaymentSection.year}}" stepKey="waitYearElement"/>
2124
<fillField selector="{{BraintreeConfigurationPaymentSection.year}}" userInput="{{cartData.year}}" stepKey="setYear"/>
2225
<switchToIFrame stepKey="switchBack2"/>
2326
<switchToIFrame selector="{{BraintreeConfigurationPaymentSection.codeFrame}}" stepKey="switchToIframe3"/>
27+
<waitForElementVisible selector="{{BraintreeConfigurationPaymentSection.verificationNumber}}" stepKey="waitVerificationNumber"/>
2428
<fillField selector="{{BraintreeConfigurationPaymentSection.verificationNumber}}" userInput="{{cartData.cvv}}" stepKey="setVerificationNumber"/>
2529
<switchToIFrame stepKey="SwitchBackToWindow"/>
26-
2730
</actionGroup>
2831

2932
</actionGroups>

app/code/Magento/Catalog/Controller/Adminhtml/Category/RefreshPath.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
<?php
22
/**
3-
*
43
* Copyright © Magento, Inc. All rights reserved.
54
* See COPYING.txt for license details.
65
*/
76
namespace Magento\Catalog\Controller\Adminhtml\Category;
87

98
use Magento\Framework\App\Action\HttpGetActionInterface as HttpGetActionInterface;
109

10+
/**
11+
* Class RefreshPath
12+
*/
1113
class RefreshPath extends \Magento\Catalog\Controller\Adminhtml\Category implements HttpGetActionInterface
1214
{
1315
/**
@@ -44,6 +46,7 @@ public function execute()
4446
'id' => $categoryId,
4547
'path' => $category->getPath(),
4648
'parentId' => $category->getParentId(),
49+
'level' => $category->getLevel()
4750
]);
4851
}
4952
}

app/code/Magento/Catalog/Controller/Adminhtml/Category/Save.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ public function execute()
147147
$parentCategory = $this->getParentCategory($parentId, $storeId);
148148
$category->setPath($parentCategory->getPath());
149149
$category->setParentId($parentCategory->getId());
150+
$category->setLevel(null);
150151
}
151152

152153
/**

app/code/Magento/Catalog/Test/Unit/Controller/Adminhtml/Category/RefreshPathTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ private function setObjectProperty($object, string $propertyName, $value) : void
6666
*/
6767
public function testExecute() : void
6868
{
69-
$value = ['id' => 3, 'path' => '1/2/3', 'parentId' => 2];
70-
$result = '{"id":3,"path":"1/2/3","parentId":"2"}';
69+
$value = ['id' => 3, 'path' => '1/2/3', 'parentId' => 2, 'level' => 2];
70+
$result = '{"id":3,"path":"1/2/3","parentId":"2","level":"2"}';
7171

7272
$requestMock = $this->getMockForAbstractClass(\Magento\Framework\App\RequestInterface::class);
7373

app/code/Magento/Catalog/view/adminhtml/ui_component/category_form.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,13 @@
7777
<dataType>text</dataType>
7878
</settings>
7979
</field>
80+
<field name="level" formElement="hidden">
81+
<argument name="data" xsi:type="array">
82+
<item name="config" xsi:type="array">
83+
<item name="source" xsi:type="string">category</item>
84+
</item>
85+
</argument>
86+
</field>
8087
<field name="store_id" formElement="hidden">
8188
<argument name="data" xsi:type="array">
8289
<item name="config" xsi:type="array">

app/code/Magento/Catalog/view/adminhtml/web/catalog/category/form.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ define([
1515
categoryIdSelector: 'input[name="id"]',
1616
categoryPathSelector: 'input[name="path"]',
1717
categoryParentSelector: 'input[name="parent"]',
18+
categoryLevelSelector: 'input[name="level"]',
1819
refreshUrl: config.refreshUrl
1920
},
2021

@@ -47,6 +48,7 @@ define([
4748
$(this.options.categoryIdSelector).val(data.id).change();
4849
$(this.options.categoryPathSelector).val(data.path).change();
4950
$(this.options.categoryParentSelector).val(data.parentId).change();
51+
$(this.options.categoryLevelSelector).val(data.level).change();
5052
}
5153
}
5254
};

app/code/Magento/Customer/Controller/Address/FormPost.php

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626
use Magento\Framework\View\Result\PageFactory;
2727

2828
/**
29+
* Customer Address Form Post Controller
30+
*
2931
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
3032
*/
3133
class FormPost extends \Magento\Customer\Controller\Address implements HttpPostActionInterface
@@ -120,8 +122,18 @@ protected function _extractAddress()
120122
\Magento\Customer\Api\Data\AddressInterface::class
121123
);
122124
$addressDataObject->setCustomerId($this->_getSession()->getCustomerId())
123-
->setIsDefaultBilling($this->getRequest()->getParam('default_billing', false))
124-
->setIsDefaultShipping($this->getRequest()->getParam('default_shipping', false));
125+
->setIsDefaultBilling(
126+
$this->getRequest()->getParam(
127+
'default_billing',
128+
isset($existingAddressData['default_billing']) ? $existingAddressData['default_billing'] : false
129+
)
130+
)
131+
->setIsDefaultShipping(
132+
$this->getRequest()->getParam(
133+
'default_shipping',
134+
isset($existingAddressData['default_shipping']) ? $existingAddressData['default_shipping'] : false
135+
)
136+
);
125137

126138
return $addressDataObject;
127139
}

app/code/Magento/Customer/Test/Mftf/Test/StorefrontUpdateCustomerAddressTest.xml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,6 @@
1818
<testCaseId value="MAGETWO-97501"/>
1919
<group value="customer"/>
2020
<group value="update"/>
21-
<skip>
22-
<issueId value="MAGETWO-97504"/>
23-
</skip>
2421
</annotations>
2522
<before>
2623
<createData entity="Simple_US_Customer_With_Different_Billing_Shipping_Addresses" stepKey="createCustomer"/>

app/code/Magento/Customer/Test/Unit/Controller/Address/FormPostTest.php

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -455,14 +455,20 @@ public function testExecute(
455455
$regionCode,
456456
$newRegionId,
457457
$newRegion,
458-
$newRegionCode
458+
$newRegionCode,
459+
$existingDefaultBilling = false,
460+
$existingDefaultShipping = false,
461+
$setDefaultBilling = false,
462+
$setDefaultShipping = false
459463
): void {
460464
$existingAddressData = [
461465
'country_id' => $countryId,
462466
'region_id' => $regionId,
463467
'region' => $region,
464468
'region_code' => $regionCode,
465-
'customer_id' => $customerId
469+
'customer_id' => $customerId,
470+
'default_billing' => $existingDefaultBilling,
471+
'default_shipping' => $existingDefaultShipping,
466472
];
467473
$newAddressData = [
468474
'country_id' => $countryId,
@@ -486,8 +492,8 @@ public function testExecute(
486492
->method('getParam')
487493
->willReturnMap([
488494
['id', null, $addressId],
489-
['default_billing', false, $addressId],
490-
['default_shipping', false, $addressId],
495+
['default_billing', $existingDefaultBilling, $setDefaultBilling],
496+
['default_shipping', $existingDefaultShipping, $setDefaultShipping],
491497
]);
492498

493499
$this->addressRepository->expects($this->once())
@@ -565,11 +571,11 @@ public function testExecute(
565571
->willReturnSelf();
566572
$this->addressData->expects($this->once())
567573
->method('setIsDefaultBilling')
568-
->with()
574+
->with($setDefaultBilling)
569575
->willReturnSelf();
570576
$this->addressData->expects($this->once())
571577
->method('setIsDefaultShipping')
572-
->with()
578+
->with($setDefaultShipping)
573579
->willReturnSelf();
574580

575581
$this->messageManager->expects($this->once())
@@ -628,11 +634,11 @@ public function dataProviderTestExecute(): array
628634

629635
[1, 1, 1, 2, null, null, 12, null, null],
630636
[1, 1, 1, 2, 'Alaska', null, 12, null, 'CA'],
631-
[1, 1, 1, 2, 'Alaska', 'AK', 12, 'California', null],
637+
[1, 1, 1, 2, 'Alaska', 'AK', 12, 'California', null, true, true, true, false],
632638

633-
[1, 1, 1, 2, null, null, 12, null, null],
634-
[1, 1, 1, 2, 'Alaska', null, 12, null, 'CA'],
635-
[1, 1, 1, 2, 'Alaska', 'AK', 12, 'California', null],
639+
[1, 1, 1, 2, null, null, 12, null, null, false, false, true, false],
640+
[1, 1, 1, 2, 'Alaska', null, 12, null, 'CA', true, false, true, false],
641+
[1, 1, 1, 2, 'Alaska', 'AK', 12, 'California', null, true, true, true, true],
636642
];
637643
}
638644

0 commit comments

Comments
 (0)