Skip to content

Commit 7dee745

Browse files
author
Joan He
committed
Merge remote-tracking branch 'upstream/2.3-develop' into MC-5648
2 parents d47d4b3 + 8faa1f4 commit 7dee745

File tree

86 files changed

+960
-233
lines changed

Some content is hidden

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

86 files changed

+960
-233
lines changed
Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
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="AdminAttributeTextSwatchesCanBeFiledTest">
12+
<annotations>
13+
<features value="Backend"/>
14+
<stories value="Unable to add more attributes in size"/>
15+
<title value="Check that attribute text swatches can be filed"/>
16+
<description value="Check that attribute text swatches can be filed"/>
17+
<severity value="MAJOR"/>
18+
<testCaseId value="MAGETWO-96710"/>
19+
<useCaseId value="MAGETWO-96409"/>
20+
<group value="backend"/>
21+
<group value="ui"/>
22+
</annotations>
23+
<before>
24+
25+
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
26+
27+
</before>
28+
<after>
29+
<!-- Delete all 10 store views -->
30+
<actionGroup ref="AdminDeleteStoreViewActionGroup" stepKey="deleteStoreView1">
31+
<argument name="customStore" value="customStore"/>
32+
</actionGroup>
33+
<actionGroup ref="AdminDeleteStoreViewActionGroup" stepKey="deleteStoreView2">
34+
<argument name="customStore" value="NewStoreViewData"/>
35+
</actionGroup>
36+
<actionGroup ref="AdminDeleteStoreViewActionGroup" stepKey="deleteStoreView3">
37+
<argument name="customStore" value="storeViewData"/>
38+
</actionGroup>
39+
<actionGroup ref="AdminDeleteStoreViewActionGroup" stepKey="deleteStoreView4">
40+
<argument name="customStore" value="storeViewData1"/>
41+
</actionGroup>
42+
<actionGroup ref="AdminDeleteStoreViewActionGroup" stepKey="deleteStoreView5">
43+
<argument name="customStore" value="storeViewData2"/>
44+
</actionGroup>
45+
<actionGroup ref="AdminDeleteStoreViewActionGroup" stepKey="deleteStoreView6">
46+
<argument name="customStore" value="storeViewData3"/>
47+
</actionGroup>
48+
<actionGroup ref="AdminDeleteStoreViewActionGroup" stepKey="deleteStoreView7">
49+
<argument name="customStore" value="storeViewData4"/>
50+
</actionGroup>
51+
<actionGroup ref="AdminDeleteStoreViewActionGroup" stepKey="deleteStoreView8">
52+
<argument name="customStore" value="storeViewData5"/>
53+
</actionGroup>
54+
<actionGroup ref="AdminDeleteStoreViewActionGroup" stepKey="deleteStoreView9">
55+
<argument name="customStore" value="storeViewData6"/>
56+
</actionGroup>
57+
<actionGroup ref="AdminDeleteStoreViewActionGroup" stepKey="deleteStoreView10">
58+
<argument name="customStore" value="storeViewData7"/>
59+
</actionGroup>
60+
61+
<actionGroup ref="logout" stepKey="logout"/>
62+
</after>
63+
64+
<!-- Create 10 store views -->
65+
<actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createStoreView1">
66+
<argument name="customStore" value="customStore"/>
67+
</actionGroup>
68+
<actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createStoreView2">
69+
<argument name="customStore" value="NewStoreViewData"/>
70+
</actionGroup>
71+
<actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createStoreView3">
72+
<argument name="customStore" value="storeViewData"/>
73+
</actionGroup>
74+
<actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createStoreView4">
75+
<argument name="customStore" value="storeViewData1"/>
76+
</actionGroup>
77+
<actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createStoreView5">
78+
<argument name="customStore" value="storeViewData2"/>
79+
</actionGroup>
80+
<actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createStoreView6">
81+
<argument name="customStore" value="storeViewData3"/>
82+
</actionGroup>
83+
<actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createStoreView7">
84+
<argument name="customStore" value="storeViewData4"/>
85+
</actionGroup>
86+
<actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createStoreView8">
87+
<argument name="customStore" value="storeViewData5"/>
88+
</actionGroup>
89+
<actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createStoreView9">
90+
<argument name="customStore" value="storeViewData6"/>
91+
</actionGroup>
92+
<actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createStoreView10">
93+
<argument name="customStore" value="storeViewData7"/>
94+
</actionGroup>
95+
96+
<!--Navigate to Product attribute page-->
97+
<amOnPage url="{{ProductAttributePage.url}}" stepKey="navigateToNewProductAttributePage"/>
98+
<waitForPageLoad stepKey="waitForPageLoad"/>
99+
<fillField userInput="test_label" selector="{{AttributePropertiesSection.DefaultLabel}}" stepKey="fillDefaultLabel"/>
100+
<selectOption selector="{{AttributePropertiesSection.InputType}}" userInput="Text Swatch" stepKey="selectInputType"/>
101+
<click selector="{{AttributePropertiesSection.addSwatch}}" stepKey="clickAddSwatch"/>
102+
<waitForAjaxLoad stepKey="waitForAjaxLoad"/>
103+
104+
<!-- Fill Swatch and Description fields for Admin -->
105+
<fillField selector="{{AttributeManageSwatchSection.swatchField('Admin')}}" userInput="test" stepKey="fillSwatchForAdmin"/>
106+
<fillField selector="{{AttributeManageSwatchSection.descriptionField('Admin')}}" userInput="test" stepKey="fillDescriptionForAdmin"/>
107+
108+
<!-- Grab value Swatch and Description fields for Admin -->
109+
<grabValueFrom selector="{{AttributeManageSwatchSection.swatchField('Admin')}}" stepKey="grabSwatchForAdmin"/>
110+
<grabValueFrom selector="{{AttributeManageSwatchSection.descriptionField('Admin')}}" stepKey="grabDescriptionForAdmin"/>
111+
112+
<!-- Check that Swatch and Description fields for Admin are not empty-->
113+
<assertNotEmpty actual="$grabSwatchForAdmin" stepKey="checkSwatchFieldForAdmin"/>
114+
<assertNotEmpty actual="$grabDescriptionForAdmin" stepKey="checkDescriptionFieldForAdmin"/>
115+
</test>
116+
</tests>

