Skip to content

Commit 17277f5

Browse files
Merge pull request magento#32523 to magento#32425
2 parents 2a09f12 + a64886e commit 17277f5

File tree

84 files changed

+2106
-251
lines changed

Some content is hidden

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

84 files changed

+2106
-251
lines changed

app/code/Magento/AwsS3/Test/Mftf/Helper/S3FileAssertions.php

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,21 @@ public function assertFileExists($filePath, $message = ''): void
149149
$this->assertTrue($this->driver->isExists($filePath), $message);
150150
}
151151

152+
/**
153+
* Asserts that a file with the given glob pattern exists in the given path on the remote storage system
154+
*
155+
* @param string $path
156+
* @param string $pattern
157+
* @param string $message
158+
*
159+
* @throws \Magento\Framework\Exception\FileSystemException
160+
*/
161+
public function assertGlobbedFileExists($path, $pattern, $message = ""): void
162+
{
163+
$files = $this->driver->search($pattern, $path);
164+
$this->assertNotEmpty($files, $message);
165+
}
166+
152167
/**
153168
* Assert a file does not exist on the remote storage system
154169
*
@@ -206,6 +221,24 @@ public function assertFileContainsString($filePath, $text, $message = ""): void
206221
$this->assertStringContainsString($text, $this->driver->fileGetContents($filePath), $message);
207222
}
208223

224+
/**
225+
* Asserts that a file with the given glob pattern at the given path on the remote storage system contains a given string
226+
*
227+
* @param string $path
228+
* @param string $pattern
229+
* @param string $text
230+
* @param int $fileIndex
231+
* @param string $message
232+
* @return void
233+
*
234+
* @throws \Magento\Framework\Exception\FileSystemException
235+
*/
236+
public function assertGlobbedFileContainsString($path, $pattern, $text, $fileIndex = 0, $message = ""): void
237+
{
238+
$files = $this->driver->search($pattern, $path);
239+
$this->assertStringContainsString($text, $this->driver->fileGetContents($files[$fileIndex] ?? ''), $message);
240+
}
241+
209242
/**
210243
* Assert a file on the remote storage system does not contain a given string
211244
*

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
</createData>
4242

4343
<actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex">
44-
<argument name="indices" value="cataloginventory_stock catalog_product_price"/>
44+
<argument name="indices" value=""/>
4545
</actionGroup>
4646
</before>
4747
<after>

app/code/Magento/Catalog/Block/Ui/ProductViewCounter.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ public function getCurrentProductData()
153153
$this->productRenderCollectorComposite
154154
->collect($product, $productRender);
155155
$data = $this->hydrator->extract($productRender);
156+
$data['is_available'] = $product->isAvailable();
156157

157158
$currentProductData = [
158159
'items' => [

app/code/Magento/Catalog/Model/Layer/ContextInterface.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
*
1717
* As Magento moves from inheritance-based APIs all such classes will be deprecated together with their
1818
* corresponding abstract classes.
19+
*
20+
* @deprecated
1921
*/
2022
interface ContextInterface
2123
{

app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminClickOnAdvancedInventoryLinkActionGroup.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,7 @@
1717

1818
<click selector="{{AdminProductFormSection.advancedInventoryLink}}" stepKey="clickOnAdvancedInventoryLink"/>
1919
<waitForPageLoad stepKey="waitForAdvancedInventoryPageToLoad"/>
20+
<!-- Wait for close button appeared. That means animation finished and modal window is fully visible -->
21+
<waitForElementVisible selector="{{AdminProductFormAdvancedInventorySection.advancedInventoryCloseButton}}" stepKey="waitForCloseButtonAppeared"/>
2022
</actionGroup>
2123
</actionGroups>

app/code/Magento/Catalog/Test/Mftf/Data/ProductData.xml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@
3939
<data key="name">TestFooBar</data>
4040
<data key="sku" unique="suffix">foobar</data>
4141
</entity>
42+
<entity name="ApiSimpleProductWithDoubleSpaces" type="product" extends="ApiSimpleProduct">
43+
<data key="name">Simple Product Double Space</data>
44+
<data key="sku" unique="suffix">simple-product double-space</data>
45+
</entity>
4246
<entity name="ApiSimpleProductWithSpecCharInName" type="product" extends="ApiSimpleProduct">
4347
<data key="name">Pursuit Lumaflex&#38;trade; Tone Band</data>
4448
<data key="sku" unique="suffix">x&#38;trade;</data>
@@ -1392,9 +1396,34 @@
13921396
<entity name="SimpleProductUpdatePrice16" type="product2">
13931397
<data key="price">16.00</data>
13941398
</entity>
1399+
<entity name="SimpleProductUpdatePrice90" type="product2">
1400+
<data key="price">90.00</data>
1401+
</entity>
1402+
<entity name="SimpleProductUpdatePrice95" type="product2">
1403+
<data key="price">95.00</data>
1404+
</entity>
1405+
<entity name="SimpleProductUpdatePrice80" type="product2">
1406+
<data key="price">80.00</data>
1407+
</entity>
13951408
<entity name="ProductWithTwoTextFieldOptions" type="product">
13961409
<var key="sku" entityType="product" entityKey="sku" />
13971410
<requiredEntity type="product_option">ProductOptionField</requiredEntity>
13981411
<requiredEntity type="product_option">ProductOptionField2</requiredEntity>
13991412
</entity>
1413+
<entity name="SimpleProductWithCustomSku24MB01" type="product" extends="SimpleProduct2">
1414+
<data key="name" unique="suffix">ProductWithSku24MB01-</data>
1415+
<data key="sku" unique="suffix">24 MB01</data>
1416+
</entity>
1417+
<entity name="SimpleProductWithCustomSku24MB02" type="product" extends="SimpleProduct2">
1418+
<data key="name" unique="suffix">ProductWithSku24MB02-</data>
1419+
<data key="sku" unique="suffix">24 MB02 </data>
1420+
</entity>
1421+
<entity name="SimpleProductWithCustomSku24MB04" type="product" extends="SimpleProduct2">
1422+
<data key="name" unique="suffix">ProductWithSku24MB04-</data>
1423+
<data key="sku" unique="suffix">24 MB04 </data>
1424+
</entity>
1425+
<entity name="SimpleProductWithCustomSku24MB06" type="product" extends="SimpleProduct2">
1426+
<data key="name" unique="suffix">ProductWithSku24MB06-</data>
1427+
<data key="sku" unique="suffix">24 MB06 </data>
1428+
</entity>
14001429
</entities>

app/code/Magento/Catalog/Test/Mftf/Helper/LocalFileAssertions.php

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,22 @@ public function assertFileExists($filePath, $message = ''): void
134134
$this->assertTrue($this->driver->isExists($realPath), $message);
135135
}
136136

