|
| 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="AdminDisableJsBundlingAndCreateProductTest"> |
| 12 | + <annotations> |
| 13 | + <features value="Catalog"/> |
| 14 | + <stories value="Preconditions for JS Bundling and Product"/> |
| 15 | + <title value="Disable JS bundling and create simple product along with/without custom options"/> |
| 16 | + <description value="Check the product price on product and cart page when JS bundling is disabled via CLI"/> |
| 17 | + <severity value="MAJOR"/> |
| 18 | + <testCaseId value="AC-4401"/> |
| 19 | + <group value="checkout"/> |
| 20 | + </annotations> |
| 21 | + <before> |
| 22 | + <!-- Precondition Step 1: Enable JS Bundling and related settings via CLI --> |
| 23 | + <createData entity="Simple_US_Customer" stepKey="createCustomer"/> |
| 24 | + <createData entity="_defaultCategory" stepKey="createCategory"/> |
| 25 | + <!-- Precondition Step 2: Create two Simple products --> |
| 26 | + <createData entity="ApiSimpleProduct" stepKey="createSimpleNoOptions"/> |
| 27 | + <createData entity="ApiSimpleProductWithCustomPrice" stepKey="createProduct"> |
| 28 | + <requiredEntity createDataKey="createCategory"/> |
| 29 | + </createData> |
| 30 | + <!-- Update product to have custom options --> |
| 31 | + <updateData createDataKey="createProduct" entity="productWithCustomOptions" stepKey="updateProductWithOptions"/> |
| 32 | + <!-- Login as Admin --> |
| 33 | + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> |
| 34 | + </before> |
| 35 | + <after> |
| 36 | + <!--Logout from customer account--> |
| 37 | + <actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="logoutStorefront"/> |
| 38 | + <!-- Admin Logout --> |
| 39 | + <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutAsAdmin"/> |
| 40 | + <!-- Delete Customer --> |
| 41 | + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> |
| 42 | + <!-- Delete created products and category --> |
| 43 | + <deleteData createDataKey="createProduct" stepKey="deleteSimpleWithOptionsBase"/> |
| 44 | + <deleteData createDataKey="createSimpleNoOptions" stepKey="deleteSimpleNoOptions"/> |
| 45 | + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> |
| 46 | + </after> |
| 47 | + <actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginToStorefrontAccount"> |
| 48 | + <argument name="Customer" value="$$createCustomer$$"/> |
| 49 | + </actionGroup> |
| 50 | + <!-- Step 1: Go to product page on Storefront --> |
| 51 | + <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openStorefrontProductPage"> |
| 52 | + <argument name="productUrl" value="$$createProduct.custom_attributes[url_key]$$"/> |
| 53 | + </actionGroup> |
| 54 | + <!-- Step 2: Select product with custom options --> |
| 55 | + <actionGroup ref="StorefrontSelectCustomOptionDropDownAndAssertPricesActionGroup" stepKey="selectDropdownAssertPrice"> |
| 56 | + <argument name="customOption" value="OptionValueDropDown1"/> |
| 57 | + <argument name="productPrice" value="$100.01"/> |
| 58 | + <argument name="productFinalPrice" value="$100.01"/> |
| 59 | + </actionGroup> |
| 60 | + <!-- Step 3: Add product to cart --> |
| 61 | + <actionGroup ref="StorefrontAddProductToCartActionGroup" stepKey="addProductToCart"> |
| 62 | + <argument name="product" value="$$createProduct$$"/> |
| 63 | + <argument name="productCount" value="1"/> |
| 64 | + </actionGroup> |
| 65 | + <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openAgainStorefrontProductPage"> |
| 66 | + <argument name="productUrl" value="$$createSimpleNoOptions.custom_attributes[url_key]$$"/> |
| 67 | + </actionGroup> |
| 68 | + <actionGroup ref="StorefrontAddSimpleProductToShoppingCartActionGroup" stepKey="addAnotherProductToCart"> |
| 69 | + <argument name="product" value="$createSimpleNoOptions$"/> |
| 70 | + </actionGroup> |
| 71 | + <actionGroup ref="StorefrontCartPageOpenActionGroup" stepKey="openShoppingCartPage"/> |
| 72 | + <!-- Step 4: Check product price in cart --> |
| 73 | + <waitForText userInput="$100.01" selector="{{CheckoutCartProductSection.ProductPriceByName($$createProduct.name$$)}}" stepKey="assertProductPrice"/> |
| 74 | + <waitForText userInput="$123.00" selector="{{CheckoutCartProductSection.ProductPriceByName($$createSimpleNoOptions.name$$)}}" stepKey="assertProductPriceInCart"/> |
| 75 | + <!-- Step 5: Click Proceed to Checkout button --> |
| 76 | + <actionGroup ref="StorefrontClickProceedToCheckoutActionGroup" stepKey="goToCheckout"/> |
| 77 | + <!-- Step 6: Select Flat Rate shipping method and click *Next* button --> |
| 78 | + <actionGroup ref="StorefrontCheckoutClickNextButtonActionGroup" stepKey="clickOnNextButton"/> |
| 79 | + <!-- Step 7: Select Check/Money Order as a payment method --> |
| 80 | + <actionGroup ref="CheckoutSelectCheckMoneyOrderPaymentActionGroup" stepKey="selectCheckMoneyPayment"/> |
| 81 | + <!-- Step 8: Click Place order button --> |
| 82 | + <actionGroup ref="ClickPlaceOrderActionGroup" stepKey="clickPlaceOrder"/> |
| 83 | + </test> |
| 84 | +</tests> |
0 commit comments