|
| 1 | +<?xml version="1.0" encoding="UTF-8"?> |
| 2 | +<!-- |
| 3 | + /************************************************************************ |
| 4 | + * |
| 5 | + * Copyright 2024 Adobe |
| 6 | + * All Rights Reserved. |
| 7 | + * |
| 8 | + * NOTICE: All information contained herein is, and remains |
| 9 | + * the property of Adobe and its suppliers, if any. The intellectual |
| 10 | + * and technical concepts contained herein are proprietary to Adobe |
| 11 | + * and its suppliers and are protected by all applicable intellectual |
| 12 | + * property laws, including trade secret and copyright laws. |
| 13 | + * Dissemination of this information or reproduction of this material |
| 14 | + * is strictly forbidden unless prior written permission is obtained |
| 15 | + * from Adobe. |
| 16 | + * ************************************************************************ |
| 17 | + */ |
| 18 | + --> |
| 19 | + |
| 20 | +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| 21 | + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> |
| 22 | + <test name="StorefrontCheckBundleOptionPriceInOtherCurrencyGuestTest"> |
| 23 | + <annotations> |
| 24 | + <stories value="Order bundle"/> |
| 25 | + <title value="Bundle option price in order on Storefront"/> |
| 26 | + <description value="Checks bundle option price in other currency in order on Storefront"/> |
| 27 | + <severity value="MAJOR"/> |
| 28 | + <testCaseId value="AC-11749"/> |
| 29 | + <useCaseId value="ACP2E-2950"/> |
| 30 | + </annotations> |
| 31 | + <before> |
| 32 | + <!-- Set currency --> |
| 33 | + <magentoCLI command="config:set currency/options/allow EUR,PLN,USD" stepKey="setCurrencyAllow"/> |
| 34 | + <magentoCLI command="config:set currency/options/default PLN" stepKey="setCurrencyDisplay"/> |
| 35 | + |
| 36 | + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> |
| 37 | + |
| 38 | + <actionGroup ref="AdminOpenCurrencyRatesPageActionGroup" stepKey="gotToCurrencyRatesPage"/> |
| 39 | + <actionGroup ref="AdminSetCurrencyRatesActionGroup" stepKey="setCurrencyRate"> |
| 40 | + <argument name="firstCurrency" value="USD"/> |
| 41 | + <argument name="secondCurrency" value="PLN"/> |
| 42 | + <argument name="rate" value="5"/> |
| 43 | + </actionGroup> |
| 44 | + |
| 45 | + <!-- Create Category --> |
| 46 | + <createData entity="ApiCategory" stepKey="createCategory"/> |
| 47 | + |
| 48 | + <!-- Create bundle Product --> |
| 49 | + <createData entity="SimpleSubCategory" stepKey="createSubCategory"/> |
| 50 | + <createData entity="SimpleProduct2" stepKey="simpleProduct1"> |
| 51 | + <field key="price">100.00</field> |
| 52 | + </createData> |
| 53 | + <createData entity="SimpleProduct2" stepKey="simpleProduct2"> |
| 54 | + <field key="price">560.00</field> |
| 55 | + </createData> |
| 56 | + <createData entity="BundleProductPriceViewRange" stepKey="createBundleProduct"> |
| 57 | + <requiredEntity createDataKey="createSubCategory"/> |
| 58 | + </createData> |
| 59 | + <createData entity="DropDownBundleOption" stepKey="createBundleOption1_1"> |
| 60 | + <requiredEntity createDataKey="createBundleProduct"/> |
| 61 | + <field key="required">True</field> |
| 62 | + </createData> |
| 63 | + <createData entity="ApiBundleLink" stepKey="linkOptionToProduct"> |
| 64 | + <requiredEntity createDataKey="createBundleProduct"/> |
| 65 | + <requiredEntity createDataKey="createBundleOption1_1"/> |
| 66 | + <requiredEntity createDataKey="simpleProduct1"/> |
| 67 | + </createData> |
| 68 | + <createData entity="ApiBundleLink" stepKey="linkOptionToProduct2"> |
| 69 | + <requiredEntity createDataKey="createBundleProduct"/> |
| 70 | + <requiredEntity createDataKey="createBundleOption1_1"/> |
| 71 | + <requiredEntity createDataKey="simpleProduct2"/> |
| 72 | + </createData> |
| 73 | + |
| 74 | + <!-- Grab bundle option name for Bundle Product --> |
| 75 | + <actionGroup ref="NavigateToCreatedProductEditPageActionGroup" stepKey="goToBundleProduct"> |
| 76 | + <argument name="product" value="$createBundleProduct$"/> |
| 77 | + </actionGroup> |
| 78 | + <grabTextFrom selector="{{AdminProductFormBundleSection.currentBundleOption}}" stepKey="grabBundleOption"/> |
| 79 | + <assertNotEmpty stepKey="assertBundleOptionNotEmpty"> |
| 80 | + <actualResult type="const">$grabBundleOption</actualResult> |
| 81 | + </assertNotEmpty> |
| 82 | + |
| 83 | + <actionGroup ref="AdminClearFiltersActionGroup" stepKey="clearProductGridFilters"/> |
| 84 | + |
| 85 | + <!-- Create Customer Account --> |
| 86 | + <createData entity="Simple_US_Customer" stepKey="createCustomer"/> |
| 87 | + |
| 88 | + <!-- Place order with bundle --> |
| 89 | + <actionGroup ref="AdminNavigateToNewOrderPageExistingCustomerActionGroup" stepKey="newOrder"> |
| 90 | + <argument name="customer" value="$createCustomer$"/> |
| 91 | + </actionGroup> |
| 92 | + |
| 93 | + <actionGroup ref="AdminFilterProductInCreateOrderActionGroup" stepKey="filterBundleProduct"> |
| 94 | + <argument name="productSKU" value="$createBundleProduct.sku$"/> |
| 95 | + </actionGroup> |
| 96 | + <actionGroup ref="AdminAddToOrderBundleProductActionGroup" stepKey="addBundleProduct"> |
| 97 | + <argument name="option" value="{$grabBundleOption}"/> |
| 98 | + <argument name="selectedProductName" value="$simpleProduct1.name$"/> |
| 99 | + <argument name="quantity" value="2"/> |
| 100 | + </actionGroup> |
| 101 | + |
| 102 | + <actionGroup ref="FillOrderCustomerInformationActionGroup" stepKey="fillOrder"> |
| 103 | + <argument name="customer" value="$createCustomer$"/> |
| 104 | + <argument name="address" value="US_Address_TX"/> |
| 105 | + </actionGroup> |
| 106 | + |
| 107 | + <actionGroup ref="OrderSelectFlatRateShippingActionGroup" stepKey="selectFlatRate"/> |
| 108 | + <actionGroup ref="SelectCheckMoneyPaymentMethodActionGroup" stepKey="selectCheckMoneyPayment"/> |
| 109 | + </before> |
| 110 | + <after> |
| 111 | + <deleteData createDataKey="createSubCategory" stepKey="deleteCategory1"/> |
| 112 | + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> |
| 113 | + |
| 114 | + <deleteData createDataKey="simpleProduct1" stepKey="deleteProduct1"/> |
| 115 | + <deleteData createDataKey="simpleProduct2" stepKey="deleteProduct2"/> |
| 116 | + <deleteData createDataKey="createBundleProduct" stepKey="deleteBundleProduct"/> |
| 117 | + |
| 118 | + <actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="logoutCustomer" /> |
| 119 | + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> |
| 120 | + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> |
| 121 | + |
| 122 | + <magentoCLI command="config:set currency/options/default USD" stepKey="unsetCurrencyDisplay"/> |
| 123 | + <magentoCLI command="config:set currency/options/allow EUR,USD" stepKey="unsetCurrencyAllow"/> |
| 124 | + </after> |
| 125 | + |
| 126 | + <!-- Submit the Order --> |
| 127 | + <actionGroup ref="AdminSubmitOrderActionGroup" stepKey="submitOrder"/> |
| 128 | + |
| 129 | + <grabTextFrom selector="|Order # (\d+)|" stepKey="orderNumber"/> |
| 130 | + <grabFromCurrentUrl regex="~/order_id/(\d+)/~" stepKey="orderId"/> |
| 131 | + <assertNotEmpty stepKey="assertOrderIdIsNotEmpty"> |
| 132 | + <actualResult type="const">$orderNumber</actualResult> |
| 133 | + </assertNotEmpty> |
| 134 | + |
| 135 | + <!-- Find the Order on frontend > Navigate to: Orders and Returns --> |
| 136 | + <amOnPage url="{{StorefrontGuestOrderSearchPage.url}}" stepKey="amOnOrdersAndReturns"/> |
| 137 | + <waitForPageLoad stepKey="waiForStorefrontPage"/> |
| 138 | + |
| 139 | + <!-- Fill the form with correspondent Order data --> |
| 140 | + <actionGroup ref="StorefrontFillOrdersAndReturnsFormActionGroup" stepKey="fillOrder"> |
| 141 | + <argument name="orderNumber" value="{$orderNumber}"/> |
| 142 | + <argument name="customer" value="$createCustomer$"/> |
| 143 | + </actionGroup> |
| 144 | + |
| 145 | + <!-- Click on the "Continue" button --> |
| 146 | + <click selector="{{StorefrontGuestOrderSearchSection.continue}}" stepKey="clickContinue"/> |
| 147 | + <waitForPageLoad stepKey="waitForPageLoad"/> |
| 148 | + |
| 149 | + <!-- Assert Bundle Options Price --> |
| 150 | + <see userInput="PLN 500.00" selector="{{StorefrontOrderDetailsSection.bundleOptionPrice}}" stepKey="seeBundleOptionPrice"/> |
| 151 | + |
| 152 | + <!-- Assert Order Grand Total --> |
| 153 | + <see userInput="PLN 1,050.00" selector="{{StorefrontOrderDetailsSection.grandTotalPrice}}" stepKey="assertSalesOrderGrandTotal"/> |
| 154 | + </test> |
| 155 | +</tests> |
0 commit comments