|
| 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="ProductViewPageCustomOptionValidationTest"> |
| 12 | + <annotations> |
| 13 | + <features value="Catalog"/> |
| 14 | + <stories value="Product view page"/> |
| 15 | + <title value="[Magento Cloud] Bug of product custom option validation in product view page"/> |
| 16 | + <description value="Check custom option validation error message is displayed in product view page"/> |
| 17 | + <severity value="AVERAGE"/> |
| 18 | + <testCaseId value="AC-9978"/> |
| 19 | + <useCaseId value="ACP2E-2404"/> |
| 20 | + <group value="Catalog"/> |
| 21 | + </annotations> |
| 22 | + <before> |
| 23 | + <createData entity="SimpleProduct2" stepKey="createProduct"/> |
| 24 | + </before> |
| 25 | + <after> |
| 26 | + <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> |
| 27 | + </after> |
| 28 | + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin" /> |
| 29 | + <!-- open product edit page --> |
| 30 | + <actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="goToProductEditPage"> |
| 31 | + <argument name="productId" value="$$createProduct.id$$"/> |
| 32 | + </actionGroup> |
| 33 | + <!-- Create a custom option(radio button) with 2 values --> |
| 34 | + <click stepKey="openCustomizableOptions" selector="{{AdminProductCustomizableOptionsSection.customizableOptions}}"/> |
| 35 | + <waitForPageLoad stepKey="waitForCustomOptionsOpen"/> |
| 36 | + <actionGroup ref="CreateCustomRadioOptionsActionGroup" stepKey="createCustomOption1"> |
| 37 | + <argument name="customOptionName" value="ProductOptionRadiobutton.title"/> |
| 38 | + <argument name="productOption" value="ProductOptionField"/> |
| 39 | + <argument name="productOption2" value="ProductOptionField2"/> |
| 40 | + </actionGroup> |
| 41 | + <!-- Save the product --> |
| 42 | + <actionGroup ref="AdminProductFormSaveActionGroup" stepKey="saveProduct"/> |
| 43 | + <seeElement selector="{{AdminCategoryMessagesSection.SuccessMessage}}" stepKey="assertSuccess"/> |
| 44 | + <!-- indexer reindex --> |
| 45 | + <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> |
| 46 | + <argument name="indices" value=""/> |
| 47 | + </actionGroup> |
| 48 | + <!-- Navigate to Product Page on StoreFront --> |
| 49 | + <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openStorefrontProductPage"> |
| 50 | + <argument name="productUrl" value="$$createProduct.custom_attributes[url_key]$$"/> |
| 51 | + </actionGroup> |
| 52 | + <!-- Add Product to Cart from product detail page --> |
| 53 | + <click selector="{{StorefrontProductActionSection.addToCart}}" stepKey="addToCart"/> |
| 54 | + <!-- see custom option validation message --> |
| 55 | + <see userInput="This is a required field." stepKey="seeRequiredField"/> |
| 56 | + </test> |
| 57 | +</tests> |
0 commit comments