Skip to content

Commit de0dc91

Browse files
merge magento/2.3-develop into magento-epam/EPAM-PR-76
2 parents 5cadd8f + c6cf182 commit de0dc91

File tree

5 files changed

+72
-14
lines changed

5 files changed

+72
-14
lines changed

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

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,31 +6,41 @@
66
*/
77
namespace Magento\Catalog\Controller\Adminhtml\Category;
88

9-
use Magento\Framework\App\Action\HttpGetActionInterface as HttpGetActionInterface;
9+
use Magento\Backend\App\Action\Context;
10+
use Magento\Backend\Model\View\Result\Page;
11+
use Magento\Framework\Controller\ResultFactory;
12+
use Magento\Backend\Model\View\Result\Redirect;
13+
use Magento\Framework\Controller\ResultInterface;
14+
use Magento\Catalog\Controller\Adminhtml\Category;
15+
use Magento\Backend\Model\View\Result\ForwardFactory;
16+
use Magento\Framework\App\Action\HttpGetActionInterface;
1017

1118
/**
1219
* Class Add Category
1320
*
1421
* @package Magento\Catalog\Controller\Adminhtml\Category
1522
*/
16-
class Add extends \Magento\Catalog\Controller\Adminhtml\Category implements HttpGetActionInterface
23+
class Add extends Category implements HttpGetActionInterface
1724
{
1825
/**
1926
* Forward factory for result
2027
*
21-
* @var \Magento\Backend\Model\View\Result\ForwardFactory
28+
* @deprecated Unused Class: ForwardFactory
29+
* @see $this->resultFactory->create()
30+
* @var ForwardFactory
31+
*
2232
*/
2333
protected $resultForwardFactory;
2434

2535
/**
2636
* Add category constructor
2737
*
28-
* @param \Magento\Backend\App\Action\Context $context
29-
* @param \Magento\Backend\Model\View\Result\ForwardFactory $resultForwardFactory
38+
* @param Context $context
39+
* @param ForwardFactory $resultForwardFactory
3040
*/
3141
public function __construct(
32-
\Magento\Backend\App\Action\Context $context,
33-
\Magento\Backend\Model\View\Result\ForwardFactory $resultForwardFactory
42+
Context $context,
43+
ForwardFactory $resultForwardFactory
3444
) {
3545
parent::__construct($context);
3646
$this->resultForwardFactory = $resultForwardFactory;
@@ -39,15 +49,15 @@ public function __construct(
3949
/**
4050
* Add new category form
4151
*
42-
* @return \Magento\Backend\Model\View\Result\Forward
52+
* @return ResultInterface
4353
*/
4454
public function execute()
4555
{
4656
$parentId = (int)$this->getRequest()->getParam('parent');
4757

4858
$category = $this->_initCategory(true);
4959
if (!$category || !$parentId || $category->getId()) {
50-
/** @var \Magento\Backend\Model\View\Result\Redirect $resultRedirect */
60+
/** @var Redirect $resultRedirect */
5161
$resultRedirect = $this->resultRedirectFactory->create();
5262
return $resultRedirect->setPath('catalog/*/', ['_current' => true, 'id' => null]);
5363
}
@@ -61,9 +71,8 @@ public function execute()
6171
$category->addData($categoryData);
6272
}
6373

64-
$resultPageFactory = $this->_objectManager->get(\Magento\Framework\View\Result\PageFactory::class);
65-
/** @var \Magento\Backend\Model\View\Result\Page $resultPage */
66-
$resultPage = $resultPageFactory->create();
74+
/** @var Page $resultPage */
75+
$resultPage = $this->resultFactory->create(ResultFactory::TYPE_PAGE);
6776

6877
if ($this->getRequest()->getQuery('isAjax')) {
6978
return $this->ajaxRequestResponse($category, $resultPage);
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="StorefrontAssertProductAbsentOnCategoryPageActionGroup">
12+
<annotations>
13+
<description>Navigate to category page and verify product is absent.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="category" defaultValue="_defaultCategory"/>
17+
<argument name="product" defaultValue="SimpleProduct"/>
18+
</arguments>
19+
<amOnPage url="{{StorefrontCategoryPage.url(category.name)}}" stepKey="navigateToCategoryPage"/>
20+
<waitForPageLoad stepKey="waitForCategoryPageLoad"/>
21+
<dontSee selector="{{StorefrontCategoryMainSection.productName}}" userInput="{{product.name}}" stepKey="assertProductIsNotPresent"/>
22+
<dontSee selector="{{StorefrontCategoryMainSection.productPrice}}" userInput="{{product.price}}" stepKey="assertProductIsNotPricePresent"/>
23+
</actionGroup>
24+
</actionGroups>
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="StorefrontCustomerReorderActionGroup">
12+
<annotations>
13+
<description>Navigate to customer dashboard -> orders. Press 'reorder' button for specified order id. Notice: customer should be logged in.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="orderNumber" type="string"/>
17+
</arguments>
18+
<amOnPage url="{{StorefrontCustomerDashboardPage.url}}" stepKey="goToCustomerDashboardPage"/>
19+
<waitForPageLoad stepKey="waitForCustomerDashboardPageLoad"/>
20+
<click selector="{{StorefrontCustomerSidebarSection.sidebarTab('My Orders')}}" stepKey="navigateToOrders"/>
21+
<waitForPageLoad stepKey="waitForOrdersPageLoad"/>
22+
<click selector="{{StorefrontCustomerOrdersGridSection.reorderBtn(orderNumber)}}" stepKey="clickReorderBtn"/>
23+
</actionGroup>
24+
</actionGroups>

app/code/Magento/Sales/Test/Mftf/Section/AdminOrderFormTotalSection.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@
1111
<section name="AdminOrderFormTotalSection">
1212
<element name="subtotalRow" type="text" selector="#order-totals>table tr.row-totals:nth-of-type({{row}}) span.price" parameterized="true"/>
1313
<element name="total" type="text" selector="//tr[contains(@class,'row-totals')]/td[contains(text(), '{{total}}')]/following-sibling::td/span[contains(@class, 'price')]" parameterized="true"/>
14-
<element name="grandTotal" type="text" selector="#order-totals>table tr.row-totals:nth-of-type(3) span.price"/>
14+
<element name="grandTotal" type="text" selector="//tr[contains(@class,'row-totals')]/td/strong[contains(text(), 'Grand Total')]/parent::td/following-sibling::td//span[contains(@class, 'price')]"/>
1515
</section>
16-
</sections>
16+
</sections>

app/code/Magento/Sales/Test/Mftf/Section/StorefrontCustomerOrdersGridSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,6 @@
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
1111
<section name="StorefrontCustomerOrdersGridSection">
1212
<element name="orderView" type="button" selector="//td[text()='{{orderNumber}}']/following-sibling::td[@class='col actions']/a[contains(@class, 'view')]" parameterized="true" />
13+
<element name="reorderBtn" type="button" selector="//td[text()='{{orderNumber}}']/following-sibling::td[@class='col actions']/a[contains(@class, 'order')]" parameterized="true" />
1314
</section>
1415
</sections>

0 commit comments

Comments
 (0)