app/code/Magento/Catalog/Api/CategoryLinkRepositoryInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public function delete(\Magento\Catalog\Api\Data\CategoryProductLinkInterface $p
3939
/**
4040
* Remove the product assignment from the category by category id and sku
4141
*
42-
* @param string $categoryId
42+
* @param int $categoryId
4343
* @param string $sku
4444
* @return bool will returned True if products successfully deleted
4545
*

app/code/Magento/Catalog/Api/Data/ProductRender/PriceInfoInterface.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
/**
1010
* Price interface.
11+
*
1112
* @api
1213
* @since 101.1.0
1314
*/
@@ -23,6 +24,7 @@ public function getFinalPrice();
2324

2425
/**
2526
* Set the final price: usually it calculated as minimal price of the product
27+
*
2628
* Can be different depends on type of product
2729
*
2830
* @param float $finalPrice
@@ -33,6 +35,7 @@ public function setFinalPrice($finalPrice);
3335

3436
/**
3537
* Retrieve max price of a product
38+
*
3639
* E.g. for product with custom options is price with the most expensive custom option
3740
*
3841
* @return float
@@ -51,6 +54,7 @@ public function setMaxPrice($maxPrice);
5154

5255
/**
5356
* Set max regular price
57+
*
5458
* Max regular price is the same, as maximum price, except of excluding calculating special price and catalog rules
5559
* in it
5660
*
@@ -105,6 +109,8 @@ public function setSpecialPrice($specialPrice);
105109
public function getSpecialPrice();
106110

107111
/**
112+
* Retrieve minimal price
113+
*
108114
* @return float
109115
* @since 101.1.0
110116
*/
@@ -129,6 +135,7 @@ public function getRegularPrice();
129135

130136
/**
131137
* Regular price - is price of product without discounts and special price with taxes and fixed product tax
138+
*
132139
* Usually this price is corresponding to price in admin panel of product
133140
*
134141
* @param float $regularPrice
@@ -148,7 +155,7 @@ public function getFormattedPrices();
148155
/**
149156
* Set dto with formatted prices
150157
*
151-
* @param string[] $formattedPriceInfo
158+
* @param FormattedPriceInfoInterface $formattedPriceInfo
152159
* @return void
153160
* @since 101.1.0
154161
*/

app/code/Magento/Catalog/Api/Data/ProductRenderInterface.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public function getAddToCartButton();
3030
/**
3131
* Set information needed for render "Add To Cart" button on front
3232
*
33-
* @param \Magento\Catalog\Api\Data\ProductRender\ButtonInterface $addToCartData
33+
* @param ButtonInterface $cartAddToCartButton
3434
* @return void
3535
* @since 101.1.0
3636
*/
@@ -47,14 +47,15 @@ public function getAddToCompareButton();
4747
/**
4848
* Set information needed for render "Add To Compare" button on front
4949
*
50-
* @param ButtonInterface $compareUrlData
50+
* @param ButtonInterface $compareButton
5151
* @return string
5252
* @since 101.1.0
5353
*/
5454
public function setAddToCompareButton(ButtonInterface $compareButton);
5555

5656
/**
5757
* Provide information needed for render prices and adjustments for different product types on front
58+
*
5859
* Prices are represented in raw format and in current currency
5960
*
6061
* @return \Magento\Catalog\Api\Data\ProductRender\PriceInfoInterface
@@ -73,6 +74,7 @@ public function setPriceInfo(PriceInfoInterface $priceInfo);
7374

7475
/**
7576
* Provide enough information, that needed to render image on front
77+
*
7678
* Images can be separated by image codes
7779
*
7880
* @return \Magento\Catalog\Api\Data\ProductRender\ImageInterface[]
@@ -167,6 +169,7 @@ public function getIsSalable();
167169

168170
/**
169171
* Set information about product saleability (Stock, other conditions)
172+
*
170173
* Is used to provide information to frontend JS renders
171174
* You can add plugin, in order to hide product on product page or product list on front
172175
*
@@ -178,6 +181,7 @@ public function setIsSalable($isSalable);
178181

179182
/**
180183
* Provide information about current store id or requested store id
184+
*
181185
* Product should be assigned to provided store id
182186
* This setting affect store scope attributes
183187
*
@@ -197,6 +201,7 @@ public function setStoreId($storeId);
197201

198202
/**
199203
* Provide current or desired currency code to product
204+
*
200205
* This setting affect formatted prices*
201206
*
202207
* @return string

app/code/Magento/Catalog/Block/Adminhtml/Product/Frontend/Product/Watermark.php

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44
* See COPYING.txt for license details.
55
*/
66

7+
namespace Magento\Catalog\Block\Adminhtml\Product\Frontend\Product;
8+
9+
use Magento\Framework\Data\Form\Element\AbstractElement;
10+
711
/**
812
* Fieldset config form element renderer
913
*
1014
* @author Magento Core Team <[email protected]>
1115
*/
12-
namespace Magento\Catalog\Block\Adminhtml\Product\Frontend\Product;
13-
14-
use Magento\Framework\Data\Form\Element\AbstractElement;
15-
1616
class Watermark extends \Magento\Backend\Block\AbstractBlock implements
1717
\Magento\Framework\Data\Form\Element\Renderer\RendererInterface
1818
{
@@ -60,6 +60,8 @@ public function __construct(
6060
}
6161

6262
/**
63+
* Render form element as HTML
64+
*
6365
* @param AbstractElement $element
6466
* @return string
6567
*/
@@ -124,13 +126,14 @@ public function render(AbstractElement $element)
124126
}
125127

126128
/**
129+
* Get header html for render
130+
*
127131
* @param AbstractElement $element
128132
* @return string
129133
* @SuppressWarnings(PHPMD.UnusedLocalVariable)
130134
*/
131135
protected function _getHeaderHtml($element)
132136
{
133-
$id = $element->getHtmlId();
134137
$default = !$this->getRequest()->getParam('website') && !$this->getRequest()->getParam('store');
135138

136139
$html = '<h4 class="icon-head head-edit-form">' . $element->getLegend() . '</h4>';
@@ -148,6 +151,8 @@ protected function _getHeaderHtml($element)
148151
}
149152

150153
/**
154+
* Get footer html for render
155+
*
151156
* @param AbstractElement $element
152157
* @return string
153158
* @SuppressWarnings(PHPMD.UnusedFormalParameter)

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88

99
use Magento\Framework\App\Action\HttpPostActionInterface as HttpPostActionInterface;
1010

11+
/**
12+
* Move category admin controller
13+
*/
1114
class Move extends \Magento\Catalog\Controller\Adminhtml\Category implements HttpPostActionInterface
1215
{
1316
/**
@@ -46,7 +49,7 @@ public function __construct(
4649
/**
4750
* Move category action
4851
*
49-
* @return \Magento\Framework\Controller\Result\Raw
52+
* @return \Magento\Framework\Controller\Result\Json
5053
*/
5154
public function execute()
5255
{

app/code/Magento/Catalog/Controller/Index/Index.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,17 @@
55
*/
66
namespace Magento\Catalog\Controller\Index;
77

8-
class Index extends \Magento\Framework\App\Action\Action
8+
use Magento\Framework\App\Action\HttpGetActionInterface;
9+
10+
/**
11+
* Catalog index page controller.
12+
*/
13+
class Index extends \Magento\Framework\App\Action\Action implements HttpGetActionInterface
914
{
1015
/**
1116
* Index action
1217
*
13-
* @return $this
18+
* @return \Magento\Framework\Controller\Result\Redirect
1419
*/
1520
public function execute()
1621
{

app/code/Magento/Catalog/Helper/Product/Configuration.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ class Configuration extends AbstractHelper implements ConfigurationInterface
5555
* @param \Magento\Framework\Filter\FilterManager $filter
5656
* @param \Magento\Framework\Stdlib\StringUtils $string
5757
* @param Json $serializer
58+
* @param Escaper $escaper
5859
*/
5960
public function __construct(
6061
\Magento\Framework\App\Helper\Context $context,

app/code/Magento/Catalog/Helper/Product/ProductList.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ class ProductList
4242

4343
/**
4444
* @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig
45+
* @param \Magento\Framework\Registry $coreRegistry
4546
*/
4647
public function __construct(
4748
\Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig,

app/code/Magento/Catalog/Helper/Product/View.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@
1010

1111
/**
1212
* Catalog category helper
13+
*
1314
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
15+
* @SuppressWarnings(PHPMD.CookieAndSessionMisuse)
1416
*/
1517
class View extends \Magento\Framework\App\Helper\AbstractHelper
1618
{
@@ -105,7 +107,7 @@ public function __construct(
105107
*
106108
* @param \Magento\Framework\View\Result\Page $resultPage
107109
* @param \Magento\Catalog\Model\Product $product
108-
* @return \Magento\Framework\View\Result\Page
110+
* @return $this
109111
*/
110112
private function preparePageMetadata(ResultPage $resultPage, $product)
111113
{

app/code/Magento/Catalog/Model/Indexer/Product/Category/Action/Rows.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
use Magento\Store\Model\StoreManagerInterface;
1818

1919
/**
20+
* Category rows indexer.
21+
*
2022
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
2123
*/
2224
class Rows extends \Magento\Catalog\Model\Indexer\Category\Product\AbstractAction
@@ -213,6 +215,7 @@ protected function isRangingNeeded()
213215
/**
214216
* Returns a list of category ids which are assigned to product ids in the index
215217
*
218+
* @param array $productIds
216219
* @return \Magento\Framework\Indexer\CacheContext
217220
*/
218221
private function getCategoryIdsFromIndex(array $productIds)

app/code/Magento/Catalog/Model/Indexer/Product/Flat/Action/Indexer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public function __construct(
5454
* @param int $storeId
5555
* @param int $productId
5656
* @param string $valueFieldSuffix
57-
* @return \Magento\Catalog\Model\Indexer\Product\Flat
57+
* @return $this
5858
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
5959
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
6060
* @SuppressWarnings(PHPMD.NPathComplexity)

0 commit comments

Comments
 (0)