Skip to content

Commit

Permalink
Merge pull request #3645 from magento-epam/EPAM-PR-34
Browse files Browse the repository at this point in the history
Fixed:
MAGETWO-58212 [GITHUB] Magento 2.1 CE, Cannot change attribute set for bundled product #5999
MAGETWO-96842 [2.3.x] [Magento Cloud] [QUANS] Tiered block displayed on configurable products without any tiered pricing
MAGETWO-96412 [2.3.x] Not possible to drag specified Related/Upsell/Cross-sell products to new positions in Windows 10 machine
MAGETWO-96847 [2.3.x] Special price does not work when "default config" scope timezone does not match "website" scope timezone
MAGETWO-96424 [2.3.x] [Magento Cloud] Requesition list qty of configurable product variation not updated individually
MAGETWO-91589 Slow query delete on sub SELECT query
MAGETWO-82221 [CE 2.1.0 rc3] - Cancel an order [configurable product] #5313
MAGETWO-92226 Product export creates 2 rows for Simple product with custom options
MAGETWO-60910 Session initialized during reindex from CLI and result fatal error
MAGETWO-97260 creating new shipment: gettting all trackers. after this commit 2307e16
MAGETWO-96342 MySQL connection issue
MAGETWO-97434 MFTF test cases have parsing error
MAGETWO-91513 Password reset email cannot be sent if the customer does not have customer attribute set that is changed to required after original account creation
MAGETWO-95802 [EE] Admin date wrong formatting for French locale
  • Loading branch information
rganin authored Jan 28, 2019
2 parents 37f121f + 50ae5e3 commit b8eb424
Show file tree
Hide file tree
Showing 53 changed files with 1,242 additions and 254 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="SetAdminAccountActionGroup">
<arguments>
<argument name="InterfaceLocaleByValue" type="string"/>
</arguments>
<!-- Navigate to admin System Account Page-->
<amOnPage url="{{AdminSystemAccountPage.url}}" stepKey="openAdminSystemAccountPage" />
<waitForPageLoad stepKey="loadAdminSystemAccountPage"/>
<!-- Change Admin locale to Français (France) / French (France) -->
<selectOption userInput="{{InterfaceLocaleByValue}}" selector="{{AdminSystemAccountSection.interfaceLocale}}" stepKey="setInterfaceLocate"/>
<fillField selector="{{AdminSystemAccountSection.currentPassword}}" userInput="{{_ENV.MAGENTO_ADMIN_PASSWORD}}" stepKey="fillPassword"/>
<click selector="{{AdminCustomerMainActionsSection.saveButton}}" stepKey="clickSave"/>
<waitForElement selector="{{AdminCustomerMessagesSection.successMessage}}" stepKey="waitSuccessMessage"/>
</actionGroup>
</actionGroups>
14 changes: 14 additions & 0 deletions app/code/Magento/Backend/Test/Mftf/Page/AdminSystemAccountPage.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd">
<page name="AdminSystemAccountPage" url="admin/system_account/index/" area="admin" module="Magento_Backend">
<section name="AdminSystemAccountSection"/>
</page>
</pages>
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
<section name="AdminSystemAccountSection">
<element name="interfaceLocale" type="text" selector="#interface_locale"/>
<element name="currentPassword" type="text" selector="#current_password"/>
</section>
</sections>
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@
<section name="LocaleOptionsSection">
<element name="sectionHeader" type="text" selector="#general_locale-head"/>
<element name="timezone" type="select" selector="#general_locale_timezone"/>
<element name="useDefault" type="checkbox" selector="#general_locale_timezone_inherit"/>
</section>
</sections>
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,10 @@

<!--Check all products and Cart Subtotal -->
<actionGroup ref="StorefrontCheckCartActionGroup" stepKey="cartAssert" after="waitForDetailsOpen">
<argument name="subtotal" value="BundleProductsSummary.subtotal"/>
<argument name="shipping" value="BundleProductsSummary.shipping"/>
<argument name="shippingMethod" value="BundleProductsSummary.shippingMethod"/>
<argument name="total" value="BundleProductsSummary.total"/>
<argument name="subtotal" value="1,968.00"/>
<argument name="shipping" value="5.00"/>
<argument name="shippingMethod" value="Flat Rate - Fixed"/>
<argument name="total" value="1,973.00"/>
</actionGroup>
</test>
</tests>
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
namespace Magento\Bundle\Test\Unit\Pricing\Price;

use \Magento\Bundle\Pricing\Price\SpecialPrice;
use Magento\Store\Api\Data\WebsiteInterface;