137+
/**
138+
* Asserts that a file with the given glob pattern exists in the given path
139+
*
140+
* @param string $path
141+
* @param string $pattern
142+
* @param string $message
143+
*
144+
* @throws \Magento\Framework\Exception\FileSystemException
145+
*/
146+
public function assertGlobbedFileExists($path, $pattern, $message = ""): void
147+
{
148+
$realPath = $this->expandPath($path);
149+
$files = $this->driver->search($pattern, $realPath);
150+
$this->assertNotEmpty($files, $message);
151+
}
152+
137153
/**
138154
* Assert a file does not exist
139155
*
@@ -195,6 +211,25 @@ public function assertFileContainsString($filePath, $text, $message = ""): void
195211
$this->assertStringContainsString($text, $this->driver->fileGetContents($realPath), $message);
196212
}
197213

214+
/**
215+
* Asserts that a file with the given glob pattern at the given path contains a given string
216+
*
217+
* @param string $path
218+
* @param string $pattern
219+
* @param string $text
220+
* @param int $fileIndex
221+
* @param string $message
222+
* @return void
223+
*
224+
* @throws \Magento\Framework\Exception\FileSystemException
225+
*/
226+
public function assertGlobbedFileContainsString($path, $pattern, $text, $fileIndex = 0, $message = ""): void
227+
{
228+
$realPath = $this->expandPath($path);
229+
$files = $this->driver->search($pattern, $realPath);
230+
$this->assertStringContainsString($text, $this->driver->fileGetContents($files[$fileIndex] ?? ''), $message);
231+
}
232+
198233
/**
199234
* Assert a file does not contain a given string
200235
*
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
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" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
10+
<test name="AdminShowDoubleSpacesInProductGrid">
11+
<annotations>
12+
<features value="Catalog"/>
13+
<stories value="Edit products"/>
14+
<title value="Show double spaces in the product grid"/>
15+
<description value="Admin should be able to see double spaces in the Name and Sku fields in the product grid"/>
16+
<testCaseId value="MC-40725"/>
17+
<useCaseId value="MC-40122"/>
18+
<severity value="AVERAGE"/>
19+
<group value="Catalog"/>
20+
</annotations>
21+
22+
<before>
23+
<createData entity="ApiCategory" stepKey="createCategory"/>
24+
<createData entity="ApiSimpleProductWithDoubleSpaces" stepKey="createProduct">
25+
<requiredEntity createDataKey="createCategory"/>
26+
</createData>
27+
<magentoCLI command="cron:run --group=index" stepKey="cronRun"/>
28+
<magentoCLI command="cron:run --group=index" stepKey="cronRunSecondTime"/>
29+
</before>
30+
31+
<after>
32+
<actionGroup ref="AdminDeleteAllProductsFromGridActionGroup" stepKey="deleteProduct"/>
33+
<actionGroup ref="ClearFiltersAdminProductGridActionGroup" stepKey="clearGridFilters"/>
34+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
35+
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
36+
</after>
37+
38+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
39+
<actionGroup ref="AdminOpenCatalogProductPageActionGroup" stepKey="goToProductCatalogPage"/>
40+
<actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="searchForProduct">
41+
<argument name="product" value="$createProduct$"/>
42+
</actionGroup>
43+
<actionGroup ref="AssertAdminProductGridCellActionGroup" stepKey="assertProductName">
44+
<argument name="column" value="Name"/>
45+
<argument name="value" value="$createProduct.name$"/>
46+
</actionGroup>
47+
<actionGroup ref="AssertAdminProductGridCellActionGroup" stepKey="assertProductSku">
48+
<argument name="column" value="SKU"/>
49+
<argument name="value" value="$createProduct.sku$"/>
50+
</actionGroup>
51+
</test>
52+
</tests>

app/code/Magento/Catalog/Test/Unit/Block/Ui/ProductViewCounterTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,14 +166,14 @@ public function testGetCurrentProductDataWithNonEmptyProduct()
166166
{
167167
$productMock = $this->getMockBuilder(ProductInterface::class)
168168
->disableOriginalConstructor()
169+
->addMethods(['isAvailable'])
169170
->getMockForAbstractClass();
170171
$productRendererMock = $this->getMockBuilder(ProductRenderInterface::class)
171172
->disableOriginalConstructor()
172173
->getMockForAbstractClass();
173174
$storeMock = $this->getMockBuilder(Store::class)
174175
->disableOriginalConstructor()
175176
->getMock();
176-
177177
$this->registryMock->expects($this->once())
178178
->method('registry')
179179
->with('product')

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@
132132
<settings>
133133
<addField>true</addField>
134134
<filter>text</filter>
135-
<bodyTmpl>ui/grid/cells/html</bodyTmpl>
135+
<bodyTmpl>Magento_Catalog/grid/cells/preserved</bodyTmpl>
136136
<label translate="true">Name</label>
137137
</settings>
138138
</column>
@@ -155,7 +155,7 @@
155155
<column name="sku" sortOrder="60">
156156
<settings>
157157
<filter>text</filter>
158-
<bodyTmpl>ui/grid/cells/html</bodyTmpl>
158+
<bodyTmpl>Magento_Catalog/grid/cells/preserved</bodyTmpl>
159159
<label translate="true">SKU</label>
160160
</settings>
161161
</column>

0 commit comments

Comments
 (0)