Skip to content

Commit 9fbc87e

Browse files
committed
Merge remote-tracking branch 'origin/2.3-develop' into 2.3-develop-mftf-pr12
2 parents 0b4adc2 + b8eb424 commit 9fbc87e

File tree

53 files changed

+1242
-254
lines changed

Some content is hidden

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

53 files changed

+1242
-254
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="SetAdminAccountActionGroup">
12+
<arguments>
13+
<argument name="InterfaceLocaleByValue" type="string"/>
14+
</arguments>
15+
<!-- Navigate to admin System Account Page-->
16+
<amOnPage url="{{AdminSystemAccountPage.url}}" stepKey="openAdminSystemAccountPage" />
17+
<waitForPageLoad stepKey="loadAdminSystemAccountPage"/>
18+
<!-- Change Admin locale to Français (France) / French (France) -->
19+
<selectOption userInput="{{InterfaceLocaleByValue}}" selector="{{AdminSystemAccountSection.interfaceLocale}}" stepKey="setInterfaceLocate"/>
20+
<fillField selector="{{AdminSystemAccountSection.currentPassword}}" userInput="{{_ENV.MAGENTO_ADMIN_PASSWORD}}" stepKey="fillPassword"/>
21+
<click selector="{{AdminCustomerMainActionsSection.saveButton}}" stepKey="clickSave"/>
22+
<waitForElement selector="{{AdminCustomerMessagesSection.successMessage}}" stepKey="waitSuccessMessage"/>
23+
</actionGroup>
24+
</actionGroups>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
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+
<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd">
11+
<page name="AdminSystemAccountPage" url="admin/system_account/index/" area="admin" module="Magento_Backend">
12+
<section name="AdminSystemAccountSection"/>
13+
</page>
14+
</pages>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
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+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
11+
<section name="AdminSystemAccountSection">
12+
<element name="interfaceLocale" type="text" selector="#interface_locale"/>
13+
<element name="currentPassword" type="text" selector="#current_password"/>
14+
</section>
15+
</sections>

app/code/Magento/Backend/Test/Mftf/Section/LocaleOptionsSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,6 @@
1111
<section name="LocaleOptionsSection">
1212
<element name="sectionHeader" type="text" selector="#general_locale-head"/>
1313
<element name="timezone" type="select" selector="#general_locale_timezone"/>
14+
<element name="useDefault" type="checkbox" selector="#general_locale_timezone_inherit"/>
1415
</section>
1516
</sections>

app/code/Magento/Bundle/Test/Mftf/Test/StorefrontAddBundleOptionsToCartTest.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -131,10 +131,10 @@
131131

132132
<!--Check all products and Cart Subtotal -->
133133
<actionGroup ref="StorefrontCheckCartActionGroup" stepKey="cartAssert" after="waitForDetailsOpen">
134-
<argument name="subtotal" value="BundleProductsSummary.subtotal"/>
135-
<argument name="shipping" value="BundleProductsSummary.shipping"/>
136-
<argument name="shippingMethod" value="BundleProductsSummary.shippingMethod"/>
137-
<argument name="total" value="BundleProductsSummary.total"/>
134+
<argument name="subtotal" value="1,968.00"/>
135+
<argument name="shipping" value="5.00"/>
136+
<argument name="shippingMethod" value="Flat Rate - Fixed"/>
137+
<argument name="total" value="1,973.00"/>
138138
</actionGroup>
139139
</test>
140140
</tests>

app/code/Magento/Bundle/Test/Unit/Pricing/Price/SpecialPriceTest.php

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
namespace Magento\Bundle\Test\Unit\Pricing\Price;
77

88
use \Magento\Bundle\Pricing\Price\SpecialPrice;
9+
use Magento\Store\Api\Data\WebsiteInterface;
910

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

