|
| 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="StorefrontVerifyCannotLoadFileWithIncorrectNameThroughCustomOptionsTest"> |
| 12 | + <annotations> |
| 13 | + <features value="Catalog"/> |
| 14 | + <stories value="Custom options"/> |
| 15 | + <title value="Verify cannot load file with incorrect name through Custom options"/> |
| 16 | + <description value="Verify cannot load file with incorrect name through Custom options"/> |
| 17 | + <severity value="CRITICAL"/> |
| 18 | + <testCaseId value="MC-7811"/> |
| 19 | + <group value="catalog"/> |
| 20 | + </annotations> |
| 21 | + <before> |
| 22 | + <!-- Create customer --> |
| 23 | + <createData entity="Simple_US_Customer" stepKey="createCustomer"/> |
| 24 | + <!-- Create category --> |
| 25 | + <createData entity="_defaultCategory" stepKey="createCategory"/> |
| 26 | + <!-- Create simple product --> |
| 27 | + <createData entity="_defaultProduct" stepKey="createProduct"> |
| 28 | + <requiredEntity createDataKey="createCategory"/> |
| 29 | + </createData> |
| 30 | + <!-- Add file upload custom option to the product --> |
| 31 | + <updateData createDataKey="createProduct" entity="ProductFileOptionWithScriptTag" stepKey="updateProductWithOption"/> |
| 32 | + <actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="logoutCustomer"/> |
| 33 | + </before> |
| 34 | + <after> |
| 35 | + <!-- Delete product --> |
| 36 | + <deleteData createDataKey="createProduct" stepKey="deleteSimpleProduct"/> |
| 37 | + <!-- Delete category --> |
| 38 | + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> |
| 39 | + <!-- Delete customer --> |
| 40 | + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> |
| 41 | + <actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="logoutCustomer"/> |
| 42 | + </after> |
| 43 | + |
| 44 | + <!-- Login to storefront --> |
| 45 | + <actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginAsCustomer"> |
| 46 | + <argument name="Customer" value="$$createCustomer$$"/> |
| 47 | + </actionGroup> |
| 48 | + |
| 49 | + <!-- Open product page --> |
| 50 | + <actionGroup ref="OpenStoreFrontProductPageActionGroup" stepKey="openProductPage"> |
| 51 | + <argument name="productUrlKey" value="$$createProduct.custom_attributes[url_key]$$"/> |
| 52 | + </actionGroup> |
| 53 | + |
| 54 | + <!-- Upload file --> |
| 55 | + <actionGroup ref="StorefrontAttachOptionFileActionGroup" stepKey="selectAndAttachFile"> |
| 56 | + <argument name="optionTitle" value="{{ProductOptionFile.title}}"/> |
| 57 | + <argument name="file" value="ProductFileOptionWithScriptTag.file"/> |
| 58 | + </actionGroup> |
| 59 | + |
| 60 | + <!-- Add product to cart --> |
| 61 | + <click selector="{{StorefrontProductInfoMainSection.AddToCart}}" stepKey="clickAddToCartButton"/> |
| 62 | + <waitForPageLoad stepKey="waitForProductAddToCart"/> |
| 63 | + |
| 64 | + <!-- Assert alert message --> |
| 65 | + <waitForElementVisible selector="{{StorefrontProductPageSection.alertMessage}}" stepKey="waitForElementVisible"/> |
| 66 | + <see selector="{{StorefrontProductPageSection.alertMessage}}" userInput="The file is empty. Please choose another one" stepKey="seeAlertMessage"/> |
| 67 | + |
| 68 | + <!-- Assert cart is empty --> |
| 69 | + <actionGroup ref="AssertMiniCartEmpty" stepKey="assertMiniCartEmpty"/> |
| 70 | + </test> |
| 71 | +</tests> |
0 commit comments