|
| 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="StorefrontUpdateShoppingCartSimpleWithCustomOptionsProductQtyTest"> |
| 12 | + <annotations> |
| 13 | + <features value="Checkout"/> |
| 14 | + <title value="Check updating shopping cart while updating qty of items with custom options"/> |
| 15 | + <description value="Check updating shopping cart while updating qty of items with custom options"/> |
| 16 | + <testCaseId value="MC-14732" /> |
| 17 | + <group value="shoppingCart"/> |
| 18 | + <group value="mtf_migrated"/> |
| 19 | + </annotations> |
| 20 | + <before> |
| 21 | + <createData entity="_defaultCategory" stepKey="createCategory"/> |
| 22 | + <createData entity="ApiSimpleProductWithCustomPrice" stepKey="createProduct"> |
| 23 | + <requiredEntity createDataKey="createCategory"/> |
| 24 | + </createData> |
| 25 | + |
| 26 | + <!-- Add two custom options to the product: field and textarea --> |
| 27 | + <updateData createDataKey="createProduct" entity="ProductWithTextFieldAndAreaOptions" stepKey="updateProductWithOption"/> |
| 28 | + |
| 29 | + <!-- Go to the product page, fill the custom options values and add the product to the shopping cart --> |
| 30 | + <amOnPage url="{{StorefrontProductPage.url($$createProduct.custom_attributes[url_key]$$)}}" stepKey="amOnProductPage"/> |
| 31 | + <waitForPageLoad stepKey="waitForCatalogPageLoad"/> |
| 32 | + <fillField userInput="OptionField" selector="{{StorefrontProductInfoMainSection.productOptionFieldInput(ProductOptionField.title)}}" stepKey="fillProductOptionInputField"/> |
| 33 | + <fillField userInput="OptionArea" selector="{{StorefrontProductInfoMainSection.productOptionAreaInput(ProductOptionArea.title)}}" stepKey="fillProductOptionInputArea"/> |
| 34 | + <actionGroup ref="StorefrontAddToCartCustomOptionsProductPageActionGroup" stepKey="addToCartFromStorefrontProductPage"> |
| 35 | + <argument name="productName" value="$createProduct.name$"/> |
| 36 | + </actionGroup> |
| 37 | + </before> |
| 38 | + <after> |
| 39 | + <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> |
| 40 | + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> |
| 41 | + </after> |
| 42 | + |
| 43 | + <!-- Go to the shopping cart --> |
| 44 | + <amOnPage url="{{CheckoutCartPage.url}}" stepKey="amOnPageShoppingCart"/> |
| 45 | + <waitForPageLoad stepKey="waitForCheckoutPageLoad"/> |
| 46 | + |
| 47 | + <!-- Change the product QTY --> |
| 48 | + <fillField selector="{{CheckoutCartProductSection.ProductQuantityByName($$createProduct.name$$)}}" userInput="{{quoteQty11Subtotal1320.qty}}" stepKey="changeCartQty"/> |
| 49 | + <click selector="{{CheckoutCartProductSection.updateShoppingCartButton}}" stepKey="updateShoppingCart"/> |
| 50 | + <waitForPageLoad stepKey="waitShoppingCartUpdated"/> |
| 51 | + |
| 52 | + <!-- The price and QTY values should be updated for the product --> |
| 53 | + <grabValueFrom selector="{{CheckoutCartProductSection.ProductQuantityByName($$createProduct.name$$)}}" stepKey="grabProductQtyInCart"/> |
| 54 | + <see userInput="{{quoteQty11Subtotal1320.currency}}{{quoteQty11Subtotal1320.subtotal}}" selector="{{CheckoutCartProductSection.productSubtotalByName($$createProduct.name$$)}}" stepKey="assertProductPrice"/> |
| 55 | + <assertEquals stepKey="assertProductQtyInCart"> |
| 56 | + <expectedResult type="string">{{quoteQty11Subtotal1320.qty}}</expectedResult> |
| 57 | + <actualResult type="variable">grabProductQtyInCart</actualResult> |
| 58 | + </assertEquals> |
| 59 | + <see userInput="{{quoteQty11Subtotal1320.currency}}{{quoteQty11Subtotal1320.subtotal}}" selector="{{CheckoutCartSummarySection.subtotal}}" stepKey="assertSubtotal"/> |
| 60 | + |
| 61 | + <!-- Minicart product price and subtotal should be updated --> |
| 62 | + <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="openMinicart"/> |
| 63 | + <grabValueFrom selector="{{StorefrontMinicartSection.itemQuantity($$createProduct.name$$)}}" stepKey="grabProductQtyInMinicart"/> |
| 64 | + <assertEquals stepKey="assertProductQtyInMinicart"> |
| 65 | + <expectedResult type="string">{{quoteQty11Subtotal1320.qty}}</expectedResult> |
| 66 | + <actualResult type="variable">grabProductQtyInMinicart</actualResult> |
| 67 | + </assertEquals> |
| 68 | + <see userInput="{{quoteQty11Subtotal1320.currency}}{{quoteQty11Subtotal1320.subtotal}}" selector="{{StorefrontMinicartSection.subtotal}}" stepKey="assertMinicartSubtotal"/> |
| 69 | + </test> |
| 70 | +</tests> |
0 commit comments