Skip to content

Commit d2a9759

Browse files
Merge branch 'ACQE-9004' into ACQE-functional-deployment-version23
2 parents 1fb51a7 + 53bf4fa commit d2a9759

File tree

1 file changed

+78
-0
lines changed

1 file changed

+78
-0
lines changed
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
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+
</annotations>
22+
<before>
23+
<!-- Step 1: Create simple product with file custom option via API -->
24+
<createData entity="SimpleProduct2" stepKey="createProduct">
25+
<field key="price">100.00</field>
26+
</createData>
27+
<createData entity="productWithFileOption" stepKey="addFileOptionToProduct">
28+
<requiredEntity createDataKey="createProduct"/>
29+
</createData>
30+
<!-- Login to admin -->
31+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
32+
</before>
33+
<after>
34+
<!-- Delete created product -->
35+
<deleteData createDataKey="createProduct" stepKey="deleteProduct"/>
36+
<!-- Logout from admin -->
37+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logoutFromAdmin"/>
38+
</after>
39+
<!-- Step 2: Open created product on storefront -->
40+
<actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openProductPageOnStorefront">
41+
<argument name="productUrl" value="$createProduct.custom_attributes[url_key]$"/>
42+
</actionGroup>
43+
<!-- Step 3: Upload any file and add product to cart -->
44+
<waitForElementVisible selector="{{StorefrontProductInfoMainSection.addLinkFileUploadFile(ProductOptionFile.title)}}" stepKey="waitForFileUploadField"/>
45+
<attachFile selector="{{StorefrontProductInfoMainSection.addLinkFileUploadFile(ProductOptionFile.title)}}" userInput="{{MagentoLogo.file}}" stepKey="attachFileToCustomOption"/>
46+
<waitForPageLoad stepKey="waitForFileUploaded"/>
47+
<actionGroup ref="StorefrontAddToTheCartActionGroup" stepKey="addProductToCart"/>
48+
<!-- Step 4: Open the cart -->
49+
<actionGroup ref="StorefrontOpenCartFromMinicartActionGroup" stepKey="openShoppingCart"/>
50+
<!-- Step 4 Expected Result: The cart displays the product and the custom option as a clickable filename -->
51+
<waitForElementVisible selector="{{CheckoutCartProductSection.ProductLinkByName($createProduct.name$)}}" stepKey="waitForProductInCart"/>
52+
<waitForText selector="{{CheckoutCartProductSection.ProductLinkByName($createProduct.name$)}}" userInput="$createProduct.name$" stepKey="waitForProductNameInCart"/>
53+
<waitForElementVisible selector="{{CheckoutCartProductSection.ProductOptionByNameAndAttribute($createProduct.name$, ProductOptionFile.title)}}" stepKey="waitForCustomOptionVisible"/>
54+
<waitForText selector="{{CheckoutCartProductSection.ProductOptionByNameAndAttribute($createProduct.name$, ProductOptionFile.title)}}" userInput="{{MagentoLogo.filename}}" stepKey="waitForUploadedFileNameInCart"/>
55+
<!-- Step 5: Proceed to checkout and create order -->
56+
<actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="goToCheckoutFromCart"/>
57+
<waitForPageLoad stepKey="waitForCheckoutPageLoad"/>
58+
<!-- Fill shipping information -->
59+
<actionGroup ref="GuestCheckoutFillingShippingSectionActionGroup" stepKey="fillShippingInformation">
60+
<argument name="customerVar" value="CustomerEntityOne"/>
61+
<argument name="customerAddressVar" value="CustomerAddressSimple"/>
62+
</actionGroup>
63+
<!-- Place order -->
64+
<actionGroup ref="ClickPlaceOrderActionGroup" stepKey="placeOrder"/>
65+
<!-- Get order ID -->
66+
<grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber}}" stepKey="grabOrderId"/>
67+
<!-- Step 6: Open order from admin -->
68+
<actionGroup ref="AdminOpenOrderByEntityIdActionGroup" stepKey="goToOrderInAdmin">
69+
<argument name="entityId" value="{$grabOrderId}"/>
70+
</actionGroup>
71+
<waitForPageLoad stepKey="waitForOrderPageLoad"/>
72+
<!-- Step 6 Expected Result: Verify the uploaded file link is present and visible -->
73+
<waitForElementVisible selector="{{AdminOrderItemsOrderedSection.productNameOptions}}" stepKey="waitForProductOptions"/>
74+
<waitForText selector="{{AdminOrderItemsOrderedSection.productNameOptions}}" userInput="{{ProductOptionFile.title}}" stepKey="waitForCustomOptionTitleInOrder"/>
75+
<!-- Verify the file download link is present in order -->
76+
<waitForElementVisible selector="{{AdminOrderItemsOrderedSection.productNameOptionsLink(MagentoLogo.file)}}" stepKey="waitForFileDownloadLinkInOrder"/>
77+
</test>
78+
</tests>

0 commit comments

Comments
 (0)