|
8 | 8 |
|
9 | 9 | <tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
10 | 10 | xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
|
11 |
| - <test name="StoreFrontReviewRatingByCustomerTest"> |
| 11 | + <test name="StorefrontVerifyMultipleInconsistentProductRatingsOnCategoryPageTest"> |
12 | 12 | <annotations>
|
13 | 13 | <features value="Review"/>
|
14 | 14 | <stories value="Review By Customers"/>
|
|
24 | 24 | <!--Login-->
|
25 | 25 | <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/>
|
26 | 26 | <!--Create product and Category-->
|
27 |
| - <createData stepKey="category" entity="SimpleSubCategory"/> |
| 27 | + <createData entity="SimpleSubCategory" stepKey="category"/> |
28 | 28 | <createData stepKey="createProduct1" entity="SimpleProduct">
|
29 | 29 | <requiredEntity createDataKey="category"/>
|
30 | 30 | </createData>
|
|
50 | 50 | <!-- Disable single store view back-->
|
51 | 51 | <magentoCLI command="config:set general/single_store_mode/enabled 0" stepKey="enabledSingleStoreMode"/>
|
52 | 52 | </after>
|
| 53 | + |
53 | 54 | <!-- Go to frontend and make a user account and login with it -->
|
54 | 55 | <actionGroup ref="SignUpNewUserFromStorefrontActionGroup" stepKey="signUpNewUser">
|
55 | 56 | <argument name="Customer" value="CustomerEntityOne"/>
|
56 | 57 | </actionGroup>
|
57 |
| - <!-- Go to the product view page --> |
58 |
| - <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openStorefrontProductPage"> |
| 58 | + <!-- Go to the first product view page --> |
| 59 | + <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openStorefrontProductPage1"> |
59 | 60 | <argument name="productUrl" value="$$createProduct1.custom_attributes[url_key]$$"/>
|
60 | 61 | </actionGroup>
|
61 | 62 | <!-- Click on reviews and add reviews with current user -->
|
62 |
| - <click selector="{{StorefrontProductReviewsSection.reviewsTab}}" stepKey="openReviewTab"/> |
| 63 | + <click selector="{{StorefrontProductReviewsSection.reviewsTab}}" stepKey="openReviewTab1"/> |
63 | 64 | <!-- set product rating stars -->
|
64 |
| - <actionGroup ref="StorefrontSetProductRatingStarsActionGroup" stepKey="setQualityStars"> |
| 65 | + <actionGroup ref="StorefrontSetProductRatingStarsActionGroup" stepKey="setQualityStars1"> |
65 | 66 | <argument name="ratingName" value="Quality"/>
|
66 | 67 | <argument name="stars" value="3"/>
|
67 | 68 | </actionGroup>
|
68 |
| - <actionGroup ref="StorefrontSetProductRatingStarsActionGroup" stepKey="setValueStars"> |
| 69 | + <actionGroup ref="StorefrontSetProductRatingStarsActionGroup" stepKey="setValueStars1"> |
69 | 70 | <argument name="ratingName" value="Value"/>
|
70 | 71 | <argument name="stars" value="4"/>
|
71 | 72 | </actionGroup>
|
72 |
| - <actionGroup ref="StorefrontSetProductRatingStarsActionGroup" stepKey="setPriceStars"> |
| 73 | + <actionGroup ref="StorefrontSetProductRatingStarsActionGroup" stepKey="setPriceStars1"> |
73 | 74 | <argument name="ratingName" value="Price"/>
|
74 | 75 | <argument name="stars" value="5"/>
|
75 | 76 | </actionGroup>
|
76 | 77 | <!-- Click on reviews and add reviews with current user -->
|
77 |
| - <actionGroup ref="StorefrontAddProductReviewActionGroup" stepKey="addReview"/> |
78 |
| - <!-- Go to Pending reviews page and clear filters --> |
79 |
| - <actionGroup ref="AdminOpenPendingReviewsPageActionGroup" stepKey="openReviewsPage"/> |
80 |
| - <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearFilters"/> |
81 |
| - <!-- Moderate first product reviews: change review status from pending to approved, save --> |
82 |
| - <actionGroup ref="AdminOpenReviewByUserNicknameActionGroup" stepKey="openFirstCustomerReviews"/> |
83 |
| - <actionGroup ref="AdminChangeReviewStatusActionGroup" stepKey="changeFirstReviewStatus"/> |
84 |
| - <actionGroup ref="AdminSaveReviewActionGroup" stepKey="saveModeratedFirstReview"/> |
| 78 | + <actionGroup ref="StorefrontAddProductReviewActionGroup" stepKey="addReview1"/> |
| 79 | + |
| 80 | + <!-- Go to second product view page --> |
| 81 | + <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openStorefrontProductPage2"> |
| 82 | + <argument name="productUrl" value="$$createProduct2.custom_attributes[url_key]$$"/> |
| 83 | + </actionGroup> |
| 84 | + <!-- Click on reviews and add reviews with current user --> |
| 85 | + <click selector="{{StorefrontProductReviewsSection.reviewsTab}}" stepKey="openReviewTab2"/> |
| 86 | + <!-- Set product rating stars --> |
| 87 | + <actionGroup ref="StorefrontSetProductRatingStarsActionGroup" stepKey="setQualityStars2"> |
| 88 | + <argument name="ratingName" value="Quality"/> |
| 89 | + <argument name="stars" value="1"/> |
| 90 | + </actionGroup> |
| 91 | + <actionGroup ref="StorefrontSetProductRatingStarsActionGroup" stepKey="setValueStars2"> |
| 92 | + <argument name="ratingName" value="Value"/> |
| 93 | + <argument name="stars" value="1"/> |
| 94 | + </actionGroup> |
| 95 | + <actionGroup ref="StorefrontSetProductRatingStarsActionGroup" stepKey="setPriceStars2"> |
| 96 | + <argument name="ratingName" value="Price"/> |
| 97 | + <argument name="stars" value="1"/> |
| 98 | + </actionGroup> |
| 99 | + <!-- Add review --> |
| 100 | + <actionGroup ref="StorefrontAddProductReviewActionGroup" stepKey="addReview2"/> |
| 101 | + |
| 102 | + <!-- Approve all reviews --> |
| 103 | + <actionGroup ref="AdminOpenPendingReviewsPageActionGroup" stepKey="openPendingReviewsPage"/> |
| 104 | + <actionGroup ref="AdminApproveAllReviewsActionGroup" stepKey="approveAllCustomerReview"/> |
| 105 | + |
| 106 | + <!--Start Checking reviews --> |
85 | 107 | <!-- Navigate to PLP and check product rating for list and table views -->
|
86 | 108 | <actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="amOnStoreViewHomePage"/>
|
87 |
| - <actionGroup ref="StoreFrontQuickSearchActionGroup" stepKey="searchBySku"> |
88 |
| - <argument name="query" value="$$createProduct1.sku$$"/> |
| 109 | + <!-- Open Products in Category section --> |
| 110 | + <actionGroup ref="StorefrontGoToCategoryPageActionGroup" stepKey="goToStorefrontCategoryPage"> |
| 111 | + <argument name="categoryName" value="$$category.name$$" /> |
89 | 112 | </actionGroup>
|
90 |
| - <!-- Check stars at list view --> |
91 |
| - <click selector="{{StorefrontCategoryTopToolbarSection.listMode}}" stepKey="switchCategoryViewToListMode"/> |
92 |
| - <grabAttributeFrom selector="#rating-result_$$createProduct1.id$$ span" userInput="style" stepKey="getProductStarsAtListView"/> |
93 |
| - <assertEquals stepKey="checkProductStarsAtListView"> |
94 |
| - <actualResult type="string">$getProductStarsAtListView</actualResult> |
| 113 | + |
| 114 | + <!-- Grid Mode is default --> |
| 115 | + <!-- Check stars at grid view for first product --> |
| 116 | + <grabAttributeFrom selector="#rating-result_$$createProduct1.id$$ span" userInput="style" stepKey="getFirstProductStarsAtGridView"/> |
| 117 | + <assertEquals stepKey="checkFirstProductStarsAtGridView"> |
| 118 | + <actualResult type="string">$getFirstProductStarsAtGridView</actualResult> |
95 | 119 | <expectedResult type="string">width: 80%;</expectedResult>
|
96 | 120 | </assertEquals>
|
97 |
| - <!-- Check stars at grid view --> |
98 |
| - <click selector="{{StorefrontCategoryTopToolbarSection.gridMode}}" stepKey="switchCategoryViewToGridMode"/> |
99 |
| - <grabAttributeFrom selector="#rating-result_$$createProduct1.id$$ span" userInput="style" stepKey="getProductStarsAtGridView"/> |
100 |
| - <assertEquals stepKey="checkProductStarsAtGridView"> |
101 |
| - <actualResult type="string">$getProductStarsAtGridView</actualResult> |
102 |
| - <expectedResult type="string">width: 80%;</expectedResult> |
| 121 | + <!-- Check stars at grid view for Second product --> |
| 122 | + <grabAttributeFrom selector="#rating-result_$$createProduct2.id$$ span" userInput="style" stepKey="getSecondProductStarsAtGridView"/> |
| 123 | + <assertEquals stepKey="checkSecondProductStarsAtGridView"> |
| 124 | + <actualResult type="string">$getSecondProductStarsAtGridView</actualResult> |
| 125 | + <expectedResult type="string">width: 20%;</expectedResult> |
103 | 126 | </assertEquals>
|
104 |
| - <!-- Navigate to user account and check product ratings--> |
105 |
| - <amOnPage url="review/customer/" stepKey="amOnCustomerReviewPage"/> |
106 |
| - <click selector=".action.more" stepKey="amOnProductReviewDetailsPage"/> |
107 |
| - <!-- Check stars at rating result under the product name --> |
108 |
| - <grabAttributeFrom selector="#rating-result_$$createProduct1.id$$ span" userInput="style" stepKey="getProductResultStarsUnderProductName"/> |
109 |
| - <assertEquals stepKey="checkProductResultStarsUnderProductName"> |
110 |
| - <actualResult type="string">$getProductResultStarsUnderProductName</actualResult> |
| 127 | + |
| 128 | + <!-- Switch category view to List mode --> |
| 129 | + <actionGroup ref="StorefrontSwitchCategoryViewToListModeActionGroup" stepKey="switchCategoryViewToListMode"/> |
| 130 | + <!-- Check stars at list view for first product--> |
| 131 | + <grabAttributeFrom selector="#rating-result_$$createProduct1.id$$ span" userInput="style" stepKey="getFirstProductStarsAtListView"/> |
| 132 | + <assertEquals stepKey="checkFirstProductStarsAtListView"> |
| 133 | + <actualResult type="string">$getFirstProductStarsAtListView</actualResult> |
111 | 134 | <expectedResult type="string">width: 80%;</expectedResult>
|
112 | 135 | </assertEquals>
|
113 |
| - <!-- Check that the rating are accurate--> |
114 |
| - <grabAttributeFrom selector=".rating-result.Quality span" userInput="style" stepKey="getProductQualityStarsAtUserAccount"/> |
115 |
| - <assertEquals stepKey="checkProductQualityStarsAtUserAccount"> |
116 |
| - <actualResult type="string">$getProductQualityStarsAtUserAccount</actualResult> |
117 |
| - <expectedResult type="string">width: 60%;</expectedResult> |
| 136 | + <grabAttributeFrom selector="#rating-result_$$createProduct2.id$$ span" userInput="style" stepKey="getSecondProductStarsAtListView"/> |
| 137 | + <assertEquals stepKey="checkSecondProductStarsAtListView"> |
| 138 | + <actualResult type="string">$getSecondProductStarsAtListView</actualResult> |
| 139 | + <expectedResult type="string">width: 20%;</expectedResult> |
118 | 140 | </assertEquals>
|
119 |
| - <grabAttributeFrom selector=".rating-result.Value span" userInput="style" stepKey="getProductValueStarsAtUserAccount"/> |
120 |
| - <assertEquals stepKey="checkProductValueStarsAtUserAccount"> |
121 |
| - <actualResult type="string">$getProductValueStarsAtUserAccount</actualResult> |
| 141 | + |
| 142 | + <!-- Navigate to user account and check product ratings--> |
| 143 | + <amOnPage url="review/customer/" stepKey="amOnCustomerReviewPage"/> |
| 144 | + <grabAttributeFrom selector="#rating-result_$$createProduct1.id$$ span" userInput="style" stepKey="getFirstProductResultStarsUnderProductName"/> |
| 145 | + <assertEquals stepKey="checkFirstProductResultStarsUnderProductName"> |
| 146 | + <actualResult type="string">$getFirstProductResultStarsUnderProductName</actualResult> |
122 | 147 | <expectedResult type="string">width: 80%;</expectedResult>
|
123 | 148 | </assertEquals>
|
124 |
| - <grabAttributeFrom selector=".rating-result.Price span" userInput="style" stepKey="getProductPriceStarsAtUserAccount"/> |
125 |
| - <assertEquals stepKey="checkProductPriceStarsAtUserAccount"> |
126 |
| - <actualResult type="string">$getProductPriceStarsAtUserAccount</actualResult> |
127 |
| - <expectedResult type="string">width: 100%;</expectedResult> |
| 149 | + |
| 150 | + <click selector=".action.more" stepKey="amOnProductReviewDetailsPage"/> |
| 151 | + <!-- Check stars at rating result under the product name --> |
| 152 | + <grabAttributeFrom selector="#rating-result_$$createProduct2.id$$ span" userInput="style" stepKey="getSecondProductResultStarsUnderProductName"/> |
| 153 | + <assertEquals stepKey="checkSecondProductResultStarsUnderProductName"> |
| 154 | + <actualResult type="string">$getSecondProductResultStarsUnderProductName</actualResult> |
| 155 | + <expectedResult type="string">width: 20%;</expectedResult> |
128 | 156 | </assertEquals>
|
129 | 157 | </test>
|
130 | 158 | </tests>
|
0 commit comments