Skip to content

Commit

Permalink
ENGCOM-6938: Activated "Pending Reviews" menu item when merchant open…
Browse files Browse the repository at this point in the history
…s 'Pending Reviews' section #26230
  • Loading branch information
slavvka authored Feb 25, 2020
2 parents 4f5f26c + 4ed1fa0 commit 177e972
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public function execute()
}
/** @var \Magento\Backend\Model\View\Result\Page $resultPage */
$resultPage = $this->resultFactory->create(ResultFactory::TYPE_PAGE);
$resultPage->setActiveMenu('Magento_Review::catalog_reviews_ratings_pending');
$resultPage->getConfig()->getTitle()->prepend(__('Customer Reviews'));
$resultPage->getConfig()->getTitle()->prepend(__('Pending Reviews'));
$this->coreRegistry->register('usePendingFilter', true);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="AdminAssertClassElementRelativeIdActionGroup">
<arguments>
<argument name="elementId" type="string" defaultValue="{{AdminMenuSection.marketing}}"/>
<argument name="expectClass" type="string" defaultValue="{{AdminMenuUserContentPendingReviews.activeClass}}" />
</arguments>

<grabAttributeFrom selector="{{elementId}}" userInput="class" stepKey="grabClass"/>
<assertContains stepKey="assertClass">
<actualResult type="string">{$grabClass}</actualResult>
<expectedResult type="string">{{expectClass}}</expectedResult>
</assertContains>
</actionGroup>
</actionGroups>
6 changes: 6 additions & 0 deletions app/code/Magento/Review/Test/Mftf/Data/AdminMenuData.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@
<data key="title">Reviews</data>
<data key="dataUiId">magento-review-catalog-reviews-ratings-reviews-all</data>
</entity>
<entity name="AdminMenuUserContentPendingReviews">
<data key="pageTitle">Pending Reviews</data>
<data key="title">Pending Reviews</data>
<data key="dataUiId">magento-review-catalog-reviews-ratings-pending</data>
<data key="dataActiveClass">_active</data>
</entity>
<entity name="AdminMenuReportsReviewsByCustomers">
<data key="pageTitle">Customer Reviews Report</data>
<data key="title">By Customers</data>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
<test name="AdminMarketingPendingReviewsNavigateMenuActiveTest">
<annotations>
<features value="Pending Reviews"/>
<stories value="Menu Navigation"/>
<title value="Admin marketing pending reviews navigate menu"/>
<description value="Admin able see navigate head menu Marketing is active, when open page Marketing > Pending Reviews"/>
<group value="menu"/>
</annotations>
<before>
<actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/>
</before>
<after>
<actionGroup ref="logout" stepKey="logout"/>
</after>
<actionGroup ref="AdminNavigateMenuActionGroup" stepKey="navigateToReportsViewsPage">
<argument name="menuUiId" value="{{AdminMenuMarketing.dataUiId}}"/>
<argument name="submenuUiId" value="{{AdminMenuUserContentPendingReviews.dataUiId}}"/>
</actionGroup>
<actionGroup ref="AdminAssertPageTitleActionGroup" stepKey="seePageTitle">
<argument name="title" value="{{AdminMenuUserContentPendingReviews.pageTitle}}"/>
</actionGroup>
<actionGroup ref="AdminAssertClassElementRelativeIdActionGroup" stepKey="assertClass">
<argument name="elementId" value="{{AdminMenuSection.marketing}}"/>
<argument name="expectClass" value="{{AdminMenuUserContentPendingReviews.dataActiveClass}}"/>
</actionGroup>
</test>
</tests>

0 comments on commit 177e972

Please sign in to comment.