Skip to content

Commit

Permalink
Merge pull request #3683 from magento-arcticfoxes/pr
Browse files Browse the repository at this point in the history
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
  • Loading branch information
rganin authored Feb 4, 2019
2 parents ae0c3c1 + 037ff43 commit 8dfe26a
Show file tree
Hide file tree
Showing 24 changed files with 1,268 additions and 342 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,27 @@
*/
-->
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="StorefrontFillCartDataActionGroup">
<arguments>
<argument name="cartData" defaultValue="PaymentAndShippingInfo"/>
</arguments>
<switchToIFrame selector="{{BraintreeConfigurationPaymentSection.cartFrame}}" stepKey="switchToIframe"/>
<waitForElementVisible selector="{{BraintreeConfigurationPaymentSection.cartCode}}" stepKey="waitCartCodeElement"/>
<fillField selector="{{BraintreeConfigurationPaymentSection.cartCode}}" userInput="{{cartData.cardNumber}}" stepKey="setCartCode"/>
<switchToIFrame stepKey="switchBack"/>
<switchToIFrame selector="{{BraintreeConfigurationPaymentSection.monthFrame}}" stepKey="switchToIframe1"/>
<waitForElementVisible selector="{{BraintreeConfigurationPaymentSection.month}}" stepKey="waitMonthElement"/>
<fillField selector="{{BraintreeConfigurationPaymentSection.month}}" userInput="{{cartData.month}}" stepKey="setMonth"/>
<switchToIFrame stepKey="switchBack1"/>
<switchToIFrame selector="{{BraintreeConfigurationPaymentSection.yearFrame}}" stepKey="switchToIframe2"/>
<waitForElementVisible selector="{{BraintreeConfigurationPaymentSection.year}}" stepKey="waitYearElement"/>
<fillField selector="{{BraintreeConfigurationPaymentSection.year}}" userInput="{{cartData.year}}" stepKey="setYear"/>
<switchToIFrame stepKey="switchBack2"/>
<switchToIFrame selector="{{BraintreeConfigurationPaymentSection.codeFrame}}" stepKey="switchToIframe3"/>
<waitForElementVisible selector="{{BraintreeConfigurationPaymentSection.verificationNumber}}" stepKey="waitVerificationNumber"/>
<fillField selector="{{BraintreeConfigurationPaymentSection.verificationNumber}}" userInput="{{cartData.cvv}}" stepKey="setVerificationNumber"/>
<switchToIFrame stepKey="SwitchBackToWindow"/>

</actionGroup>

