|
| 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="StorefrontReviewDisallowGuestsToWriteReviewsTest"> |
| 12 | + <annotations> |
| 13 | + <features value="Review"/> |
| 14 | + <stories value="Disallow guests to write reviews"/> |
| 15 | + <title value="Guests are not allowed to write reviews if the option disabled in admin"/> |
| 16 | + <description value="Guests should be not able write product reviews if the option disabled in configurations"/> |
| 17 | + <severity value="MINOR"/> |
| 18 | + <group value="catalog"/> |
| 19 | + </annotations> |
| 20 | + <before> |
| 21 | + <magentoCLI command="config:set {{DisAllowGuestsToWriteReviewsConfigData.path}} {{DisAllowGuestsToWriteReviewsConfigData.value}}" stepKey="disAllowGuestsWriteReviews"/> |
| 22 | + <createData entity="SimpleSubCategory" stepKey="createCategory"/> |
| 23 | + <createData entity="_defaultProduct" stepKey="createProduct"> |
| 24 | + <requiredEntity createDataKey="createCategory"/> |
| 25 | + </createData> |
| 26 | + <actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanInvalidatedCaches"> |
| 27 | + <argument name="tags" value="config full_page"/> |
| 28 | + </actionGroup> |
| 29 | + </before> |
| 30 | + <after> |
| 31 | + <magentoCLI command="config:set {{AllowGuestsToWriteReviewsConfigData.path}} {{AllowGuestsToWriteReviewsConfigData.value}}" stepKey="returnDefaultValue"/> |
| 32 | + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> |
| 33 | + <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> |
| 34 | + <actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanInvalidatedCaches"> |
| 35 | + <argument name="tags" value="config full_page"/> |
| 36 | + </actionGroup> |
| 37 | + </after> |
| 38 | + |
| 39 | + <actionGroup ref="OpenProductFromCategoryPageActionGroup" stepKey="openProductFromCategory"> |
| 40 | + <argument name="category" value="$createCategory$"/> |
| 41 | + <argument name="product" value="$createProduct$"/> |
| 42 | + </actionGroup> |
| 43 | + <actionGroup ref="StorefrontAssertReviewNotificationForNotLoggedInUsersActionGroup" stepKey="assertMessage"> |
| 44 | + <argument name="message" value="Only registered users can write reviews. Please Sign in or create an account"/> |
| 45 | + </actionGroup> |
| 46 | + <actionGroup ref="StorefrontAssertReviewFieldsAreAbsentActionGroup" stepKey="assertReviewElementsNotVisible"/> |
| 47 | + </test> |
| 48 | +</tests> |
0 commit comments