Skip to content

Commit 4cd8e10

Browse files
merge magento/2.3-develop into magento-performance/MC-18191
2 parents 9e5b46e + 4184f63 commit 4cd8e10

File tree

54 files changed

+1649
-164
lines changed

Some content is hidden

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

54 files changed

+1649
-164
lines changed

app/code/Magento/Backend/Block/Page/RequireJs.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ public function __construct(
2929
\Magento\Framework\Data\Form\FormKey $formKey,
3030
array $data = []
3131
) {
32-
$this->formKey = $formKey;
3332
parent::__construct(
3433
$context,
3534
$data
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
declare(strict_types=1);
7+
8+
namespace Magento\Bundle\Setup\Patch\Schema;
9+
10+
use Magento\Framework\Setup\Patch\SchemaPatchInterface;
11+
use Magento\Framework\Setup\SchemaSetupInterface;
12+
13+
/**
14+
* Change engine for temporary tables to InnoDB.
15+
*/
16+
class ChangeTmpTablesEngine implements SchemaPatchInterface
17+
{
18+
/**
19+
* @var SchemaSetupInterface
20+
*/
21+
private $schemaSetup;
22+
23+
/**
24+
* @param SchemaSetupInterface $schemaSetup
25+
*/
26+
public function __construct(SchemaSetupInterface $schemaSetup)
27+
{
28+
$this->schemaSetup = $schemaSetup;
29+
}
30+
31+
/**
32+
* @inheritdoc
33+
*/
34+
public function apply()
35+
{
36+
$this->schemaSetup->startSetup();
37+
38+
$tables = [
39+
'catalog_product_index_price_bundle_tmp',
40+
'catalog_product_index_price_bundle_sel_tmp',
41+
'catalog_product_index_price_bundle_opt_tmp',
42+
];
43+
foreach ($tables as $table) {
44+
$this->schemaSetup->getConnection()->changeTableEngine($table, 'InnoDB');
45+
}
46+
47+
$this->schemaSetup->endSetup();
48+
}
49+
50+
/**
51+
* @inheritdoc
52+
*/
53+
public static function getDependencies()
54+
{
55+
return [];
56+
}
57+
58+
/**
59+
* @inheritdoc
60+
*/
61+
public function getAliases()
62+
{
63+
return [];
64+
}
65+
}
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
declare(strict_types=1);
7+
8+
namespace Magento\Catalog\Setup\Patch\Schema;
9+
10+
use Magento\Framework\Setup\Patch\SchemaPatchInterface;
11+
use Magento\Framework\Setup\SchemaSetupInterface;
12+
13+
/**
14+
* Change engine for temporary tables to InnoDB.
15+
*/
16+
class ChangeTmpTablesEngine implements SchemaPatchInterface
17+
{
18+
/**
19+
* @var SchemaSetupInterface
20+
*/
21+
private $schemaSetup;
22+
23+
/**
24+
* @param SchemaSetupInterface $schemaSetup
25+
*/
26+
public function __construct(SchemaSetupInterface $schemaSetup)
27+
{
28+
$this->schemaSetup = $schemaSetup;
29+
}
30+
31+
/**
32+
* @inheritdoc
33+
*/
34+
public function apply()
35+
{
36+
$this->schemaSetup->startSetup();
37+
38+
$tables = [
39+
'catalog_product_index_price_cfg_opt_agr_tmp',
40+
'catalog_product_index_price_cfg_opt_tmp',
41+
'catalog_product_index_price_final_tmp',
42+
'catalog_product_index_price_opt_tmp',
43+
'catalog_product_index_price_opt_agr_tmp',
44+
'catalog_product_index_eav_tmp',
45+
'catalog_product_index_eav_decimal_tmp',
46+
'catalog_product_index_price_tmp',
47+
'catalog_category_product_index_tmp',
48+
];
49+
foreach ($tables as $table) {
50+
$this->schemaSetup->getConnection()->changeTableEngine($table, 'InnoDB');
51+
}
52+
53+
$this->schemaSetup->endSetup();
54+
}
55+
56+
/**
57+
* @inheritdoc
58+
*/
59+
public static function getDependencies()
60+
{
61+
return [];
62+
}
63+
64+
/**
65+
* @inheritdoc
66+
*/
67+
public function getAliases()
68+
{
69+
return [];
70+
}
71+
}

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

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,14 @@
392392
<waitForPageLoad stepKey="waitForSave"/>
393393
</actionGroup>
394394

395+
<!-- Action group assign to one website and unassign from another -->
396+
<actionGroup name="AdminProcessProductWebsitesActionGroup" extends="CreatedProductConnectToWebsite">
397+
<arguments>
398+
<argument name="websiteToUnassign"/>
399+
</arguments>
400+
<uncheckOption selector="{{ProductInWebsitesSection.website(websiteToUnassign.name)}}" after="SelectWebsite" stepKey="uncheckWebsite"/>
401+
</actionGroup>
402+
395403
<!--Check tier price with a discount percentage on product-->
396404
<actionGroup name="AssertDiscountsPercentageOfProducts">
397405
<arguments>
@@ -542,4 +550,11 @@
542550
<remove keyForRemoval="seeCheckboxForWebsite"/>
543551
<seeCheckboxIsChecked selector="{{ProductInWebsitesSection.website(website)}}" after="expandProductWebsitesSection" stepKey="seeCustomWebsiteIsChecked"/>
544552
</actionGroup>
553+
554+
<!-- You are on product Edit Page -->
555+
<!-- Assert checkbox is not checked for website in Product In Websites -->
556+
<actionGroup name="AssertProductIsNotAssignedToWebsite" extends="AssertWebsiteIsAvailableInProductWebsites">
557+
<remove keyForRemoval="seeCheckboxForWebsite"/>
558+
<dontSeeCheckboxIsChecked selector="{{ProductInWebsitesSection.website(website)}}" after="expandProductWebsitesSection" stepKey="seeCustomWebsiteIsNotChecked"/>
559+
</actionGroup>
545560
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
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" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
10+
<!-- Assert 404 Page Not Found on product detail page -->
11+
<actionGroup name="StorefrontAssertPageNotFoundErrorOnProductDetailPageActionGroup">
12+
<arguments>
13+
<argument name="product"/>
14+
</arguments>
15+
<see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="Whoops, our bad..." stepKey="assert404Page"/>
16+
<dontSee selector="{{StorefrontProductInfoMainSection.productName}}" userInput="{{product.name}}" stepKey="dontSeeProductName"/>
17+
<seeInCurrentUrl url="/{{product.custom_attributes[url_key]}}.html" stepKey="checkProductUrl"/>
18+
</actionGroup>
19+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
9+
<!-- Action group opens product detail page from second website using Store code in URL option -->
10+
<actionGroup name="StorefrontOpenProductPageUsingStoreCodeInUrlActionGroup">
11+
<arguments>
12+
<argument name="product"/>
13+
<argument name="storeView"/>
14+
</arguments>
15+
<amOnPage url="/{{storeView.code}}/{{product.custom_attributes[url_key]}}.html" stepKey="openProductPageUsingStoreCodeInUrl"/>
16+
<see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="{{product.name}}" stepKey="assertProductName"/>
17+
</actionGroup>
18+
</actionGroups>
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
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="AdminShouldBeAbleToAssociateSimpleProductToWebsitesTest">
12+
<annotations>
13+
<features value="Catalog"/>
14+
<stories value="Edit products"/>
15+
<title value="Admin should be able to associate simple product to websites"/>
16+
<description value="Admin should be able to associate simple product to websites"/>
17+
<testCaseId value="MC-3483"/>
18+
<group value="catalog"/>
19+
<severity value="AVERAGE"/>
20+
</annotations>
21+
22+
<before>
23+
<magentoCLI command="config:set {{StorefrontEnableAddStoreCodeToUrls.path}} {{StorefrontEnableAddStoreCodeToUrls.value}}" stepKey="setAddStoreCodeToUrlsToYes"/>
24+
<createData entity="secondCustomWebsite" stepKey="createCustomWebsite"/>
25+
<createData entity="SimpleProduct2" stepKey="createSimpleProduct"/>
26+
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
27+
<actionGroup ref="AdminStoreGroupCreateActionGroup" stepKey="createNewStore">
28+
<argument name="Website" value="secondCustomWebsite"/>
29+
<argument name="storeGroup" value="customStoreGroup"/>
30+
</actionGroup>
31+
<actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createCustomStoreView">
32+
<argument name="StoreGroup" value="customStoreGroup"/>
33+
<argument name="customStore" value="customStoreEN"/>
34+
</actionGroup>
35+
</before>
36+
37+
<after>
38+
<magentoCLI command="config:set {{StorefrontDisableAddStoreCodeToUrls.path}} {{StorefrontDisableAddStoreCodeToUrls.value}}" stepKey="setAddStoreCodeToUrlsToNo"/>
39+
<deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/>
40+
<!-- Delete second website -->
41+
<actionGroup ref="DeleteCustomWebsiteActionGroup" stepKey="deleteCustomWeWebsite">
42+
<argument name="websiteName" value="$createCustomWebsite.website[name]$"/>
43+
</actionGroup>
44+
<actionGroup ref="AdminGridFilterResetActionGroup" stepKey="resetFiltersOnStoresIndexPage"/>
45+
<actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="openProductIndexPageToResetFilters"/>
46+
<actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearFiltersOnProductIndexPage"/>
47+
<actionGroup ref="logout" stepKey="logout"/>
48+
</after>
49+
50+
<!-- 1. Go to product page in admin panel to edit -->
51+
<actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="openProductIndexPageToAssociateToSecondWebsite"/>
52+
<actionGroup ref="filterProductGridByName2" stepKey="filterProductInGrid">
53+
<argument name="name" value="$$createSimpleProduct.name$$"/>
54+
</actionGroup>
55+
56+
<!-- 2. Go to Product in Websites tab, unassign product from Main website and assign it to Second website -->
57+
<actionGroup ref="AdminProcessProductWebsitesActionGroup" stepKey="processProductWebsites">
58+
<argument name="website" value="secondCustomWebsite"/>
59+
<argument name="websiteToUnassign" value="_defaultWebsite"/>
60+
<argument name="product" value="$$createSimpleProduct$$"/>
61+
</actionGroup>
62+
<actionGroup ref="AssertProductIsAssignedToWebsite" stepKey="seeCustomWebsiteIsChecked">
63+
<argument name="website" value="$createCustomWebsite.website[name]$"/>
64+
</actionGroup>
65+
<actionGroup ref="AssertProductIsNotAssignedToWebsite" stepKey="seeMainWebsiteIsNotChecked">
66+
<argument name="website" value="{{_defaultWebsite.name}}"/>
67+
</actionGroup>
68+
69+
<!-- 3. Go to frontend and open Simple product on Main website and assert 404 page-->
70+
<actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openProductPage">
71+
<argument name="productUrl" value="$createSimpleProduct.custom_attributes[url_key]$"/>
72+
</actionGroup>
73+
<actionGroup ref="StorefrontAssertPageNotFoundErrorOnProductDetailPageActionGroup" stepKey="assertPageNotFoundErrorOnProductDetailPage">
74+
<argument name="product" value="$$createSimpleProduct$$"/>
75+
</actionGroup>
76+
77+
<!-- 4. Open Simple product on Second website and assert its name -->
78+
<actionGroup ref="StorefrontOpenProductPageUsingStoreCodeInUrlActionGroup" stepKey="openProductPageUsingStoreCodeInUrl">
79+
<argument name="product" value="$$createSimpleProduct$$"/>
80+
<argument name="storeView" value="customStoreEN"/>
81+
</actionGroup>
82+
</test>
83+
</tests>

app/code/Magento/Catalog/Test/Mftf/Test/AdminSimpleSetEditRelatedProductsTest.xml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@
2222
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
2323
<createData entity="SimpleProduct2" stepKey="simpleProduct0"/>
2424
<createData entity="SimpleProduct2" stepKey="simpleProduct1"/>
25+
<createData entity="SimpleProduct2" stepKey="simpleProduct2"/>
26+
<createData entity="SimpleProduct2" stepKey="simpleProduct3"/>
27+
<createData entity="SimpleProduct2" stepKey="simpleProduct4"/>
28+
<createData entity="SimpleProduct2" stepKey="simpleProduct5"/>
29+
<createData entity="SimpleProduct2" stepKey="simpleProduct6"/>
2530
</before>
2631
<after>
2732
<!-- Delete simple product -->
@@ -31,6 +36,11 @@
3136
<amOnPage url="{{AdminLogoutPage.url}}" stepKey="amOnLogoutPage"/>
3237
<deleteData createDataKey="simpleProduct0" stepKey="deleteSimpleProduct0"/>
3338
<deleteData createDataKey="simpleProduct1" stepKey="deleteSimpleProduct1"/>
39+
<deleteData createDataKey="simpleProduct2" stepKey="deleteSimpleProduct2"/>
40+
<deleteData createDataKey="simpleProduct3" stepKey="deleteSimpleProduct3"/>
41+
<deleteData createDataKey="simpleProduct4" stepKey="deleteSimpleProduct4"/>
42+
<deleteData createDataKey="simpleProduct5" stepKey="deleteSimpleProduct5"/>
43+
<deleteData createDataKey="simpleProduct6" stepKey="deleteSimpleProduct6"/>
3444
</after>
3545

3646
<!--Create product-->
@@ -69,6 +79,28 @@
6979
<conditionalClick selector="{{AdminProductFormRelatedUpSellCrossSellSection.relatedDropdown}}" dependentSelector="{{AdminProductFormRelatedUpSellCrossSellSection.relatedDependent}}" visible="false" stepKey="openDropDownIfClosedRelatedSee"/>
7080
<see selector="{{AdminProductFormRelatedUpSellCrossSellSection.selectedRelatedProduct}}" userInput="$$simpleProduct1.sku$$" stepKey="seeRelatedProduct"/>
7181

82+
<!--See more related products in admin-->
83+
<actionGroup ref="addRelatedProductBySku" stepKey="addRelatedProduct2">
84+
<argument name="sku" value="$$simpleProduct2.sku$$"/>
85+
</actionGroup>
86+
<actionGroup ref="addRelatedProductBySku" stepKey="addRelatedProduct3">
87+
<argument name="sku" value="$$simpleProduct3.sku$$"/>
88+
</actionGroup>
89+
<actionGroup ref="addRelatedProductBySku" stepKey="addRelatedProduct4">
90+
<argument name="sku" value="$$simpleProduct4.sku$$"/>
91+
</actionGroup>
92+
<actionGroup ref="addRelatedProductBySku" stepKey="addRelatedProduct5">
93+
<argument name="sku" value="$$simpleProduct5.sku$$"/>
94+
</actionGroup>
95+
<actionGroup ref="addRelatedProductBySku" stepKey="addRelatedProduct6">
96+
<argument name="sku" value="$$simpleProduct6.sku$$"/>
97+
</actionGroup>
98+
<scrollTo selector="{{AdminProductFormRelatedUpSellCrossSellSection.relatedDropdown}}" stepKey="scrollTo2"/>
99+
<conditionalClick selector="{{AdminProductFormRelatedUpSellCrossSellSection.relatedDropdown}}" dependentSelector="{{AdminProductFormRelatedUpSellCrossSellSection.relatedDependent}}" visible="false" stepKey="openDropDownIfClosedRelatedSee2"/>
100+
<see selector="{{AdminProductFormRelatedUpSellCrossSellSection.selectedRelatedProduct}}" userInput="$$simpleProduct6.sku$$" stepKey="seeSixthRelatedProduct"/>
101+
<selectOption selector=".admin__collapsible-block-wrapper[data-index='related'] .admin__control-select" userInput="5" stepKey="selectFivePerPage"/>
102+
<dontSee selector="{{AdminProductFormRelatedUpSellCrossSellSection.selectedRelatedProduct}}" userInput="$$simpleProduct6.sku$$" stepKey="dontSeeSixthRelatedProduct"/>
103+
72104
<!--See related product in storefront-->
73105
<amOnPage url="{{SimpleProduct3.sku}}.html" stepKey="goToStorefront"/>
74106
<waitForPageLoad stepKey="waitForStorefront"/>

0 commit comments

Comments
 (0)