</actionGroups>
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
<?php
/**
*
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
namespace Magento\Catalog\Controller\Adminhtml\Category;

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

/**
* Class RefreshPath
*/
class RefreshPath extends \Magento\Catalog\Controller\Adminhtml\Category implements HttpGetActionInterface
{
/**
Expand Down Expand Up @@ -44,6 +46,7 @@ public function execute()
'id' => $categoryId,
'path' => $category->getPath(),
'parentId' => $category->getParentId(),
'level' => $category->getLevel()
]);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ public function execute()
$parentCategory = $this->getParentCategory($parentId, $storeId);
$category->setPath($parentCategory->getPath());
$category->setParentId($parentCategory->getId());
$category->setLevel(null);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ private function setObjectProperty($object, string $propertyName, $value) : void
*/
public function testExecute() : void
{
$value = ['id' => 3, 'path' => '1/2/3', 'parentId' => 2];
$result = '{"id":3,"path":"1/2/3","parentId":"2"}';
$value = ['id' => 3, 'path' => '1/2/3', 'parentId' => 2, 'level' => 2];
$result = '{"id":3,"path":"1/2/3","parentId":"2","level":"2"}';

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,13 @@
<dataType>text</dataType>
</settings>
</field>
<field name="level" formElement="hidden">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="source" xsi:type="string">category</item>
</item>
</argument>
</field>
<field name="store_id" formElement="hidden">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ define([
categoryIdSelector: 'input[name="id"]',
categoryPathSelector: 'input[name="path"]',
categoryParentSelector: 'input[name="parent"]',
categoryLevelSelector: 'input[name="level"]',
refreshUrl: config.refreshUrl
},

Expand Down Expand Up @@ -47,6 +48,7 @@ define([
$(this.options.categoryIdSelector).val(data.id).change();
$(this.options.categoryPathSelector).val(data.path).change();
$(this.options.categoryParentSelector).val(data.parentId).change();
$(this.options.categoryLevelSelector).val(data.level).change();
}
}
};
Expand Down
16 changes: 14 additions & 2 deletions app/code/Magento/Customer/Controller/Address/FormPost.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
use Magento\Framework\View\Result\PageFactory;

/**
* Customer Address Form Post Controller
*
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
*/
class FormPost extends \Magento\Customer\Controller\Address implements HttpPostActionInterface
Expand Down Expand Up @@ -120,8 +122,18 @@ protected function _extractAddress()
\Magento\Customer\Api\Data\AddressInterface::class
);
$addressDataObject->setCustomerId($this->_getSession()->getCustomerId())
->setIsDefaultBilling($this->getRequest()->getParam('default_billing', false))
->setIsDefaultShipping($this->getRequest()->getParam('default_shipping', false));
->setIsDefaultBilling(
$this->getRequest()->getParam(
'default_billing',
isset($existingAddressData['default_billing']) ? $existingAddressData['default_billing'] : false
)
)
->setIsDefaultShipping(
$this->getRequest()->getParam(
'default_shipping',
isset($existingAddressData['default_shipping']) ? $existingAddressData['default_shipping'] : false
)
);

return $addressDataObject;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@
<testCaseId value="MAGETWO-97501"/>
<group value="customer"/>
<group value="update"/>
<skip>
<issueId value="MAGETWO-97504"/>
</skip>
</annotations>
<before>
<createData entity="Simple_US_Customer_With_Different_Billing_Shipping_Addresses" stepKey="createCustomer"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -455,14 +455,20 @@ public function testExecute(
$regionCode,
$newRegionId,
$newRegion,
$newRegionCode
$newRegionCode,
$existingDefaultBilling = false,
$existingDefaultShipping = false,
$setDefaultBilling = false,
$setDefaultShipping = false
): void {
$existingAddressData = [
'country_id' => $countryId,
'region_id' => $regionId,
'region' => $region,
'region_code' => $regionCode,
'customer_id' => $customerId
'customer_id' => $customerId,
'default_billing' => $existingDefaultBilling,
'default_shipping' => $existingDefaultShipping,
];
$newAddressData = [
'country_id' => $countryId,
Expand All @@ -486,8 +492,8 @@ public function testExecute(
->method('getParam')
->willReturnMap([
['id', null, $addressId],
['default_billing', false, $addressId],
['default_shipping', false, $addressId],
['default_billing', $existingDefaultBilling, $setDefaultBilling],
['default_shipping', $existingDefaultShipping, $setDefaultShipping],
]);

$this->addressRepository->expects($this->once())
Expand Down Expand Up @@ -565,11 +571,11 @@ public function testExecute(
->willReturnSelf();
$this->addressData->expects($this->once())
->method('setIsDefaultBilling')
->with()
->with($setDefaultBilling)
->willReturnSelf();
$this->addressData->expects($this->once())
->method('setIsDefaultShipping')
->with()
->with($setDefaultShipping)
->willReturnSelf();

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

[1, 1, 1, 2, null, null, 12, null, null],
[1, 1, 1, 2, 'Alaska', null, 12, null, 'CA'],
[1, 1, 1, 2, 'Alaska', 'AK', 12, 'California', null],
[1, 1, 1, 2, 'Alaska', 'AK', 12, 'California', null, true, true, true, false],

[1, 1, 1, 2, null, null, 12, null, null],
[1, 1, 1, 2, 'Alaska', null, 12, null, 'CA'],
[1, 1, 1, 2, 'Alaska', 'AK', 12, 'California', null],
[1, 1, 1, 2, null, null, 12, null, null, false, false, true, false],
[1, 1, 1, 2, 'Alaska', null, 12, null, 'CA', true, false, true, false],
[1, 1, 1, 2, 'Alaska', 'AK', 12, 'California', null, true, true, true, true],
];
}

Expand Down
Loading

0 comments on commit 8dfe26a

Please sign in to comment.