|
| 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="StoreFrontCheckReviewsByCustomerLoadedOnProductPageTest"> |
| 12 | + <annotations> |
| 13 | + <features value="Review"/> |
| 14 | + <stories value="Review By Customers"/> |
| 15 | + <title value="StoreFront Review Rating By Customers"/> |
| 16 | + <description value="Check if product reviews is loaded on Product Page with page load and on click of Review tab"/> |
| 17 | + <severity value="AVERAGE"/> |
| 18 | + <useCaseId value="ACP2E-89"/> |
| 19 | + <testCaseId value="AC-1180"/> |
| 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 stepKey="category" entity="SimpleSubCategory"/> |
| 28 | + <createData stepKey="createProduct1" entity="SimpleProduct"> |
| 29 | + <requiredEntity createDataKey="category"/> |
| 30 | + </createData> |
| 31 | + </before> |
| 32 | + <after> |
| 33 | + <!-- Delete reviews --> |
| 34 | + <actionGroup ref="AdminOpenReviewsPageActionGroup" stepKey="openAllReviewsPage"/> |
| 35 | + <actionGroup ref="AdminDeleteReviewsByUserNicknameActionGroup" stepKey="deleteCustomerReview"/> |
| 36 | + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearNickNameReviewFilters"/> |
| 37 | + <!-- Delete customer --> |
| 38 | + <actionGroup ref="AdminDeleteCustomerActionGroup" stepKey="deleteCustomer"> |
| 39 | + <argument name="customerEmail" value="CustomerEntityOne.email"/> |
| 40 | + </actionGroup> |
| 41 | + <!--delete Category and Products --> |
| 42 | + <deleteData createDataKey="createProduct1" stepKey="deleteProduct1"/> |
| 43 | + <deleteData createDataKey="category" stepKey="deleteCategory"/> |
| 44 | + <!--Logout--> |
| 45 | + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> |
| 46 | + <!-- Disable single store view back--> |
| 47 | + <magentoCLI command="config:set general/single_store_mode/enabled 0" stepKey="enabledSingleStoreMode"/> |
| 48 | + </after> |
| 49 | + <!-- Go to frontend and make a user account and login with it --> |
| 50 | + <actionGroup ref="SignUpNewUserFromStorefrontActionGroup" stepKey="signUpNewUser"> |
| 51 | + <argument name="Customer" value="CustomerEntityOne"/> |
| 52 | + </actionGroup> |
| 53 | + <!-- Go to the product view page --> |
| 54 | + <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openStorefrontProductPage"> |
| 55 | + <argument name="productUrl" value="$$createProduct1.custom_attributes[url_key]$$"/> |
| 56 | + </actionGroup> |
| 57 | + <!-- Click on reviews and add reviews with current user --> |
| 58 | + <click selector="{{StorefrontProductReviewsSection.reviewsTab}}" stepKey="openReviewTab"/> |
| 59 | + <!-- set product rating stars --> |
| 60 | + <actionGroup ref="StorefrontSetProductRatingStarsActionGroup" stepKey="setQualityStars"> |
| 61 | + <argument name="ratingName" value="Quality"/> |
| 62 | + <argument name="stars" value="3"/> |
| 63 | + </actionGroup> |
| 64 | + <actionGroup ref="StorefrontSetProductRatingStarsActionGroup" stepKey="setValueStars"> |
| 65 | + <argument name="ratingName" value="Value"/> |
| 66 | + <argument name="stars" value="4"/> |
| 67 | + </actionGroup> |
| 68 | + <actionGroup ref="StorefrontSetProductRatingStarsActionGroup" stepKey="setPriceStars"> |
| 69 | + <argument name="ratingName" value="Price"/> |
| 70 | + <argument name="stars" value="5"/> |
| 71 | + </actionGroup> |
| 72 | + <!-- Click on reviews and add reviews with current user --> |
| 73 | + <actionGroup ref="StorefrontAddProductReviewActionGroup" stepKey="addReview"/> |
| 74 | + <!-- Go to Pending reviews page and clear filters --> |
| 75 | + <actionGroup ref="AdminOpenPendingReviewsPageActionGroup" stepKey="openReviewsPage"/> |
| 76 | + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearFilters"/> |
| 77 | + <!-- Moderate first product reviews: change review status from pending to approved, save --> |
| 78 | + <actionGroup ref="AdminOpenReviewByUserNicknameActionGroup" stepKey="openFirstCustomerReviews"/> |
| 79 | + <actionGroup ref="AdminChangeReviewStatusActionGroup" stepKey="changeFirstReviewStatus"/> |
| 80 | + <actionGroup ref="AdminSaveReviewActionGroup" stepKey="saveModeratedFirstReview"/> |
| 81 | + <!-- Navigate to PLP and check product rating for list and table views --> |
| 82 | + <actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="amOnStoreViewHomePage"/> |
| 83 | + <actionGroup ref="StoreFrontQuickSearchActionGroup" stepKey="searchBySku"> |
| 84 | + <argument name="query" value="$$createProduct1.sku$$"/> |
| 85 | + </actionGroup> |
| 86 | + <!-- Go to the product view page --> |
| 87 | + <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openStorefrontProductPageForReviewCheck"> |
| 88 | + <argument name="productUrl" value="$$createProduct1.custom_attributes[url_key]$$"/> |
| 89 | + </actionGroup> |
| 90 | + <waitForPageLoad stepKey="waitForPageToLoad"/> |
| 91 | + <!--check if the div#customer-reviews element --> |
| 92 | + <dontSeeElementInDOM selector="div#product-review-container > div#customer-review" stepKey="customerReviewDivIsNotLoaded"/> |
| 93 | + <!-- Click on reviews and add reviews with current user --> |
| 94 | + <click selector="{{StorefrontProductReviewsSection.reviewsTab}}" stepKey="openReviewTab2"/> |
| 95 | + <!-- Verify products reviews div#product-review-container > div#customer-reviews is loaded after click--> |
| 96 | + <actionGroup ref="AssertStorefrontSeeElementActionGroup" stepKey="seeCustomerReviewsDivIsLoaded"> |
| 97 | + <argument name="selector" value="div#product-review-container > div#customer-reviews"/> |
| 98 | + </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> |
| 112 | + </test> |
| 113 | +</tests> |
0 commit comments