|
| 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="StorefrontUpdateQtyInShoppingCartAfterUpdateInMinicartTest"> |
| 12 | + <annotations> |
| 13 | + <features value="Checkout"/> |
| 14 | + <stories value="Checkout via Guest Checkout"/> |
| 15 | + <title value="Check updating shopping cart while updating items from minicart"/> |
| 16 | + <description value="Check updating shopping cart while updating items from minicart"/> |
| 17 | + <severity value="AVERAGE"/> |
| 18 | + <testCaseId value="MC-13626"/> |
| 19 | + <group value="checkout"/> |
| 20 | + </annotations> |
| 21 | + <before> |
| 22 | + <!--Create category--> |
| 23 | + <createData entity="SimpleSubCategory" stepKey="createCategory"/> |
| 24 | + <!--Create product--> |
| 25 | + <createData entity="SimpleProduct" stepKey="createProduct"> |
| 26 | + <requiredEntity createDataKey="createCategory"/> |
| 27 | + </createData> |
| 28 | + </before> |
| 29 | + <after> |
| 30 | + <!--Delete product--> |
| 31 | + <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> |
| 32 | + <!--Delete category--> |
| 33 | + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> |
| 34 | + </after> |
| 35 | + |
| 36 | + <!--Open Product Page--> |
| 37 | + <amOnPage url="{{StorefrontProductPage.url($$createProduct.name$$)}}" stepKey="openProductPage"/> |
| 38 | + <!--Add product to cart--> |
| 39 | + <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProductToCart"> |
| 40 | + <argument name="productName" value="$$createProduct.name$$"/> |
| 41 | + </actionGroup> |
| 42 | + |
| 43 | + <!--Go to Shopping cart--> |
| 44 | + <actionGroup ref="StorefrontOpenCartFromMinicartActionGroup" stepKey="openShoppingCart"/> |
| 45 | + <!--Check quantity in Shopping cart--> |
| 46 | + <grabValueFrom selector="{{CheckoutCartProductSection.productQuantityByName($$createProduct.name$$)}}" stepKey="grabQtyFromShoppingCart"/> |
| 47 | + <assertEquals expected="1" actual="$grabQtyFromShoppingCart" stepKey="assertQtyInShoppingCart"/> |
| 48 | + |
| 49 | + <!--Open minicart--> |
| 50 | + <click selector="{{StorefrontMinicartSection.showCart}}" stepKey="openMiniCart"/> |
| 51 | + <waitForElementVisible selector="{{StorefrontMinicartSection.itemQuantity($$createProduct.name$$)}}" stepKey="waitForItemQuantity"/> |
| 52 | + <pressKey selector="{{StorefrontMinicartSection.itemQuantity($$createProduct.name$$)}}" parameterArray="[\Facebook\WebDriver\WebDriverKeys::BACKSPACE]" stepKey="clearQtyField"/> |
| 53 | + <fillField selector="{{StorefrontMinicartSection.itemQuantity($$createProduct.name$$)}}" userInput="5" stepKey="fillQtyField"/> |
| 54 | + <waitForElementVisible selector="{{StorefrontMinicartSection.itemQuantityUpdate($$createProduct.name$$)}}" stepKey="waitForUpdateButton"/> |
| 55 | + <click selector="{{StorefrontMinicartSection.itemQuantityUpdate($$createProduct.name$$)}}" stepKey="clickUpdateButton"/> |
| 56 | + <waitForAjaxLoad stepKey="waitForAjaxLoad"/> |
| 57 | + <!--Check quantity in shopping cart after updating--> |
| 58 | + <grabValueFrom selector="{{CheckoutCartProductSection.productQuantityByName($$createProduct.name$$)}}" stepKey="grabQtyFromShoppingCart1"/> |
| 59 | + <assertEquals expected="5" actual="$grabQtyFromShoppingCart1" stepKey="assertQtyInShoppingCart1"/> |
| 60 | + </test> |
| 61 | +</tests> |
0 commit comments