80-
$store = $this->getMockBuilder(\Magento\Store\Model\Store::class)
81-
->disableOriginalConstructor()
82-
->getMock();
83-
$this->saleable->expects($this->once())
84-
->method('getStore')
85-
->will($this->returnValue($store));
8681
$this->saleable->expects($this->once())
8782
->method('getSpecialFromDate')
8883
->will($this->returnValue($specialFromDate));
@@ -92,7 +87,7 @@ public function testGetValue($regularPrice, $specialPrice, $isScopeDateInInterva
9287

9388
$this->localeDate->expects($this->once())
9489
->method('isScopeDateInInterval')
95-
->with($store, $specialFromDate, $specialToDate)
90+
->with(WebsiteInterface::ADMIN_CODE, $specialFromDate, $specialToDate)
9691
->will($this->returnValue($isScopeDateInInterval));
9792

9893
$this->priceCurrencyMock->expects($this->never())

app/code/Magento/Bundle/Ui/DataProvider/Product/Form/Modifier/BundlePanel.php

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
use Magento\Framework\UrlInterface;
1515
use Magento\Ui\Component\Container;
1616
use Magento\Ui\Component\Form;
17+
use Magento\Ui\Component\Form\Fieldset;
1718
use Magento\Ui\Component\Modal;
1819

1920
/**
@@ -69,13 +70,26 @@ public function __construct(
6970
}
7071

7172
/**
72-
* {@inheritdoc}
73+
* @inheritdoc
74+
*
7375
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
7476
*/
7577
public function modifyMeta(array $meta)
7678
{
7779
$meta = $this->removeFixedTierPrice($meta);
78-
$path = $this->arrayManager->findPath(static::CODE_BUNDLE_DATA, $meta, null, 'children');
80+
81+
$groupCode = static::CODE_BUNDLE_DATA;
82+
$path = $this->arrayManager->findPath($groupCode, $meta, null, 'children');
83+
if (empty($path)) {
84+
$meta[$groupCode]['children'] = [];
85+
$meta[$groupCode]['arguments']['data']['config'] = [
86+
'componentType' => Fieldset::NAME,
87+
'label' => __('Bundle Items'),
88+
'collapsible' => true
89+
];
90+
91+
$path = $this->arrayManager->findPath($groupCode, $meta, null, 'children');
92+
}
7993

8094
$meta = $this->arrayManager->merge(
8195
$path,
@@ -220,7 +234,7 @@ private function removeFixedTierPrice(array $meta)
220234
}
221235

222236
/**
223-
* {@inheritdoc}
237+
* @inheritdoc
224238
*/
225239
public function modifyData(array $data)
226240
{

app/code/Magento/Catalog/Model/Product/Type/Price.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,14 @@
1111
use Magento\Store\Model\Store;
1212
use Magento\Catalog\Api\Data\ProductTierPriceExtensionFactory;
1313
use Magento\Framework\App\ObjectManager;
14+
use Magento\Store\Api\Data\WebsiteInterface;
1415

1516
/**
1617
* Product type price model
1718
*
1819
* @api
1920
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
21+
* @SuppressWarnings(PHPMD.CookieAndSessionMisuse)
2022
* @since 100.0.2
2123
*/
2224
class Price
@@ -184,6 +186,8 @@ public function getFinalPrice($qty, $product)
184186
}
185187

186188
/**
189+
* Retrieve final price for child product
190+
*
187191
* @param Product $product
188192
* @param float $productQty
189193
* @param Product $childProduct
@@ -428,6 +432,8 @@ public function setTierPrices($product, array $tierPrices = null)
428432
}
429433

430434
/**
435+
* Retrieve customer group id from product
436+
*
431437
* @param Product $product
432438
* @return int
433439
*/
@@ -453,7 +459,7 @@ protected function _applySpecialPrice($product, $finalPrice)
453459
$product->getSpecialPrice(),
454460
$product->getSpecialFromDate(),
455461
$product->getSpecialToDate(),
456-
$product->getStore()
462+
WebsiteInterface::ADMIN_CODE
457463
);
458464
}
459465