class SpecialPriceTest extends \PHPUnit\Framework\TestCase
{
Expand Down Expand Up @@ -77,12 +78,6 @@ public function testGetValue($regularPrice, $specialPrice, $isScopeDateInInterva
->method('getSpecialPrice')
->will($this->returnValue($specialPrice));

$store = $this->getMockBuilder(\Magento\Store\Model\Store::class)
->disableOriginalConstructor()
->getMock();
$this->saleable->expects($this->once())
->method('getStore')
->will($this->returnValue($store));
$this->saleable->expects($this->once())
->method('getSpecialFromDate')
->will($this->returnValue($specialFromDate));
Expand All @@ -92,7 +87,7 @@ public function testGetValue($regularPrice, $specialPrice, $isScopeDateInInterva

$this->localeDate->expects($this->once())
->method('isScopeDateInInterval')
->with($store, $specialFromDate, $specialToDate)
->with(WebsiteInterface::ADMIN_CODE, $specialFromDate, $specialToDate)
->will($this->returnValue($isScopeDateInInterval));

$this->priceCurrencyMock->expects($this->never())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
use Magento\Framework\UrlInterface;
use Magento\Ui\Component\Container;
use Magento\Ui\Component\Form;
use Magento\Ui\Component\Form\Fieldset;
use Magento\Ui\Component\Modal;

/**
Expand Down Expand Up @@ -69,13 +70,26 @@ public function __construct(
}

/**
* {@inheritdoc}
* @inheritdoc
*
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
*/
public function modifyMeta(array $meta)
{
$meta = $this->removeFixedTierPrice($meta);
$path = $this->arrayManager->findPath(static::CODE_BUNDLE_DATA, $meta, null, 'children');

$groupCode = static::CODE_BUNDLE_DATA;
$path = $this->arrayManager->findPath($groupCode, $meta, null, 'children');
if (empty($path)) {
$meta[$groupCode]['children'] = [];
$meta[$groupCode]['arguments']['data']['config'] = [
'componentType' => Fieldset::NAME,
'label' => __('Bundle Items'),
'collapsible' => true
];

$path = $this->arrayManager->findPath($groupCode, $meta, null, 'children');
}

$meta = $this->arrayManager->merge(
$path,
Expand Down Expand Up @@ -220,7 +234,7 @@ private function removeFixedTierPrice(array $meta)
}

/**
* {@inheritdoc}
* @inheritdoc
*/
public function modifyData(array $data)
{
Expand Down
10 changes: 8 additions & 2 deletions app/code/Magento/Catalog/Model/Product/Type/Price.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,14 @@
use Magento\Store\Model\Store;
use Magento\Catalog\Api\Data\ProductTierPriceExtensionFactory;
use Magento\Framework\App\ObjectManager;
use Magento\Store\Api\Data\WebsiteInterface;

/**
* Product type price model
*
* @api
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
* @SuppressWarnings(PHPMD.CookieAndSessionMisuse)
* @since 100.0.2
*/
class Price
Expand Down Expand Up @@ -184,6 +186,8 @@ public function getFinalPrice($qty, $product)
}

/**
* Retrieve final price for child product
*
* @param Product $product
* @param float $productQty
* @param Product $childProduct
Expand Down Expand Up @@ -428,6 +432,8 @@ public function setTierPrices($product, array $tierPrices = null)
}

/**
* Retrieve customer group id from product
*
* @param Product $product
* @return int
*/
Expand All @@ -453,7 +459,7 @@ protected function _applySpecialPrice($product, $finalPrice)
$product->getSpecialPrice(),
$product->getSpecialFromDate(),
$product->getSpecialToDate(),
$product->getStore()
WebsiteInterface::ADMIN_CODE
);
}

Expand Down Expand Up @@ -601,7 +607,7 @@ public function calculatePrice(
$specialPrice,
$specialPriceFrom,
$specialPriceTo,
$sId
WebsiteInterface::ADMIN_CODE
);

if ($rulePrice === false) {
Expand Down
9 changes: 6 additions & 3 deletions app/code/Magento/Catalog/Pricing/Price/SpecialPrice.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
use Magento\Framework\Pricing\Price\AbstractPrice;
use Magento\Framework\Pricing\Price\BasePriceProviderInterface;
use Magento\Framework\Stdlib\DateTime\TimezoneInterface;
use Magento\Store\Api\Data\WebsiteInterface;

/**
* Special price model
Expand Down Expand Up @@ -46,6 +47,8 @@ public function __construct(
}

/**
* Retrieve special price.
*
* @return bool|float
*/
public function getValue()
Expand Down Expand Up @@ -96,19 +99,19 @@ public function getSpecialToDate()
}

/**
* @return bool
* @inheritdoc
*/
public function isScopeDateInInterval()
{
return $this->localeDate->isScopeDateInInterval(
$this->product->getStore(),
WebsiteInterface::ADMIN_CODE,
$this->getSpecialFromDate(),
$this->getSpecialToDate()
);
}

/**
* @return bool
* @inheritdoc
*/
public function isPercentageDiscount()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
<element name="productOptionAreaInput" type="textarea" selector="//*[@id='product-options-wrapper']//div[@class='fieldset']//label[contains(.,'{{var1}}')]/../div[@class='control']//textarea" parameterized="true"/>
<element name="productOptionFile" type="file" selector="//*[@id='product-options-wrapper']//div[@class='fieldset']//label[contains(.,'OptionFile')]/../div[@class='control']//input[@type='file']" parameterized="true"/>
<element name="productOptionSelect" type="select" selector="//*[@id='product-options-wrapper']//div[@class='fieldset']//label[contains(.,'{{var1}}')]/../div[@class='control']//select" parameterized="true"/>
<element name="specialPriceValue" type="text" selector="//span[@class='special-price']//span[@class='price']"/>


<!-- The parameter is the nth custom option that you want to get -->
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
<test name="AdminTierPriceNotAvailableForProductOptionsWithoutTierPriceTest">
<annotations>
<features value="Catalog"/>
<title value="Check that 'trie price' block not available for simple product from options without 'trie price'"/>
<description value="Check that 'trie price' block not available for simple product from options without 'trie price'"/>
<severity value="MAJOR"/>
<testCaseId value="MAGETWO-97050"/>
<useCaseId value="MAGETWO-96842"/>
<group value="catalog"/>
</annotations>
<before>
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>

<!--Create category-->
<createData entity="SimpleSubCategory" stepKey="createCategory"/>

<!-- Create the configurable product based on the data in the /data folder -->
<createData entity="ApiConfigurableProduct" stepKey="createConfigProduct">
<requiredEntity createDataKey="createCategory"/>
</createData>

<!-- Make the configurable product have two options, that are children of the default attribute set -->
<createData entity="productAttributeWithTwoOptions" stepKey="createConfigProductAttribute"/>
<createData entity="productAttributeOption1" stepKey="createConfigProductAttributeOption1">
<requiredEntity createDataKey="createConfigProductAttribute"/>
</createData>
<createData entity="productAttributeOption2" stepKey="createConfigProductAttributeOption2">
<requiredEntity createDataKey="createConfigProductAttribute"/>
</createData>
<createData entity="AddToDefaultSet" stepKey="createConfigAddToAttributeSet">
<requiredEntity createDataKey="createConfigProductAttribute"/>
</createData>
<getData entity="ProductAttributeOptionGetter" index="1" stepKey="getConfigAttributeOption1">
<requiredEntity createDataKey="createConfigProductAttribute"/>
</getData>
<getData entity="ProductAttributeOptionGetter" index="2" stepKey="getConfigAttributeOption2">
<requiredEntity createDataKey="createConfigProductAttribute"/>
</getData>

<!-- Create the 2 children that will be a part of the configurable product -->
<createData entity="ApiSimpleOne" stepKey="createConfigChildProduct1">
<requiredEntity createDataKey="createConfigProductAttribute"/>
<requiredEntity createDataKey="getConfigAttributeOption1"/>
</createData>
<createData entity="ApiSimpleTwo" stepKey="createConfigChildProduct2">
<requiredEntity createDataKey="createConfigProductAttribute"/>
<requiredEntity createDataKey="getConfigAttributeOption2"/>
</createData>

<!-- Assign the two products to the configurable product -->
<createData entity="ConfigurableProductTwoOptions" stepKey="createConfigProductOption">
<requiredEntity createDataKey="createConfigProduct"/>
<requiredEntity createDataKey="createConfigProductAttribute"/>
<requiredEntity createDataKey="getConfigAttributeOption1"/>
<requiredEntity createDataKey="getConfigAttributeOption2"/>
</createData>
<createData entity="ConfigurableProductAddChild" stepKey="createConfigProductAddChild1">
<requiredEntity createDataKey="createConfigProduct"/>
<requiredEntity createDataKey="createConfigChildProduct1"/>
</createData>
<createData entity="ConfigurableProductAddChild" stepKey="createConfigProductAddChild2">
<requiredEntity createDataKey="createConfigProduct"/>
<requiredEntity createDataKey="createConfigChildProduct2"/>
</createData>
</before>
<after>
<!--Delete created data-->
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
<deleteData createDataKey="createConfigProduct" stepKey="deleteConfigProduct"/>
<deleteData createDataKey="createConfigChildProduct1" stepKey="deleteConfigChildProduct1"/>
<deleteData createDataKey="createConfigChildProduct2" stepKey="deleteConfigChildProduct2"/>
<deleteData createDataKey="createConfigProductAttribute" stepKey="deleteConfigProductAttribute"/>

<actionGroup ref="logout" stepKey="logoutOfAdmin"/>
</after>

<!--Go to storefront product page an check price box css-->
<amOnPage url="{{StorefrontProductPage.url($$createConfigProduct.custom_attributes[url_key]$$)}}" stepKey="navigateToSimpleProductPage"/>
<waitForPageLoad stepKey="waitForStoreFrontLoad"/>
<selectOption selector="{{StorefrontProductInfoMainSection.productAttributeOptionsSelectButton}}" userInput="$$getConfigAttributeOption1.value$$" stepKey="selectOption"/>
<grabAttributeFrom selector="{{StorefrontProductInfoMainSection.productPrice}}" userInput="class" stepKey="grabGrabPriceClass"/>
<assertNotContains actual="$grabGrabPriceClass" expected=".price-box .price-tier_price" expectedType="string" stepKey="assertNotEquals"/>
</test>
</tests>
Loading

0 comments on commit b8eb424

Please sign in to comment.