Skip to content

Commit 1ee5d38

Browse files
committed
632: Convert UpdateProductFromMiniShoppingCartEntityTest to MFTF
1 parent e51df41 commit 1ee5d38

File tree

5 files changed

+104
-1
lines changed

5 files changed

+104
-1
lines changed

app/code/Magento/Catalog/Test/Mftf/Data/ProductData.xml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -869,4 +869,20 @@
869869
<requiredEntity type="product_extension_attribute">EavStockItem</requiredEntity>
870870
<requiredEntity type="custom_attribute_array">CustomAttributeCategoryIds</requiredEntity>
871871
</entity>
872+
<entity name="simpleProductWithoutCategory" type="product">
873+
<data key="sku" unique="suffix">sku_simple_product_</data>
874+
<data key="type_id">simple</data>
875+
<data key="attribute_set_id">4</data>
876+
<data key="visibility">4</data>
877+
<data key="name" unique="suffix">SimpleProduct</data>
878+
<data key="price">560</data>
879+
<data key="urlKey" unique="suffix">simple-product-</data>
880+
<data key="status">1</data>
881+
<data key="quantity">25</data>
882+
<data key="weight">1</data>
883+
<data key="product_has_weight">1</data>
884+
<data key="is_in_stock">1</data>
885+
<data key="tax_class_id">2</data>
886+
<requiredEntity type="product_extension_attribute">EavStockItem</requiredEntity>
887+
</entity>
872888
</entities>
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
10+
<actionGroup name="ShoppingCartCheckSummaryTotalActionGroup">
11+
<arguments>
12+
<argument name="dataQuote" type="entity"/>
13+
</arguments>
14+
<waitForPageLoad stepKey="waitForPageLoad" time="120"/>
15+
<grabTextFrom selector="{{CheckoutCartSummarySection.total}}" stepKey="grabCartTotal" />
16+
<assertContains stepKey="assertCartTotal">
17+
<actualResult type="variable">$grabCartTotal</actualResult>
18+
<expectedResult type="string">{{dataQuote.total}}</expectedResult>
19+
</assertContains>
20+
</actionGroup>
21+
</actionGroups>

app/code/Magento/Checkout/Test/Mftf/Data/QuoteData.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,12 @@
1515
<data key="total">495.00</data>
1616
<data key="shippingMethod">Flat Rate - Fixed</data>
1717
</entity>
18+
<entity name="simpleOrderQty2" type="Quote">
19+
<data key="price">560.00</data>
20+
<data key="qty">2</data>
21+
<data key="subtotal">1,120.00</data>
22+
<data key="shipping">10.00</data>
23+
<data key="total">1,130.00</data>
24+
<data key="shippingMethod">Flat Rate - Fixed</data>
25+
</entity>
1826
</entities>
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
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="UpdateProductFromMiniShoppingCartEntityTest">
12+
<annotations>
13+
<stories value="Shopping Cart"/>
14+
<title value="Check updating product from mini shopping cart"/>
15+
<description value="Update Product Qty on Mini Shopping Cart"/>
16+
<severity value="MAJOR"/>
17+
<testCaseId value="MAGETWO-29812"/>
18+
<group value="shoppingCart"/>
19+
<group value="mtf_migrated"/>
20+
</annotations>
21+
22+
<before>
23+
<!--Create product according to dataset.-->
24+
<createData entity="simpleProductWithoutCategory" stepKey="createProduct"/>
25+
26+
<!-- Go to frontend -->
27+
<amOnPage url="{{StorefrontProductPage.url($$createProduct.name$$)}}" stepKey="navigateToProductPage"/>
28+
29+
<!--Add product to cart-->
30+
<actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addToCartFromStorefrontProductPage">
31+
<argument name="productName" value="$$createProduct.name$$"/>
32+
</actionGroup>
33+
</before>
34+
35+
<after>
36+
<!--Delete created data-->
37+
<deleteData createDataKey="createProduct" stepKey="deleteProduct" />
38+
</after>
39+
40+
<!-- Click on mini shopping cart icon -->
41+
<click selector="{{StorefrontMinicartSection.showCart}}" stepKey="goToMiniShoppingCart"/>
42+
43+
<!-- Click Edit -->
44+
<click selector="{{StorefrontMinicartSection.viewAndEditCart}}" stepKey="editMiniCartItem"/>
45+
46+
<!-- Fill data from dataset -->
47+
<clearField selector="{{CheckoutCartProductSection.ProductQuantityByName($$createProduct.name$$)}}" stepKey="deleteFiled"/>
48+
<fillField selector="{{CheckoutCartProductSection.ProductQuantityByName($$createProduct.name$$)}}" userInput="{{simpleOrderQty2.qty}}" stepKey="changeQty"/>
49+
50+
<!-- Click Update -->
51+
<click selector="{{CheckoutCartProductSection.updateShoppingCartButton}}" stepKey="updateQty"/>
52+
53+
<!-- Perform all assertions -->
54+
<actionGroup ref="ShoppingCartCheckSummaryTotalActionGroup" stepKey="checkSummary">
55+
<argument name="dataQuote" value="simpleOrderQty2"/>
56+
</actionGroup>
57+
</test>
58+
</tests>

dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/UpdateProductFromMiniShoppingCartEntityTest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<testCase name="Magento\Checkout\Test\TestCase\UpdateProductFromMiniShoppingCartEntityTest" summary="Update Product from Mini Shopping Cart" ticketId="MAGETWO-29812">
1010
<variation name="UpdateProductFromMiniShoppingCartEntityTestVariation1" summary="Update Product Qty on Mini Shopping Cart" ticketId=" MAGETWO-35536">
1111
<data name="issue" xsi:type="string">https://github.com/magento-engcom/msi/issues/1624</data>
12-
<data name="tag" xsi:type="string">test_type:extended_acceptance_test, severity:S0</data>
12+
<data name="tag" xsi:type="string">test_type:extended_acceptance_test, severity:S0, mftf_migrated:yes</data>
1313
<data name="originalProduct/0" xsi:type="string">catalogProductSimple::default</data>
1414
<data name="checkoutData/dataset" xsi:type="string">simple_order_qty_2</data>
1515
<data name="use_minicart_to_edit_qty" xsi:type="boolean">true</data>

0 commit comments

Comments
 (0)