|
| 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="AddingSeveralFPTToSimpleProductTest"> |
| 12 | + <annotations> |
| 13 | + <features value="Tax"/> |
| 14 | + <stories value="Shopping cart taxes"/> |
| 15 | + <title value="Adding Several FPT's To Simple Product"/> |
| 16 | + <description value="Adding Several FPT's To Simple Product"/> |
| 17 | + <severity value="MAJOR"/> |
| 18 | + <testCaseId value="AC-4477"/> |
| 19 | + <group value="checkout"/> |
| 20 | + <group value="tax"/> |
| 21 | + <group value="weee"/> |
| 22 | + </annotations> |
| 23 | + |
| 24 | + <before> |
| 25 | + <!-- Preconditions --> |
| 26 | + <!-- Customer is created with default addresses: --> |
| 27 | + <createData entity="Simple_US_Customer_CA" stepKey="createCustomer"/> |
| 28 | + |
| 29 | + <!-- Store -> Configuration -> Sales -> Tax FPT Enable --> |
| 30 | + <createData entity="WeeeConfigEnable" stepKey="enableFPT"/> |
| 31 | + |
| 32 | + <!-- Fixed Product 1 Tax attribute is created and added to default attribute set --> |
| 33 | + <createData entity="FPTProductAttribute" stepKey="createProductFPTAttributeFour"/> |
| 34 | + <createData entity="AddToDefaultSet" stepKey="addFPTToAttributeSet1"> |
| 35 | + <requiredEntity createDataKey="createProductFPTAttributeFour"/> |
| 36 | + </createData> |
| 37 | + |
| 38 | + <!-- Fixed Product Tax 2 attribute is created and added to default attribute set --> |
| 39 | + <createData entity="FPTProductAttribute" stepKey="createProductFPTAttributeThree"/> |
| 40 | + <createData entity="AddToDefaultSet" stepKey="addFPTToAttributeSet2"> |
| 41 | + <requiredEntity createDataKey="createProductFPTAttributeThree"/> |
| 42 | + </createData> |
| 43 | + |
| 44 | + <!-- Fixed Product Tax 3 attribute is created and added to default attribute set --> |
| 45 | + <createData entity="FPTProductAttribute" stepKey="createProductFPTAttributeTwo"/> |
| 46 | + <createData entity="AddToDefaultSet" stepKey="addFPTToAttributeSet3"> |
| 47 | + <requiredEntity createDataKey="createProductFPTAttributeTwo"/> |
| 48 | + </createData> |
| 49 | + |
| 50 | + <!-- Fixed Product Tax 4 attribute is created and added to default attribute set --> |
| 51 | + <createData entity="FPTProductAttribute" stepKey="createProductFPTAttributeOne"/> |
| 52 | + <createData entity="AddToDefaultSet" stepKey="addFPTToAttributeSet4"> |
| 53 | + <requiredEntity createDataKey="createProductFPTAttributeOne"/> |
| 54 | + </createData> |
| 55 | + |
| 56 | + <!-- Magento cache is flushed --> |
| 57 | + <actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanInvalidatedCaches"> |
| 58 | + <argument name="tags" value="config full_page"/> |
| 59 | + </actionGroup> |
| 60 | + |
| 61 | + <!-- Login as Admin --> |
| 62 | + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> |
| 63 | + |
| 64 | + <!-- Simple Product is created --> |
| 65 | + <createData entity="SimpleProduct2" stepKey="createSimpleProduct"> |
| 66 | + <field key="price">200.00</field> |
| 67 | + </createData> |
| 68 | + |
| 69 | + <!-- Open Simple Pproduct in Edit mode --> |
| 70 | + <actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="openProductEditPage"> |
| 71 | + <argument name="productId" value="$createSimpleProduct.id$"/> |
| 72 | + </actionGroup> |
| 73 | + |
| 74 | + <!-- Add values to FPT 1 --> |
| 75 | + <actionGroup ref="AdminProductAddFPTValueActionGroup" stepKey="addFPTValue1"> |
| 76 | + <argument name="FPTAttributeCode" value="$createProductFPTAttributeOne.attribute_code$"/> |
| 77 | + <argument name="countryForFPT" value="United States"/> |
| 78 | + <argument name="stateForFPT" value="California"/> |
| 79 | + <argument name="valueForFPT" value="2"/> |
| 80 | + </actionGroup> |
| 81 | + <!-- Add values to FPT 2 --> |
| 82 | + <actionGroup ref="AdminProductAddFPTValueActionGroup" stepKey="addFPTValue2"> |
| 83 | + <argument name="FPTAttributeCode" value="$createProductFPTAttributeTwo.attribute_code$"/> |
| 84 | + <argument name="countryForFPT" value="United States"/> |
| 85 | + <argument name="stateForFPT" value="California"/> |
| 86 | + <argument name="valueForFPT" value="6"/> |
| 87 | + </actionGroup> |
| 88 | + <!-- Add values to FPT 3 --> |
| 89 | + <actionGroup ref="AdminProductAddFPTValueActionGroup" stepKey="addFPTValue3"> |
| 90 | + <argument name="FPTAttributeCode" value="$createProductFPTAttributeThree.attribute_code$"/> |
| 91 | + <argument name="countryForFPT" value="United States"/> |
| 92 | + <argument name="stateForFPT" value="New York"/> |
| 93 | + <argument name="valueForFPT" value="11"/> |
| 94 | + </actionGroup> |
| 95 | + <!-- Add values to FPT 4 --> |
| 96 | + <actionGroup ref="AdminProductAddFPTValueActionGroup" stepKey="addFPTValue4"> |
| 97 | + <argument name="FPTAttributeCode" value="$createProductFPTAttributeFour.attribute_code$"/> |
| 98 | + <argument name="countryForFPT" value="Germany"/> |
| 99 | + <argument name="stateForFPT" value="Berlin"/> |
| 100 | + <argument name="valueForFPT" value="15"/> |
| 101 | + </actionGroup> |
| 102 | + <!-- Save Simple Product --> |
| 103 | + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> |
| 104 | + <magentoCron groups="index" stepKey="reindexBrokenIndices"/> |
| 105 | + </before> |
| 106 | + |
| 107 | + <after> |
| 108 | + <!-- Delete all four FPT Attributes --> |
| 109 | + <deleteData createDataKey="createProductFPTAttributeOne" stepKey="deleteProductFPTAttribute1"/> |
| 110 | + <deleteData createDataKey="createProductFPTAttributeTwo" stepKey="deleteProductFPTAttribute2"/> |
| 111 | + <deleteData createDataKey="createProductFPTAttributeThree" stepKey="deleteProductFPTAttribute3"/> |
| 112 | + <deleteData createDataKey="createProductFPTAttributeFour" stepKey="deleteProductFPTAttribute4"/> |
| 113 | + <!-- Disable FPT --> |
| 114 | + <createData entity="WeeeConfigDisable" stepKey="disableFPT"/> |
| 115 | + <!-- Delete Simple Product --> |
| 116 | + <deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/> |
| 117 | + <!-- Delete created customer --> |
| 118 | + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> |
| 119 | + <actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="navigateToProductIndex"/> |
| 120 | + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearProductsGridFilters"/> |
| 121 | + <!-- Logout from Admin --> |
| 122 | + <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutFromAdmin"/> |
| 123 | + <magentoCron groups="index" stepKey="reindexBrokenIndices"/> |
| 124 | + </after> |
| 125 | + |
| 126 | + <!-- Test Steps --> |
| 127 | + <!-- Step 1: Go to Storefront as logged in Customer --> |
| 128 | + <!-- Login as Customer and add Product to Cart--> |
| 129 | + <actionGroup ref="LoginToStorefrontActionGroup" stepKey="customerLogin"> |
| 130 | + <argument name="Customer" value="$$createCustomer$$"/> |
| 131 | + </actionGroup> |
| 132 | + <!-- Add simple product with qty 2 to shopping cart --> |
| 133 | + <actionGroup ref="StorefrontOpenProductEntityPageActionGroup" stepKey="openProductPage"> |
| 134 | + <argument name="product" value="$$createSimpleProduct$$"/> |
| 135 | + </actionGroup> |
| 136 | + <actionGroup ref="AddProductWithQtyToCartFromStorefrontProductPageActionGroup" stepKey="cartAddSimpleProductToCart"> |
| 137 | + <argument name="productName" value="$createSimpleProduct.name$"/> |
| 138 | + <argument name="productQty" value="2"/> |
| 139 | + </actionGroup> |
| 140 | + |
| 141 | + <!-- Select Mini Cart and select 'View And Edit Cart' --> |
| 142 | + <actionGroup ref="ClickViewAndEditCartFromMiniCartActionGroup" stepKey="selectViewAndEditCart"/> |
| 143 | + <!-- Scroll to summary section --> |
| 144 | + <scrollTo selector="{{CheckoutCartSummarySection.subtotal}}" stepKey="scrollToSummary"/> |
| 145 | + <!-- See Order totals contain 16$ of FPT --> |
| 146 | + <see selector="{{CheckoutCartSummarySection.amountFPT}}" userInput="$16" stepKey="checkFPTAmountInCheckoutPage"/> |
| 147 | + <!-- Click Proceed to checkout --> |
| 148 | + <actionGroup ref="StorefrontClickProceedToCheckoutActionGroup" stepKey="clickProceedToCheckout"/> |
| 149 | + <!-- Click next button to open payment section --> |
| 150 | + <actionGroup ref="StorefrontGuestCheckoutProceedToPaymentStepActionGroup" stepKey="clickNext"/> |
| 151 | + <!-- See Order totals contain 16$ of FPT --> |
| 152 | + <see selector="{{CheckoutCartSummarySection.amountFPT}}" userInput="$16" stepKey="checkFPTAmountInOrderSummaryPage"/> |
| 153 | + <!-- Checkout select Check/Money Order payment --> |
| 154 | + <actionGroup ref="CheckoutSelectCheckMoneyOrderPaymentActionGroup" stepKey="selectCheckMoneyPayment"/> |
| 155 | + <actionGroup ref="ClickPlaceOrderActionGroup" stepKey="clickPlaceOrder"/> |
| 156 | + <grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber22}}" stepKey="grabOrderNumber"/> |
| 157 | + |
| 158 | + <!-- Goto Admin > Sales > Orders page --> |
| 159 | + <amOnPage url="{{AdminOrdersPage.url}}" stepKey="onOrdersPage"/> |
| 160 | + <!-- Reset admin order filter --> |
| 161 | + <actionGroup ref="AdminOrdersGridClearFiltersActionGroup" stepKey="clearOrderFilters"/> |
| 162 | + <fillField selector="{{AdminOrdersGridSection.search}}" userInput="{$grabOrderNumber}" stepKey="searchOrderNum"/> |
| 163 | + <click selector="{{AdminOrdersGridSection.submitSearch}}" stepKey="submitSearch"/> |
| 164 | + <waitForLoadingMaskToDisappear stepKey="waitForLoadingMask4"/> |
| 165 | + <actionGroup ref="AdminOrderGridClickFirstRowActionGroup" stepKey="clickOrderRow"/> |
| 166 | + <scrollTo selector="{{AdminOrderTotalSection.subTotal}}" stepKey="scrollToOrderTotalSection"/> |
| 167 | + <!-- See Order totals contain 16$ of FPT --> |
| 168 | + <see selector="{{AdminOrderTotalSection.totalField('FPT')}}" userInput="$16.00" stepKey="seeFPTInOrderSummaryPage"/> |
| 169 | + <!-- Create an invoice for an order --> |
| 170 | + <actionGroup ref="AdminClickInvoiceButtonOrderViewActionGroup" stepKey="clickInvoice"/> |
| 171 | + <actionGroup ref="AdminInvoiceClickSubmitActionGroup" stepKey="clickSubmitInvoice"/> |
| 172 | + <see selector="{{AdminOrderDetailsMessagesSection.successMessage}}" userInput="The invoice has been created." stepKey="seeSuccessMessage"/> |
| 173 | + <!-- Click on Invoice on the left tab --> |
| 174 | + <click selector="{{AdminOrderDetailsOrderViewSection.invoices}}" stepKey="clickInvoices"/> |
| 175 | + <waitForPageLoad stepKey="waitForLoadingMask5" /> |
| 176 | + <see selector="{{AdminOrderDetailsInvoicesSection.content}}" userInput="{$grabOrderNumber}" stepKey="seeInvoice1"/> |
| 177 | + <!-- Click on view Button --> |
| 178 | + <click selector="{{AdminOrderDetailsInvoicesSection.viewButton}}" stepKey="clickViewButton"/> |
| 179 | + <waitForPageLoad stepKey="waitForOrderInformationTabLoadingMask"/> |
| 180 | + <scrollTo selector="{{AdminInvoiceTotalSection.grandTotal}}" stepKey="scrollToGrandTotalSection"/> |
| 181 | + <!-- See Order totals contain 16$ of FPT --> |
| 182 | + <see selector="{{AdminInvoiceTotalSection.total('FPT')}}" userInput="$16.00" stepKey="seeFPTInInvoicePage"/> |
| 183 | + <!-- Click on back button --> |
| 184 | + <click selector="{{AdminInvoiceTotalSection.backButton}}" stepKey="clickBackButton"/> |
| 185 | + <!-- Create an Credit memo for an order --> |
| 186 | + <click selector="{{AdminOrderDetailsMainActionsSection.creditMemo}}" stepKey="clickCreateCreditMemoForSecond" /> |
| 187 | + <conditionalClick selector="{{AdminOrderDetailsMainActionsSection.modalOk}}" dependentSelector="{{AdminOrderDetailsMainActionsSection.modalOk}}" |
| 188 | + visible="true" stepKey="acceptModal1"/> |
| 189 | + |
| 190 | + <!-- Scroll to summary section --> |
| 191 | + <scrollTo selector="{{AdminCreditMemoTotalSection.grandTotal}}" stepKey="scrollToGrandTotalSectionInCreditMemoScreen"/> |
| 192 | + <!-- See Order totals contain 16$ of FPT --> |
| 193 | + <see selector="{{AdminCreditMemoTotalSection.total('FPT')}}" userInput="$16.00" stepKey="seeFPTInCreditMemoPage"/> |
| 194 | + <!-- Click on refund offline button --> |
| 195 | + <click selector="{{AdminCreditMemoTotalSection.submitRefundOffline}}" stepKey="clickRefundOfflineForSecond"/> |
| 196 | + <see selector="{{AdminOrderDetailsMessagesSection.successMessage}}" userInput="You created the credit memo." stepKey="seeCreditMemoSuccessForSecond"/> |
| 197 | + <!-- Click on Credit Memo on the left tab --> |
| 198 | + <click selector="{{AdminOrderDetailsOrderViewSection.creditMemos}}" stepKey="clickCreditMemo"/> |
| 199 | + <waitForPageLoad stepKey="waitForLoadingMask6" /> |
| 200 | + <!-- Click on view button --> |
| 201 | + <click selector="{{AdminCreditMemosGridSection.viewButton}}" stepKey="clickInformationInCreditMemo"/> |
| 202 | + <scrollTo selector="{{AdminCreditMemoTotalSection.grandTotal}}" stepKey="scrollToGrandTotalSectionInCreditMemoPage"/> |
| 203 | + <!-- See Order totals contain 16$ of FPT --> |
| 204 | + <see selector="{{AdminCreditMemoTotalSection.total('FPT')}}" userInput="$16.00" stepKey="seeFPTInCreditMemoPageAgain"/> |
| 205 | + </test> |
| 206 | +</tests> |
0 commit comments