|
| 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="StorefrontVerifyMultipleProductRatingsOnCategoryPageTest"> |
| 12 | + <annotations> |
| 13 | + <features value="Review"/> |
| 14 | + <stories value="Review By Customers"/> |
| 15 | + <title value="StoreFront inconsistent products rating on category page"/> |
| 16 | + <description value="Check if product rating is the same at list, table view on PLP and customers account."/> |
| 17 | + <severity value="AVERAGE"/> |
| 18 | + <useCaseId value="ACP2E-111"/> |
| 19 | + <testCaseId value="AC-1187"/> |
| 20 | + </annotations> |
| 21 | + <before> |
| 22 | + <!-- Enable singe store view to view ratings --> |
| 23 | + <magentoCLI command="config:set general/single_store_mode/enabled 1" stepKey="enabledSingleStoreMode"/> |
| 24 | + <!-- Login --> |
| 25 | + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> |
| 26 | + <!-- Create product and category --> |
| 27 | + <createData entity="SimpleSubCategory" stepKey="category"/> |
| 28 | + <createData entity="SimpleProduct" stepKey="createProduct1"> |
| 29 | + <requiredEntity createDataKey="category"/> |
| 30 | + </createData> |
| 31 | + <createData entity="SimpleProduct" stepKey="createProduct2"> |
| 32 | + <requiredEntity createDataKey="category"/> |
| 33 | + </createData> |
| 34 | + </before> |
| 35 | + <after> |
| 36 | + <!-- Delete reviews --> |
| 37 | + <actionGroup ref="AdminOpenReviewsPageActionGroup" stepKey="openAllReviewsPage"/> |
| 38 | + <actionGroup ref="AdminDeleteReviewsByUserNicknameActionGroup" stepKey="deleteCustomerReview"/> |
| 39 | + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearNickNameReviewFilters"/> |
| 40 | + <!-- Delete customer --> |
| 41 | + <actionGroup ref="AdminDeleteCustomerActionGroup" stepKey="deleteCustomer"> |
| 42 | + <argument name="customerEmail" value="CustomerEntityOne.email"/> |
| 43 | + </actionGroup> |
| 44 | + <!-- delete Category and Products --> |
| 45 | + <deleteData createDataKey="createProduct1" stepKey="deleteProduct1"/> |
| 46 | + <deleteData createDataKey="createProduct2" stepKey="deleteProduct2"/> |
| 47 | + <deleteData createDataKey="category" stepKey="deleteCategory"/> |
| 48 | + <!-- Logout --> |
| 49 | + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> |
| 50 | + <!-- Disable single store view back --> |
| 51 | + <magentoCLI command="config:set general/single_store_mode/enabled 0" stepKey="enabledSingleStoreMode"/> |
| 52 | + </after> |
| 53 | + |
| 54 | + <!-- Go to frontend and make a user account and login with it --> |
| 55 | + <actionGroup ref="SignUpNewUserFromStorefrontActionGroup" stepKey="signUpNewUser"> |
| 56 | + <argument name="Customer" value="CustomerEntityOne"/> |
| 57 | + </actionGroup> |
| 58 | + <!-- Go to the first product view page --> |
| 59 | + <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openStorefrontProductPage1"> |
| 60 | + <argument name="productUrl" value="$$createProduct1.custom_attributes[url_key]$$"/> |
| 61 | + </actionGroup> |
| 62 | + <!-- Click on reviews and add reviews with current user --> |
| 63 | + <click selector="{{StorefrontProductReviewsSection.reviewsTab}}" stepKey="openReviewTab1"/> |
| 64 | + <!-- Set product rating stars --> |
| 65 | + <actionGroup ref="StorefrontSetProductRatingStarsActionGroup" stepKey="setQualityStars1"> |
| 66 | + <argument name="ratingName" value="Quality"/> |
| 67 | + <argument name="stars" value="3"/> |
| 68 | + </actionGroup> |
| 69 | + <actionGroup ref="StorefrontSetProductRatingStarsActionGroup" stepKey="setValueStars1"> |
| 70 | + <argument name="ratingName" value="Value"/> |
| 71 | + <argument name="stars" value="4"/> |
| 72 | + </actionGroup> |
| 73 | + <actionGroup ref="StorefrontSetProductRatingStarsActionGroup" stepKey="setPriceStars1"> |
| 74 | + <argument name="ratingName" value="Price"/> |
| 75 | + <argument name="stars" value="5"/> |
| 76 | + </actionGroup> |
| 77 | + <!-- Click on reviews and add reviews with current user --> |
| 78 | + <actionGroup ref="StorefrontAddProductReviewActionGroup" stepKey="addReview1"/> |
| 79 | + <!-- Go to second product view page --> |
| 80 | + <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openStorefrontProductPage2"> |
| 81 | + <argument name="productUrl" value="$$createProduct2.custom_attributes[url_key]$$"/> |
| 82 | + </actionGroup> |
| 83 | + <!-- Click on reviews and add reviews with current user --> |
| 84 | + <click selector="{{StorefrontProductReviewsSection.reviewsTab}}" stepKey="openReviewTab2"/> |
| 85 | + <!-- Set product rating stars --> |
| 86 | + <actionGroup ref="StorefrontSetProductRatingStarsActionGroup" stepKey="setQualityStars2"> |
| 87 | + <argument name="ratingName" value="Quality"/> |
| 88 | + <argument name="stars" value="1"/> |
| 89 | + </actionGroup> |
| 90 | + <actionGroup ref="StorefrontSetProductRatingStarsActionGroup" stepKey="setValueStars2"> |
| 91 | + <argument name="ratingName" value="Value"/> |
| 92 | + <argument name="stars" value="1"/> |
| 93 | + </actionGroup> |
| 94 | + <actionGroup ref="StorefrontSetProductRatingStarsActionGroup" stepKey="setPriceStars2"> |
| 95 | + <argument name="ratingName" value="Price"/> |
| 96 | + <argument name="stars" value="1"/> |
| 97 | + </actionGroup> |
| 98 | + <!-- Add review --> |
| 99 | + <actionGroup ref="StorefrontAddProductReviewActionGroup" stepKey="addReview2"/> |
| 100 | + <!-- Approve all reviews --> |
| 101 | + <actionGroup ref="AdminOpenPendingReviewsPageActionGroup" stepKey="openPendingReviewsPage"/> |
| 102 | + <actionGroup ref="AdminApproveAllReviewsActionGroup" stepKey="approveAllCustomerReview"/> |
| 103 | + <!--Start Checking reviews --> |
| 104 | + <!-- Navigate to PLP and check product rating for list and table views --> |
| 105 | + <actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="amOnStoreViewHomePage"/> |
| 106 | + <!-- Open products in category section --> |
| 107 | + <actionGroup ref="StorefrontGoToCategoryPageActionGroup" stepKey="goToStorefrontCategoryPage"> |
| 108 | + <argument name="categoryName" value="$$category.name$$" /> |
| 109 | + </actionGroup> |
| 110 | + <!-- Grid mode is default --> |
| 111 | + <!-- Check stars at grid view for first product --> |
| 112 | + <grabAttributeFrom selector="#rating-result_$$createProduct1.id$$ span" userInput="style" stepKey="getFirstProductStarsAtGridView"/> |
| 113 | + <assertEquals stepKey="checkFirstProductStarsAtGridView"> |
| 114 | + <actualResult type="string">$getFirstProductStarsAtGridView</actualResult> |
| 115 | + <expectedResult type="string">width: 80%;</expectedResult> |
| 116 | + </assertEquals> |
| 117 | + <!-- Check stars at grid view for second product --> |
| 118 | + <grabAttributeFrom selector="#rating-result_$$createProduct2.id$$ span" userInput="style" stepKey="getSecondProductStarsAtGridView"/> |
| 119 | + <assertEquals stepKey="checkSecondProductStarsAtGridView"> |
| 120 | + <actualResult type="string">$getSecondProductStarsAtGridView</actualResult> |
| 121 | + <expectedResult type="string">width: 20%;</expectedResult> |
| 122 | + </assertEquals> |
| 123 | + <!-- Switch category view to list mode --> |
| 124 | + <actionGroup ref="StorefrontSwitchCategoryViewToListModeActionGroup" stepKey="switchCategoryViewToListMode"/> |
| 125 | + <!-- Check stars at list view for first product --> |
| 126 | + <grabAttributeFrom selector="#rating-result_$$createProduct1.id$$ span" userInput="style" stepKey="getFirstProductStarsAtListView"/> |
| 127 | + <assertEquals stepKey="checkFirstProductStarsAtListView"> |
| 128 | + <actualResult type="string">$getFirstProductStarsAtListView</actualResult> |
| 129 | + <expectedResult type="string">width: 80%;</expectedResult> |
| 130 | + </assertEquals> |
| 131 | + <!-- Check stars at list view for second product --> |
| 132 | + <grabAttributeFrom selector="#rating-result_$$createProduct2.id$$ span" userInput="style" stepKey="getSecondProductStarsAtListView"/> |
| 133 | + <assertEquals stepKey="checkSecondProductStarsAtListView"> |
| 134 | + <actualResult type="string">$getSecondProductStarsAtListView</actualResult> |
| 135 | + <expectedResult type="string">width: 20%;</expectedResult> |
| 136 | + </assertEquals> |
| 137 | + <!-- Navigate to user account and check product ratings --> |
| 138 | + <!-- Checking that all 3 reviews on the My Product Reviews page have one star ratings --> |
| 139 | + <actionGroup ref="StorefrontNavigateToMyProductReviewsPageActionGroup" stepKey="navigateToProductReviewsPage"/> |
| 140 | + <seeElement selector="{{StorefrontMyProductReviewsSection.reviewRating('2', '80%')}}" stepKey="seeFirstOneStarReviewOnMyReviews"/> |
| 141 | + <seeElement selector="{{StorefrontMyProductReviewsSection.reviewRating('1', '20%')}}" stepKey="seeSecondOneStarReviewOnMyReviews"/> |
| 142 | + <!-- Click on see details button of two reviews --> |
| 143 | + <!-- Navigate to user account and check product ratings --> |
| 144 | + <amOnPage url="review/customer/" stepKey="amOnCustomerReviewPage2"/> |
| 145 | + <!-- Click on second product review --> |
| 146 | + <click selector="{{StorefrontMyProductReviewsSection.reviewSeeDetails('1')}}" stepKey="clickFirstReviewRow"/> |
| 147 | + <grabAttributeFrom selector="#rating-result_$$createProduct2.id$$ span" userInput="style" stepKey="getSecondProductResultStarsUnderProductName1"/> |
| 148 | + <assertEquals stepKey="checkSecondProductResultStarsUnderProductName1"> |
| 149 | + <actualResult type="string">$getSecondProductResultStarsUnderProductName1</actualResult> |
| 150 | + <expectedResult type="string">width: 20%;</expectedResult> |
| 151 | + </assertEquals> |
| 152 | + <!-- Navigate to user account and check product ratings --> |
| 153 | + <amOnPage url="review/customer/" stepKey="amOnCustomerReviewPage3"/> |
| 154 | + <!-- Click on first product review --> |
| 155 | + <click selector="{{StorefrontMyProductReviewsSection.reviewSeeDetails('2')}}" stepKey="clickSecondReviewRow"/> |
| 156 | + <grabAttributeFrom selector="#rating-result_$$createProduct1.id$$ span" userInput="style" stepKey="getFirstProductResultStarsUnderProductName2"/> |
| 157 | + <assertEquals stepKey="checkFirstProductResultStarsUnderProductName2"> |
| 158 | + <actualResult type="string">$getFirstProductResultStarsUnderProductName2</actualResult> |
| 159 | + <expectedResult type="string">width: 80%;</expectedResult> |
| 160 | + </assertEquals> |
| 161 | + </test> |
| 162 | +</tests> |
0 commit comments