@@ -601,7 +607,7 @@ public function calculatePrice(
601607
$specialPrice,
602608
$specialPriceFrom,
603609
$specialPriceTo,
604-
$sId
610+
WebsiteInterface::ADMIN_CODE
605611
);
606612

607613
if ($rulePrice === false) {

app/code/Magento/Catalog/Pricing/Price/SpecialPrice.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
use Magento\Framework\Pricing\Price\AbstractPrice;
1212
use Magento\Framework\Pricing\Price\BasePriceProviderInterface;
1313
use Magento\Framework\Stdlib\DateTime\TimezoneInterface;
14+
use Magento\Store\Api\Data\WebsiteInterface;
1415

1516
/**
1617
* Special price model
@@ -46,6 +47,8 @@ public function __construct(
4647
}
4748

4849
/**
50+
* Retrieve special price.
51+
*
4952
* @return bool|float
5053
*/
5154
public function getValue()
@@ -96,19 +99,19 @@ public function getSpecialToDate()
9699
}
97100

98101
/**
99-
* @return bool
102+
* @inheritdoc
100103
*/
101104
public function isScopeDateInInterval()
102105
{
103106
return $this->localeDate->isScopeDateInInterval(
104-
$this->product->getStore(),
107+
WebsiteInterface::ADMIN_CODE,
105108
$this->getSpecialFromDate(),
106109
$this->getSpecialToDate()
107110
);
108111
}
109112

