Skip to content

Commit f8adc5a

Browse files
committed
ACP2E-89: Reviews are not visible on product page
1 parent 22fdbb1 commit f8adc5a

File tree

2 files changed

+18
-10
lines changed

2 files changed

+18
-10
lines changed

app/code/Magento/Review/Test/Mftf/Test/StoreFrontCheckReviewsByCustomerLoadedOnProductPageTest.xml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,13 +89,25 @@
8989
</actionGroup>
9090
<waitForPageLoad stepKey="waitForPageToLoad"/>
9191
<!--check if the div#customer-reviews element -->
92-
<!-- <scrollTo selector="div#customer-reviews" stepKey="scrollToElement"/>-->
93-
<!-- <dontSeeElement selector="div#product-review-container > div#customer-reviews" stepKey="customerReviewDivIsNotLoaded"/>-->
92+
<dontSeeElementInDOM selector="div#product-review-container > div#customer-review" stepKey="customerReviewDivIsNotLoaded"/>
9493
<!-- Click on reviews and add reviews with current user -->
9594
<click selector="{{StorefrontProductReviewsSection.reviewsTab}}" stepKey="openReviewTab2"/>
9695
<!-- Verify products reviews div#product-review-container > div#customer-reviews is loaded after click-->
9796
<actionGroup ref="AssertStorefrontSeeElementActionGroup" stepKey="seeCustomerReviewsDivIsLoaded">
9897
<argument name="selector" value="div#product-review-container > div#customer-reviews"/>
9998
</actionGroup>
99+
100+
<!-- Navigate to PLP and check product rating for list and table views -->
101+
<actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="amOnStoreViewHomePage2"/>
102+
<actionGroup ref="StoreFrontQuickSearchActionGroup" stepKey="searchBySku2">
103+
<argument name="query" value="$$createProduct1.sku$$"/>
104+
</actionGroup>
105+
<!-- Click on the review button for product -->
106+
<click selector=".action.view" stepKey="clickOnProductReviewsLink"/>
107+
<waitForPageLoad stepKey="waitForPageToLoad2"/>
108+
<!-- Verify products reviews div#product-review-container > div#customer-reviews is loaded if reviews are open directly-->
109+
<actionGroup ref="AssertStorefrontSeeElementActionGroup" stepKey="seeCustomerReviewsDivIsLoaded2">
110+
<argument name="selector" value="div#product-review-container > div#customer-reviews"/>
111+
</actionGroup>
100112
</test>
101113
</tests>

app/code/Magento/Review/view/frontend/templates/helper/summary.phtml

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,7 @@ $urlForm = $block->getReviewsUrl() . '#review-form';
1919
<?php if ($rating):?>
2020
<div class="rating-summary">
2121
<span class="label"><span><?= $block->escapeHtml(__('Rating')) ?>:</span></span>
22-
<div class="rating-result"
23-
id="rating-result_<?= /* @noEscape */ $block->getProduct()->getId() ?>"
24-
title="<?= $block->escapeHtmlAttr($rating) ?>%"
25-
>
22+
<div class="rating-result" title="<?= $block->escapeHtmlAttr($rating); ?>%">
2623
<span>
2724
<span>
2825
<span itemprop="ratingValue"><?= $block->escapeHtml($rating); ?>
@@ -31,10 +28,9 @@ $urlForm = $block->getReviewsUrl() . '#review-form';
3128
</span>
3229
</div>
3330
</div>
34-
<?= /* @noEscape */
35-
$secureRenderer->renderStyleAsTag(
36-
'width:' . $block->escapeHtmlAttr($rating) . '%',
37-
'#rating-result_' . $block->getProduct()->getId() . ' span'
31+
<?= /* @noEscape */ $secureRenderer->renderStyleAsTag(
32+
"width:" . $block->escapeHtmlAttr($rating) . "%",
33+
'div.rating-summary div.rating-result>span:first-child'
3834
) ?>
3935
<?php endif;?>
4036
<div class="reviews-actions">

0 commit comments

Comments
 (0)