|
| 1 | +<?xml version="1.0" encoding="UTF-8"?> |
| 2 | +<!-- |
| 3 | +/** |
| 4 | + * Copyright 2025 Adobe |
| 5 | + * All Rights Reserved. |
| 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="AdminVerifyFileUploadLinkInOrderForProductCustomOptionTest"> |
| 12 | + <annotations> |
| 13 | + <features value="Sales"/> |
| 14 | + <stories value="Product custom options with file upload"/> |
| 15 | + <title value="Admin can view file upload link in order for product custom option"/> |
| 16 | + <description value="Verify uploaded file link is visible in admin order page"/> |
| 17 | + <severity value="CRITICAL"/> |
| 18 | + <testCaseId value="AC-4423"/> |
| 19 | + <group value="sales"/> |
| 20 | + <group value="catalog"/> |
| 21 | + <group value="custom_options"/> |
| 22 | + </annotations> |
| 23 | + <before> |
| 24 | + <!-- Step 1: Create simple product with file custom option via API --> |
| 25 | + <createData entity="SimpleProduct2" stepKey="createProduct"> |
| 26 | + <field key="price">100.00</field> |
| 27 | + </createData> |
| 28 | + <createData entity="productWithFileOption" stepKey="addFileOptionToProduct"> |
| 29 | + <requiredEntity createDataKey="createProduct"/> |
| 30 | + </createData> |
| 31 | + <!-- Login to admin --> |
| 32 | + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> |
| 33 | + </before> |
| 34 | + <after> |
| 35 | + <!-- Delete created product --> |
| 36 | + <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> |
| 37 | + <!-- Logout from admin --> |
| 38 | + <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutFromAdmin"/> |
| 39 | + </after> |
| 40 | + <!-- Step 2: Open created product on storefront --> |
| 41 | + <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openProductPageOnStorefront"> |
| 42 | + <argument name="productUrl" value="$createProduct.custom_attributes[url_key]$"/> |
| 43 | + </actionGroup> |
| 44 | + <waitForPageLoad stepKey="waitForProductPageLoad"/> |
| 45 | + <!-- Step 3: Upload any file and add product to cart --> |
| 46 | + <waitForElementVisible selector="{{StorefrontProductInfoMainSection.addLinkFileUploadFile(ProductOptionFile.title)}}" stepKey="waitForFileUploadField"/> |
| 47 | + <attachFile selector="{{StorefrontProductInfoMainSection.addLinkFileUploadFile(ProductOptionFile.title)}}" userInput="{{MagentoLogo.file}}" stepKey="attachFileToCustomOption"/> |
| 48 | + <waitForPageLoad stepKey="waitForFileUploaded"/> |
| 49 | + <actionGroup ref="StorefrontAddToTheCartActionGroup" stepKey="addProductToCart"/> |
| 50 | + <waitForPageLoad stepKey="waitForProductAddedToCart"/> |
| 51 | + <!-- Step 4: Open the cart --> |
| 52 | + <actionGroup ref="StorefrontOpenCartFromMinicartActionGroup" stepKey="openShoppingCart"/> |
| 53 | + <waitForPageLoad stepKey="waitForCartPageLoad"/> |
| 54 | + <!-- Step 4 Expected Result: The cart displays the product and the custom option as a clickable filename --> |
| 55 | + <waitForElementVisible selector="{{CheckoutCartProductSection.ProductLinkByName($createProduct.name$)}}" stepKey="waitForProductInCart"/> |
| 56 | + <waitForText selector="{{CheckoutCartProductSection.ProductLinkByName($createProduct.name$)}}" userInput="$createProduct.name$" stepKey="waitForProductNameInCart"/> |
| 57 | + <waitForElementVisible selector="{{CheckoutCartProductSection.ProductOptionByNameAndAttribute($createProduct.name$, ProductOptionFile.title)}}" stepKey="waitForCustomOptionVisible"/> |
| 58 | + <waitForText selector="{{CheckoutCartProductSection.ProductOptionByNameAndAttribute($createProduct.name$, ProductOptionFile.title)}}" userInput="{{MagentoLogo.filename}}" stepKey="waitForUploadedFileNameInCart"/> |
| 59 | + <!-- Step 5: Proceed to checkout and create order --> |
| 60 | + <actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="goToCheckoutFromCart"/> |
| 61 | + <waitForPageLoad stepKey="waitForCheckoutPageLoad"/> |
| 62 | + <!-- Fill shipping information --> |
| 63 | + <actionGroup ref="GuestCheckoutFillingShippingSectionActionGroup" stepKey="fillShippingInformation"> |
| 64 | + <argument name="customerVar" value="CustomerEntityOne"/> |
| 65 | + <argument name="customerAddressVar" value="CustomerAddressSimple"/> |
| 66 | + </actionGroup> |
| 67 | + <waitForPageLoad stepKey="waitForShippingMethodsLoad"/> |
| 68 | + <!-- Place order --> |
| 69 | + <actionGroup ref="ClickPlaceOrderActionGroup" stepKey="placeOrder"/> |
| 70 | + <waitForPageLoad stepKey="waitForOrderPlaced"/> |
| 71 | + <!-- Get order ID --> |
| 72 | + <grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber}}" stepKey="grabOrderId"/> |
| 73 | + <!-- Step 6: Open order from admin --> |
| 74 | + <actionGroup ref="AdminOpenOrderByEntityIdActionGroup" stepKey="goToOrderInAdmin"> |
| 75 | + <argument name="entityId" value="{$grabOrderId}"/> |
| 76 | + </actionGroup> |
| 77 | + <waitForPageLoad stepKey="waitForOrderPageLoad"/> |
| 78 | + <!-- Step 6 Expected Result: Verify the uploaded file link is present and visible --> |
| 79 | + <waitForElementVisible selector="{{AdminOrderItemsOrderedSection.productNameOptions}}" stepKey="waitForProductOptions"/> |
| 80 | + <waitForText selector="{{AdminOrderItemsOrderedSection.productNameOptions}}" userInput="{{ProductOptionFile.title}}" stepKey="waitForCustomOptionTitleInOrder"/> |
| 81 | + <!-- Verify the file download link is present in order --> |
| 82 | + <waitForElementVisible selector="{{AdminOrderItemsOrderedSection.productNameOptionsLink(MagentoLogo.file)}}" stepKey="waitForFileDownloadLinkInOrder"/> |
| 83 | + </test> |
| 84 | +</tests> |
0 commit comments