Skip to content

Commit c6edec8

Browse files
committed
Merge remote-tracking branch 'origin/MC-14824' into 2.3-qwerty-pr48
2 parents 2dc3722 + d4e064a commit c6edec8

File tree

104 files changed

+4263
-1029
lines changed

Some content is hidden

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

104 files changed

+4263
-1029
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
Welcome to Magento 2 installation! We're glad you chose to install Magento 2, a cutting-edge, feature-rich eCommerce solution that gets results.
77

88
## Magento System Requirements
9-
[Magento System Requirements](https://devdocs.magento.com/guides/v2.3/install-gde/system-requirements2.html).
9+
[Magento System Requirements](https://devdocs.magento.com/guides/v2.3/install-gde/system-requirements.html).
1010

1111
## Install Magento
1212

app/code/Magento/Backend/Controller/Adminhtml/Dashboard/ProductsViewed.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@
66
*/
77
namespace Magento\Backend\Controller\Adminhtml\Dashboard;
88

9-
use Magento\Framework\App\Action\HttpGetActionInterface;
9+
use Magento\Framework\App\Action\HttpPostActionInterface;
1010

1111
/**
1212
* Get most viewed products controller.
1313
*/
14-
class ProductsViewed extends AjaxBlock implements HttpGetActionInterface
14+
class ProductsViewed extends AjaxBlock implements HttpPostActionInterface
1515
{
1616
/**
1717
* Gets most viewed products list
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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="SetWebsiteCountryOptionsToDefaultActionGroup">
12+
<conditionalClick selector="{{CountryOptionsSection.countryOptions}}" dependentSelector="{{CountryOptionsSection.countryOptionsOpen}}" visible="false" stepKey="clickOnStoreInformation3"/>
13+
<waitForElementVisible selector="{{CountryOptionsSection.topDestinations}}" stepKey="waitCheckboxToBeVisible3"/>
14+
<checkOption selector="{{CountryOptionsSection.generalCountryAllowInherit}}" stepKey="setToDefault1"/>
15+
<checkOption selector="{{CountryOptionsSection.generalCountryDefaultInherit}}" stepKey="setToDefault2"/>
16+
<click selector="{{ContentManagementSection.Save}}" stepKey="saveDefaultConfig"/>
17+
<waitForPageLoad stepKey="waitForSavingSystemConfiguration"/>
18+
<see userInput="You saved the configuration." stepKey="seeSuccessMessage"/>
19+
</actionGroup>
20+
</actionGroups>
Lines changed: 18 additions & 0 deletions
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+
9+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
11+
<section name="CountryOptionsSection">
12+
<element name="allowedCountries" type="select" selector="#general_country_allow"/>
13+
<element name="notAllowedCountry" type="button" selector="#general_country_allow option:not([selected])"/>
14+
<element name="generalCountryAllowInherit" type="checkbox" selector="#general_country_allow_inherit"/>
15+
<element name="generalCountryDefaultInherit" type="checkbox" selector="#general_country_default_inherit"/>
16+
<element name="generalCountryDefault" type="select" selector="#general_country_default"/>
17+
</section>
18+
</sections>
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
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\Model\Product;
9+
10+
use Magento\Catalog\Api\ProductRepositoryInterface;
11+
use Magento\Store\Model\StoreManagerInterface;
12+
13+
/**
14+
* Class to check that product is saleable.
15+
*/
16+
class SalabilityChecker
17+
{
18+
/**
19+
* @var ProductRepositoryInterface
20+
*/
21+
private $productRepository;
22+
23+
/**
24+
* @var StoreManagerInterface
25+
*/
26+
private $storeManager;
27+
28+
/**
29+
* @param ProductRepositoryInterface $productRepository
30+
* @param StoreManagerInterface $storeManager
31+
*/
32+
public function __construct(
33+
ProductRepositoryInterface $productRepository,
34+
StoreManagerInterface $storeManager
35+
) {
36+
$this->productRepository = $productRepository;
37+
$this->storeManager = $storeManager;
38+
}
39+
40+
/**
41+
* Check if product is salable.
42+
*
43+
* @param int|string $productId
44+
* @param int|null $storeId
45+
* @return bool
46+
*/
47+
public function isSalable($productId, $storeId = null): bool
48+
{
49+
if ($storeId === null) {
50+
$storeId = $this->storeManager->getStore()->getId();
51+
}
52+
/** @var \Magento\Catalog\Model\Product $product */
53+
$product = $this->productRepository->getById($productId, false, $storeId);
54+
55+
return $product->isSalable();
56+
}
57+
}

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717
*
1818
* @SuppressWarnings(PHPMD.CookieAndSessionMisuse)
1919
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
20+
*
21+
* @deprecated
22+
* @see \Magento\Catalog\Model\Product\Type\Price
2023
*/
2124
class FrontSpecialPrice extends Price
2225
{
@@ -66,6 +69,8 @@ public function __construct(
6669

6770
/**
6871
* @inheritdoc
72+
*
73+
* @deprecated
6974
*/
7075
protected function _applySpecialPrice($product, $finalPrice)
7176
{

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,4 +289,13 @@
289289
<waitForPageLoad stepKey="waitForProductToLoad"/>
290290
<waitForElementVisible selector="{{AdminHeaderSection.pageTitle}}" stepKey="waitForProductTitle"/>
291291
</actionGroup>
292+
293+
<actionGroup name="deleteProductsIfTheyExist">
294+
<conditionalClick selector="{{AdminProductGridSection.multicheckDropdown}}" dependentSelector="{{AdminProductGridSection.firstProductRow}}" visible="true" stepKey="openMulticheckDropdown"/>
295+
<conditionalClick selector="{{AdminProductGridSection.multicheckOption('Select All')}}" dependentSelector="{{AdminProductGridSection.firstProductRow}}" visible="true" stepKey="selectAllProductInFilteredGrid"/>
296+
<click selector="{{AdminProductGridSection.bulkActionDropdown}}" stepKey="clickActionDropdown"/>
297+
<click selector="{{AdminProductGridSection.bulkActionOption('Delete')}}" stepKey="clickDeleteAction"/>
298+
<waitForElementVisible selector="{{AdminProductGridConfirmActionSection.ok}}" stepKey="waitForModalPopUp"/>
299+
<click selector="{{AdminProductGridConfirmActionSection.ok}}" stepKey="confirmProductDelete"/>
300+
</actionGroup>
292301
</actionGroups>

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,7 @@
1212
<data key="from">10</data>
1313
<data key="to">100</data>
1414
</entity>
15+
<entity name="ProductPerPage">
16+
<data key="productCount">1</data>
17+
</entity>
1518
</entities>
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
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="AdminGridPageNumberAfterSaveAndCloseActionTest">
12+
<annotations>
13+
<features value="Catalog"/>
14+
<title value="Checking Catalog grid page number after Save and Close action"/>
15+
<description value="Checking Catalog grid page number after Save and Close action"/>
16+
<severity value="MAJOR"/>
17+
<testCaseId value="MAGETWO-96164"/>
18+
<useCaseId value="MAGETWO-96127"/>
19+
<group value="Catalog"/>
20+
</annotations>
21+
<before>
22+
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
23+
<!--Clear product grid-->
24+
<comment userInput="Clear product grid" stepKey="commentClearProductGrid"/>
25+
<amOnPage url="{{ProductCatalogPage.url}}" stepKey="goToProductCatalog"/>
26+
<waitForPageLoad stepKey="waitForProductIndexPage"/>
27+
<conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}"
28+
dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters"/>
29+
<waitForLoadingMaskToDisappear stepKey="waitForGridLoad"/>
30+
<actionGroup ref="deleteProductsIfTheyExist" stepKey="deleteProductIfTheyExist"/>
31+
<createData stepKey="category1" entity="SimpleSubCategory"/>
32+
<createData stepKey="product1" entity="SimpleProduct">
33+
<requiredEntity createDataKey="category1"/>
34+
</createData>
35+
<createData stepKey="category2" entity="SimpleSubCategory"/>
36+
<createData stepKey="product2" entity="SimpleProduct">
37+
<requiredEntity createDataKey="category2"/>
38+
</createData>
39+
</before>
40+
<after>
41+
<amOnPage url="{{ProductCatalogPage.url}}" stepKey="goToProductCatalog"/>
42+
<waitForPageLoad stepKey="waitForProductIndexPage"/>
43+
<click selector="{{AdminDataGridPaginationSection.previousPage}}" stepKey="clickPrevPageOrderGrid"/>
44+
<actionGroup ref="adminDataGridDeleteCustomPerPage" stepKey="deleteCustomAddedPerPage">
45+
<argument name="perPage" value="ProductPerPage.productCount"/>
46+
</actionGroup>
47+
<deleteData stepKey="deleteCategory1" createDataKey="category1"/>
48+
<deleteData stepKey="deleteProduct1" createDataKey="product1"/>
49+
<deleteData stepKey="deleteCategory2" createDataKey="category2"/>
50+
<deleteData stepKey="deleteProduct2" createDataKey="product2"/>
51+
<actionGroup ref="logout" stepKey="logout"/>
52+
</after>
53+
<amOnPage url="{{ProductCatalogPage.url}}" stepKey="goToProductCatalog"/>
54+
<waitForPageLoad stepKey="waitForProductIndexPage"/>
55+
<actionGroup ref="adminDataGridSelectCustomPerPage" stepKey="select1OrderPerPage">
56+
<argument name="perPage" value="ProductPerPage.productCount"/>
57+
</actionGroup>
58+
<!--Go to the next page and edit the product-->
59+
<comment userInput="Go to the next page and edit the product" stepKey="commentEdiProduct"/>
60+
<click selector="{{AdminDataGridPaginationSection.nextPage}}" stepKey="clickNextPageOrderGrid"/>
61+
<waitForPageLoad stepKey="waitForPageLoad"/>
62+
<actionGroup ref="OpenEditProductOnBackendActionGroup" stepKey="openEditProduct2">
63+
<argument name="product" value="$$product2$$"/>
64+
</actionGroup>
65+
<actionGroup ref="AdminFormSaveAndClose" stepKey="saveAndCloseProduct"/>
66+
<waitForPageLoad stepKey="waitForPageLoad1"/>
67+
<seeInField selector="{{AdminDataGridPaginationSection.currentPage}}" userInput="2" stepKey="seeOnSecondPageOrderGrid"/>
68+
</test>
69+
</tests>

app/code/Magento/Catalog/etc/frontend/di.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,5 +120,4 @@
120120
<plugin name="catalog_app_action_dispatch_controller_context_plugin"
121121
type="Magento\Catalog\Plugin\Framework\App\Action\ContextPlugin" />
122122
</type>
123-
<preference for="Magento\Catalog\Model\Product\Type\Price" type="Magento\Catalog\Model\Product\Type\FrontSpecialPrice" />
124123
</config>

0 commit comments

Comments
 (0)