110113
/**
111-
* @return bool
114+
* @inheritdoc
112115
*/
113116
public function isPercentageDiscount()
114117
{

app/code/Magento/Catalog/Test/Mftf/Section/StorefrontProductInfoMainSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
<element name="productOptionAreaInput" type="textarea" selector="//*[@id='product-options-wrapper']//div[@class='fieldset']//label[contains(.,'{{var1}}')]/../div[@class='control']//textarea" parameterized="true"/>
2929
<element name="productOptionFile" type="file" selector="//*[@id='product-options-wrapper']//div[@class='fieldset']//label[contains(.,'OptionFile')]/../div[@class='control']//input[@type='file']" parameterized="true"/>
3030
<element name="productOptionSelect" type="select" selector="//*[@id='product-options-wrapper']//div[@class='fieldset']//label[contains(.,'{{var1}}')]/../div[@class='control']//select" parameterized="true"/>
31+
<element name="specialPriceValue" type="text" selector="//span[@class='special-price']//span[@class='price']"/>
3132

3233

3334
<!-- The parameter is the nth custom option that you want to get -->
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
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="AdminTierPriceNotAvailableForProductOptionsWithoutTierPriceTest">
12+
<annotations>
13+
<features value="Catalog"/>
14+
<title value="Check that 'trie price' block not available for simple product from options without 'trie price'"/>
15+
<description value="Check that 'trie price' block not available for simple product from options without 'trie price'"/>
16+
<severity value="MAJOR"/>
17+
<testCaseId value="MAGETWO-97050"/>
18+
<useCaseId value="MAGETWO-96842"/>
19+
<group value="catalog"/>
20+
</annotations>
21+
<before>
22+
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
23+
24+
<!--Create category-->
25+
<createData entity="SimpleSubCategory" stepKey="createCategory"/>
26+
27+
<!-- Create the configurable product based on the data in the /data folder -->
28+
<createData entity="ApiConfigurableProduct" stepKey="createConfigProduct">
29+
<requiredEntity createDataKey="createCategory"/>
30+
</createData>
31+
32+
<!-- Make the configurable product have two options, that are children of the default attribute set -->
33+
<createData entity="productAttributeWithTwoOptions" stepKey="createConfigProductAttribute"/>
34+
<createData entity="productAttributeOption1" stepKey="createConfigProductAttributeOption1">
35+
<requiredEntity createDataKey="createConfigProductAttribute"/>
36+
</createData>
37+
<createData entity="productAttributeOption2" stepKey="createConfigProductAttributeOption2">
38+
<requiredEntity createDataKey="createConfigProductAttribute"/>
39+
</createData>
40+
<createData entity="AddToDefaultSet" stepKey="createConfigAddToAttributeSet">
41+
<requiredEntity createDataKey="createConfigProductAttribute"/>
42+
</createData>
43+
<getData entity="ProductAttributeOptionGetter" index="1" stepKey="getConfigAttributeOption1">
44+
<requiredEntity createDataKey="createConfigProductAttribute"/>
45+
</getData>
46+
<getData entity="ProductAttributeOptionGetter" index="2" stepKey="getConfigAttributeOption2">
47+
<requiredEntity createDataKey="createConfigProductAttribute"/>
48+
</getData>
49+
50+
<!-- Create the 2 children that will be a part of the configurable product -->
51+
<createData entity="ApiSimpleOne" stepKey="createConfigChildProduct1">
52+
<requiredEntity createDataKey="createConfigProductAttribute"/>
53+
<requiredEntity createDataKey="getConfigAttributeOption1"/>
54+
</createData>
55+
<createData entity="ApiSimpleTwo" stepKey="createConfigChildProduct2">
56+
<requiredEntity createDataKey="createConfigProductAttribute"/>
57+
<requiredEntity createDataKey="getConfigAttributeOption2"/>
58+
</createData>
59+
60+
<!-- Assign the two products to the configurable product -->
61+
<createData entity="ConfigurableProductTwoOptions" stepKey="createConfigProductOption">
62+
<requiredEntity createDataKey="createConfigProduct"/>
63+
<requiredEntity createDataKey="createConfigProductAttribute"/>
64+
<requiredEntity createDataKey="getConfigAttributeOption1"/>
65+
<requiredEntity createDataKey="getConfigAttributeOption2"/>
66+
</createData>
67+
<createData entity="ConfigurableProductAddChild" stepKey="createConfigProductAddChild1">
68+
<requiredEntity createDataKey="createConfigProduct"/>
69+
<requiredEntity createDataKey="createConfigChildProduct1"/>
70+
</createData>
71+
<createData entity="ConfigurableProductAddChild" stepKey="createConfigProductAddChild2">
72+
<requiredEntity createDataKey="createConfigProduct"/>
73+
<requiredEntity createDataKey="createConfigChildProduct2"/>
74+
</createData>
75+
</before>
76+
<after>
77+
<!--Delete created data-->
78+
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
79+
<deleteData createDataKey="createConfigProduct" stepKey="deleteConfigProduct"/>
80+
<deleteData createDataKey="createConfigChildProduct1" stepKey="deleteConfigChildProduct1"/>
81+
<deleteData createDataKey="createConfigChildProduct2" stepKey="deleteConfigChildProduct2"/>
82+
<deleteData createDataKey="createConfigProductAttribute" stepKey="deleteConfigProductAttribute"/>
83+
84+
<actionGroup ref="logout" stepKey="logoutOfAdmin"/>
85+
</after>
86+
87+
<!--Go to storefront product page an check price box css-->
88+
<amOnPage url="{{StorefrontProductPage.url($$createConfigProduct.custom_attributes[url_key]$$)}}" stepKey="navigateToSimpleProductPage"/>
89+
<waitForPageLoad stepKey="waitForStoreFrontLoad"/>
90+
<selectOption selector="{{StorefrontProductInfoMainSection.productAttributeOptionsSelectButton}}" userInput="$$getConfigAttributeOption1.value$$" stepKey="selectOption"/>
91+
<grabAttributeFrom selector="{{StorefrontProductInfoMainSection.productPrice}}" userInput="class" stepKey="grabGrabPriceClass"/>
92+
<assertNotContains actual="$grabGrabPriceClass" expected=".price-box .price-tier_price" expectedType="string" stepKey="assertNotEquals"/>
93+
</test>
94+
</tests>

0 commit comments

Comments
 (0)