Skip to content

Commit c5171d6

Browse files
authored
Merge pull request magento#106 from magento-pangolin/MC-4462
MC-4462
2 parents 0d03c80 + 4f54a32 commit c5171d6

9 files changed

+403
-6
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.z
6+
*/
7+
-->
8+
9+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="DeleteProductFromShoppingCartActionGroup">
12+
<arguments>
13+
<argument name="productName" type="string"/>
14+
</arguments>
15+
<click selector="{{CheckoutCartProductSection.removeProductByName(productName)}}" stepKey="deleteProductFromCheckoutCart"/>
16+
<waitForPageLoad stepKey="waitForPageLoad"/>
17+
<see userInput="You have no items in your shopping cart." stepKey="seeNoItemsInShoppingCart"/>
18+
</actionGroup>
19+
</actionGroups>

app/code/Magento/Checkout/Test/Mftf/Section/CheckoutCartProductSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
<element name="ProductPriceByOption" type="text" selector="//*[contains(@class, 'item-options')]/dd[normalize-space(.)='{{var1}}']/ancestor::tr//td[contains(@class, 'price')]//span[@class='price']" parameterized="true"/>
2828
<element name="RemoveItem" type="button"
2929
selector="//table[@id='shopping-cart-table']//tbody//tr[contains(@class,'item-actions')]//a[contains(@class,'action-delete')]"/>
30+
<element name="removeProductByName" selector="//*[contains(text(), '{{productName}}')]/ancestor::tbody//a[@class='action action-delete']" parameterized="true" timeout="30"/>
3031
<element name="productName" type="text" selector="//tbody[@class='cart item']//strong[@class='product-item-name']"/>
3132
<element name="nthItemOption" type="block" selector=".item:nth-of-type({{numElement}}) .item-options" parameterized="true"/>
3233
<element name="nthEditButton" type="block" selector=".item:nth-of-type({{numElement}}) .action-edit" parameterized="true"/>
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
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="DeleteBundleDynamicProductFromShoppingCartTest">
12+
<annotations>
13+
<features value="Checkout"/>
14+
<stories value="Delete Products from Shopping Cart"/>
15+
<title value="Delete bundle dynamic product from shopping cart test"/>
16+
<description value="Delete bundle dynamic product from shopping cart"/>
17+
<severity value="CRITICAL"/>
18+
<testCaseId value="MC-14689"/>
19+
<group value="checkout"/>
20+
<group value="mtf_migrated"/>
21+
</annotations>
22+
<before>
23+
<!-- Create category and simple product -->
24+
<createData entity="SimpleSubCategory" stepKey="createCategory"/>
25+
<createData entity="_defaultProduct" stepKey="createSimpleProduct">
26+
<requiredEntity createDataKey="createCategory"/>
27+
</createData>
28+
29+
<!-- Create bundle product -->
30+
<createData entity="ApiBundleProductPriceViewRange" stepKey="createBundleDynamicProduct">
31+
<requiredEntity createDataKey="createCategory"/>
32+
</createData>
33+
<createData entity="DropDownBundleOption" stepKey="bundleOption">
34+
<requiredEntity createDataKey="createBundleDynamicProduct"/>
35+
</createData>
36+
<createData entity="ApiBundleLink" stepKey="createNewBundleLink">
37+
<requiredEntity createDataKey="createBundleDynamicProduct"/>
38+
<requiredEntity createDataKey="bundleOption"/>
39+
<requiredEntity createDataKey="createSimpleProduct"/>
40+
</createData>
41+
<magentoCLI command="indexer:reindex" stepKey="reindex"/>
42+
</before>
43+
<after>
44+
<!-- Delete category -->
45+
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
46+
47+
<!-- Delete bundle product data -->
48+
<deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/>
49+
<deleteData createDataKey="createBundleDynamicProduct" stepKey="deleteBundleProduct"/>
50+
</after>
51+
52+
<!-- Go to bundle product page -->
53+
<amOnPage url="{{StorefrontProductPage.url($$createBundleDynamicProduct.custom_attributes[url_key]$$)}}" stepKey="navigateToProductPage"/>
54+
<waitForPageLoad stepKey="waitForPageLoad"/>
55+
56+
<!-- Add product to the cart -->
57+
<click selector="{{StorefrontBundleProductActionSection.customizeAndAddToCartButton}}" stepKey="clickCustomizeAndAddToCart"/>
58+
<actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProductToCart">
59+
<argument name="productName" value="$$createBundleDynamicProduct.name$$"/>
60+
</actionGroup>
61+
62+
<!-- Remove product from cart -->
63+
<amOnPage url="{{CheckoutCartPage.url}}" stepKey="goToCart"/>
64+
<waitForPageLoad stepKey="waitForCartPageLoad"/>
65+
<actionGroup ref="DeleteProductFromShoppingCartActionGroup" stepKey="deleteProduct">
66+
<argument name="productName" value="$$createBundleDynamicProduct.name$$"/>
67+
</actionGroup>
68+
</test>
69+
</tests>
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
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="DeleteBundleFixedProductFromShoppingCartTest">
12+
<annotations>
13+
<features value="Checkout"/>
14+
<stories value="Delete Products from Shopping Cart"/>
15+
<title value="Delete bundle fixed product from shopping cart test"/>
16+
<description value="Delete bundle fixed product from shopping cart"/>
17+
<severity value="CRITICAL"/>
18+
<testCaseId value="MC-14690"/>
19+
<group value="checkout"/>
20+
<group value="mtf_migrated"/>
21+
</annotations>
22+
<before>
23+
<!-- Create simple product -->
24+
<createData entity="SimpleProduct2" stepKey="createSimpleProduct"/>
25+
26+
<!-- Create bundle product -->
27+
<createData entity="ApiFixedBundleProduct" stepKey="createFixedBundleProduct"/>
28+
<createData entity="DropDownBundleOption" stepKey="createBundleOption">
29+
<requiredEntity createDataKey="createFixedBundleProduct"/>
30+
</createData>
31+
<createData entity="ApiBundleLink" stepKey="addLinkOptionToBundleProduct">
32+
<requiredEntity createDataKey="createFixedBundleProduct"/>
33+
<requiredEntity createDataKey="createBundleOption"/>
34+
<requiredEntity createDataKey="createSimpleProduct"/>
35+
</createData>
36+
<magentoCLI command="indexer:reindex" stepKey="reindex"/>
37+
</before>
38+
<after>
39+
<!-- Delete bundle product data -->
40+
<deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/>
41+
<deleteData createDataKey="createFixedBundleProduct" stepKey="deleteFixedBundleProduct"/>
42+
</after>
43+
44+
<!-- Go to bundle product page -->
45+
<amOnPage url="{{StorefrontProductPage.url($$createFixedBundleProduct.custom_attributes[url_key]$$)}}" stepKey="navigateToProductPage"/>
46+
<waitForPageLoad stepKey="waitForPageLoad"/>
47+
48+
<!-- Add product to the cart -->
49+
<click selector="{{StorefrontBundleProductActionSection.customizeAndAddToCartButton}}" stepKey="clickCustomizeAndAddToCart"/>
50+
<actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProductToCart">
51+
<argument name="productName" value="$$createFixedBundleProduct.name$$"/>
52+
</actionGroup>
53+
54+
<!-- Remove product from cart -->
55+
<amOnPage url="{{CheckoutCartPage.url}}" stepKey="goToCart"/>
56+
<waitForPageLoad stepKey="waitForCartPageLoad"/>
57+
<actionGroup ref="DeleteProductFromShoppingCartActionGroup" stepKey="deleteProduct">
58+
<argument name="productName" value="$$createFixedBundleProduct.name$$"/>
59+
</actionGroup>
60+
</test>
61+
</tests>
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
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="DeleteConfigurableProductFromShoppingCartTest">
12+
<annotations>
13+
<features value="Checkout"/>
14+
<stories value="Delete Products from Shopping Cart"/>
15+
<title value="Delete configurable product from shopping cart test"/>
16+
<description value="Delete configurable product from shopping cart"/>
17+
<severity value="CRITICAL"/>
18+
<testCaseId value="MC-14692"/>
19+
<group value="checkout"/>
20+
<group value="mtf_migrated"/>
21+
</annotations>
22+
<before>
23+
<!-- Create category -->
24+
<createData entity="_defaultCategory" stepKey="createCategory"/>
25+
26+
<!-- Create configurable product -->
27+
<createData entity="ApiConfigurableProduct" stepKey="createConfigProduct">
28+
<requiredEntity createDataKey="createCategory"/>
29+
</createData>
30+
<createData entity="productAttributeWithTwoOptions" stepKey="createConfigProductAttribute"/>
31+
<createData entity="productAttributeOption1" stepKey="createConfigProductAttributeOption">
32+
<requiredEntity createDataKey="createConfigProductAttribute"/>
33+
</createData>
34+
<createData entity="AddToDefaultSet" stepKey="createConfigAddToAttributeSet">
35+
<requiredEntity createDataKey="createConfigProductAttribute"/>
36+
</createData>
37+
<getData entity="ProductAttributeOptionGetter" index="1" stepKey="getConfigAttributeOption">
38+
<requiredEntity createDataKey="createConfigProductAttribute"/>
39+
</getData>
40+
<createData entity="ApiSimpleOne" stepKey="createConfigChildProduct">
41+
<requiredEntity createDataKey="createConfigProductAttribute"/>
42+
<requiredEntity createDataKey="getConfigAttributeOption"/>
43+
<requiredEntity createDataKey="createCategory"/>
44+
</createData>
45+
<createData entity="ConfigurableProductTwoOptions" stepKey="createConfigProductOption">
46+
<requiredEntity createDataKey="createConfigProduct"/>
47+
<requiredEntity createDataKey="createConfigProductAttribute"/>
48+
<requiredEntity createDataKey="getConfigAttributeOption"/>
49+
</createData>
50+
<createData entity="ConfigurableProductAddChild" stepKey="createConfigProductAddChild">
51+
<requiredEntity createDataKey="createConfigProduct"/>
52+
<requiredEntity createDataKey="createConfigChildProduct"/>
53+
</createData>
54+
</before>
55+
<after>
56+
<!-- Delete configurable product data -->
57+
<deleteData createDataKey="createConfigChildProduct" stepKey="deleteConfigChildProduct"/>
58+
<deleteData createDataKey="createConfigProduct" stepKey="deleteConfigProduct"/>
59+
<deleteData createDataKey="createConfigProductAttribute" stepKey="deleteConfigProductAttribute"/>
60+
61+
<!-- Delete category -->
62+
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
63+
</after>
64+
65+
<!-- Add configurable product to the cart -->
66+
<actionGroup ref="StorefrontAddConfigurableProductToTheCartActionGroup" stepKey="addConfigurableProductToCart">
67+
<argument name="urlKey" value="$$createConfigProduct.custom_attributes[url_key]$$" />
68+
<argument name="productAttribute" value="$$createConfigProductAttribute.default_value$$"/>
69+
<argument name="productOption" value="$$getConfigAttributeOption.value$$"/>
70+
<argument name="qty" value="1"/>
71+
</actionGroup>
72+
73+
<!-- Remove product from cart -->
74+
<amOnPage url="{{CheckoutCartPage.url}}" stepKey="goToCart"/>
75+
<waitForPageLoad stepKey="waitForCartPageLoad"/>
76+
<actionGroup ref="DeleteProductFromShoppingCartActionGroup" stepKey="deleteProduct">
77+
<argument name="productName" value="$$createConfigProduct.name$$"/>
78+
</actionGroup>
79+
</test>
80+
</tests>
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
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="DeleteDownloadableProductFromShoppingCartTest">
12+
<annotations>
13+
<features value="Checkout"/>
14+
<stories value="Delete Products from Shopping Cart"/>
15+
<title value="Delete downloadable product from shopping cart test"/>
16+
<description value="Delete downloadable product from shopping cart"/>
17+
<severity value="CRITICAL"/>
18+
<testCaseId value="MC-14693"/>
19+
<group value="checkout"/>
20+
<group value="mtf_migrated"/>
21+
</annotations>
22+
<before>
23+
<!-- Create downloadable product -->
24+
<createData entity="ApiDownloadableProduct" stepKey="createDownloadableProduct"/>
25+
<createData entity="ApiDownloadableLink" stepKey="addDownloadableLink">
26+
<requiredEntity createDataKey="createDownloadableProduct"/>
27+
</createData>
28+
<createData entity="ApiDownloadableLink" stepKey="addDownloadableLink1">
29+
<requiredEntity createDataKey="createDownloadableProduct"/>
30+
</createData>
31+
</before>
32+
<after>
33+
<!-- Delete downloadable product -->
34+
<deleteData createDataKey="createDownloadableProduct" stepKey="deleteDownloadableProduct"/>
35+
</after>
36+
37+
<!-- Add downloadable product to the cart -->
38+
<amOnPage url="{{StorefrontProductPage.url($$createDownloadableProduct.custom_attributes[url_key]$$)}}" stepKey="navigateToDownloadableProductPage"/>
39+
<waitForPageLoad stepKey="waitForDownloadableProductPageLoad"/>
40+
<actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addToCartDownloadableProductFromStorefrontProductPage">
41+
<argument name="productName" value="$$createDownloadableProduct.name$$"/>
42+
</actionGroup>
43+
44+
<!-- Remove product from cart -->
45+
<amOnPage url="{{CheckoutCartPage.url}}" stepKey="goToCart"/>
46+
<waitForPageLoad stepKey="waitForCartPageLoad"/>
47+
<actionGroup ref="DeleteProductFromShoppingCartActionGroup" stepKey="deleteProduct">
48+
<argument name="productName" value="$$createDownloadableProduct.name$$"/>
49+
</actionGroup>
50+
</test>
51+
</tests>
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
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="DeleteGroupedProductFromShoppingCartTest">
12+
<annotations>
13+
<features value="Checkout"/>
14+
<stories value="Delete Products from Shopping Cart"/>
15+
<title value="Delete grouped product from shopping cart test"/>
16+
<description value="Delete grouped product from shopping cart"/>
17+
<severity value="CRITICAL"/>
18+
<testCaseId value="MC-14694"/>
19+
<group value="checkout"/>
20+
<group value="mtf_migrated"/>
21+
</annotations>
22+
<before>
23+
<!-- Create grouped product with three simple products -->
24+
<createData entity="SimpleProduct2" stepKey="createFirstSimpleProduct"/>
25+
<createData entity="SimpleProduct2" stepKey="createSecondSimpleProduct"/>
26+
<createData entity="SimpleProduct2" stepKey="createThirdSimpleProduct"/>
27+
<createData entity="ApiGroupedProduct" stepKey="createGroupedProduct"/>
28+
<createData entity="OneSimpleProductLink" stepKey="addFirstProductToLink">
29+
<requiredEntity createDataKey="createGroupedProduct"/>
30+
<requiredEntity createDataKey="createFirstSimpleProduct"/>
31+
</createData>
32+
<updateData entity="OneMoreSimpleProductLink" createDataKey="addFirstProductToLink" stepKey="addSecondProductTwo">
33+
<requiredEntity createDataKey="createGroupedProduct"/>
34+
<requiredEntity createDataKey="createSecondSimpleProduct"/>
35+
</updateData>
36+
<updateData entity="OneMoreSimpleProductLink" createDataKey="addFirstProductToLink" stepKey="addThirdProductThree">
37+
<requiredEntity createDataKey="createGroupedProduct"/>
38+
<requiredEntity createDataKey="createThirdSimpleProduct"/>
39+
</updateData>
40+
</before>
41+
<after>
42+
<!-- Delete grouped product data -->
43+
<deleteData createDataKey="createFirstSimpleProduct" stepKey="deleteFirstProduct"/>
44+
<deleteData createDataKey="createSecondSimpleProduct" stepKey="deleteSecondProduct"/>
45+
<deleteData createDataKey="createThirdSimpleProduct" stepKey="deleteThirdProduct"/>
46+
<deleteData createDataKey="createGroupedProduct" stepKey="deleteGroupedProduct"/>
47+
</after>
48+
49+
<!-- Add grouped product to the cart -->
50+
<actionGroup ref="StorefrontAddThreeGroupedProductToTheCartActionGroup" stepKey="addGropedProductsToTheCart">
51+
<argument name="urlKey" value="$$createGroupedProduct.custom_attributes[url_key]$$"/>
52+
<argument name="product1" value="$$createFirstSimpleProduct.name$$"/>
53+
<argument name="product2" value="$$createSecondSimpleProduct.name$$"/>
54+
<argument name="product3" value="$$createThirdSimpleProduct.name$$"/>
55+
<argument name="qty1" value="1"/>
56+
<argument name="qty2" value="1"/>
57+
<argument name="qty3" value="1"/>
58+
</actionGroup>
59+
60+
<!-- Remove products from cart -->
61+
<amOnPage url="{{CheckoutCartPage.url}}" stepKey="goToCart"/>
62+
<waitForPageLoad stepKey="waitForCartPageLoad"/>
63+
<click selector="{{CheckoutCartProductSection.removeProductByName($$createFirstSimpleProduct.name$$)}}" stepKey="deleteFirstProductFromCheckoutCart"/>
64+
<click selector="{{CheckoutCartProductSection.removeProductByName($$createSecondSimpleProduct.name$$)}}" stepKey="deleteSecondProductFromCheckoutCart"/>
65+
<click selector="{{CheckoutCartProductSection.removeProductByName($$createThirdSimpleProduct.name$$)}}" stepKey="deleteThirdProductFromCheckoutCart"/>
66+
<waitForPageLoad stepKey="waitForPageLoad"/>
67+
<see userInput="You have no items in your shopping cart." stepKey="seeNoItemsInShoppingCart"/>
68+
</test>
69+
</tests>

0 commit comments

Comments
 (0)