Skip to content

Commit abda912

Browse files
merge magento/2.3-develop into magento-thunder/MAGETWO-98151
2 parents 1cb451a + 06269b7 commit abda912

File tree

15 files changed

+502
-187
lines changed

15 files changed

+502
-187
lines changed

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -428,6 +428,11 @@
428428
<var key="sku" entityType="product" entityKey="sku" />
429429
<requiredEntity type="product_option">ProductOptionDropDownWithLongValuesTitle</requiredEntity>
430430
</entity>
431+
<entity name="ProductWithTextFieldAndAreaOptions" type="product">
432+
<var key="sku" entityType="product" entityKey="sku" />
433+
<requiredEntity type="product_option">ProductOptionField</requiredEntity>
434+
<requiredEntity type="product_option">ProductOptionArea</requiredEntity>
435+
</entity>
431436
<entity name="ApiVirtualProductWithDescription" type="product">
432437
<data key="sku" unique="suffix">api-virtual-product</data>
433438
<data key="type_id">virtual</data>

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

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,17 @@
2424
<data key="shippingMethod">Flat Rate - Fixed</data>
2525
<data key="currency">$</data>
2626
</entity>
27+
<entity name="quoteQty3Price123" type="Quote">
28+
<data key="price">123.00</data>
29+
<data key="qty">3</data>
30+
<data key="subtotal">369.00</data>
31+
<data key="currency">$</data>
32+
</entity>
33+
<entity name="quoteQty11Subtotal1320" type="Quote">
34+
<data key="price">100.00</data>
35+
<data key="customOptionsPrice">20</data>
36+
<data key="qty">11</data>
37+
<data key="subtotal">1,320.00</data>
38+
<data key="currency">$</data>
39+
</entity>
2740
</entities>
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
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="StorefrontUpdateShoppingCartSimpleProductQtyTest">
12+
<annotations>
13+
<features value="Checkout"/>
14+
<title value="Check updating shopping cart while updating items qty"/>
15+
<description value="Check updating shopping cart while updating items qty"/>
16+
<testCaseId value="MC-14731" />
17+
<group value="shoppingCart"/>
18+
<group value="mtf_migrated"/>
19+
</annotations>
20+
<before>
21+
<createData entity="_defaultCategory" stepKey="createCategory"/>
22+
<createData entity="SimpleProduct" stepKey="createProduct">
23+
<requiredEntity createDataKey="createCategory"/>
24+
</createData>
25+
26+
<!-- Add the newly created product to the shopping cart -->
27+
<actionGroup ref="AddSimpleProductToCart" stepKey="addToCartFromStorefrontProductPage">
28+
<argument name="product" value="$$createProduct$$"/>
29+
</actionGroup>
30+
</before>
31+
<after>
32+
<deleteData createDataKey="createProduct" stepKey="deleteProduct"/>
33+
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
34+
</after>
35+
36+
<!-- Go to the shopping cart -->
37+
<amOnPage url="{{CheckoutCartPage.url}}" stepKey="amOnPageShoppingCart"/>
38+
<waitForPageLoad stepKey="waitForCheckoutPageLoad1"/>
39+
40+
<!-- Change the product QTY -->
41+
<fillField selector="{{CheckoutCartProductSection.ProductQuantityByName($$createProduct.name$$)}}" userInput="{{quoteQty3Price123.qty}}" stepKey="changeCartQty"/>
42+
<click selector="{{CheckoutCartProductSection.updateShoppingCartButton}}" stepKey="openShoppingCart"/>
43+
<waitForPageLoad stepKey="waitForCheckoutPageLoad2"/>
44+
45+
<!-- The price and QTY values should be updated for the product -->
46+
<grabValueFrom selector="{{CheckoutCartProductSection.ProductQuantityByName($$createProduct.name$$)}}" stepKey="grabProductQtyInCart"/>
47+
<see userInput="{{quoteQty3Price123.currency}}{{quoteQty3Price123.subtotal}}" selector="{{CheckoutCartProductSection.productSubtotalByName($$createProduct.name$$)}}" stepKey="assertProductPrice"/>
48+
<assertEquals stepKey="assertProductQtyInCart">
49+
<actualResult type="variable">grabProductQtyInCart</actualResult>
50+
<expectedResult type="string">{{quoteQty3Price123.qty}}</expectedResult>
51+
</assertEquals>
52+
53+
<!-- Subtotal should be updated -->
54+
<see userInput="{{quoteQty3Price123.currency}}{{quoteQty3Price123.subtotal}}" selector="{{CheckoutCartSummarySection.subtotal}}" stepKey="assertCartSubtotal"/>
55+
56+
<!-- Minicart product price and subtotal should be updated -->
57+
<actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="openMinicart"/>
58+
<grabValueFrom selector="{{StorefrontMinicartSection.itemQuantity($$createProduct.name$$)}}" stepKey="grabProductQtyInMinicart"/>
59+
<assertEquals stepKey="assertProductQtyInMinicart">
60+
<actualResult type="variable">grabProductQtyInMinicart</actualResult>
61+
<expectedResult type="string">{{quoteQty3Price123.qty}}</expectedResult>
62+
</assertEquals>
63+
<see userInput="{{quoteQty3Price123.currency}}{{quoteQty3Price123.subtotal}}" selector="{{StorefrontMinicartSection.subtotal}}" stepKey="assertMinicartSubtotal"/>
64+
</test>
65+
</tests>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
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

Comments
 (0)