Skip to content

Commit 667a8dd

Browse files
authored
Merge pull request #110 from magento-pangolin/MC-4466
2 parents 90e46d4 + 2fa4514 commit 667a8dd

6 files changed

+700
-0
lines changed
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
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+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
10+
<test name="StorefrontDeleteBundleProductFromMiniShoppingCartTest">
11+
<annotations>
12+
<stories value="DeleteBundleProduct"/>
13+
<title value="Storefront Delete Bundle Product From Mini Shopping Cart Test"/>
14+
<description value="Test log in to Shopping Cart and Delete Bundle Product From Mini Shopping Cart Test"/>
15+
<testCaseId value="MC-14682"/>
16+
<severity value="CRITICAL"/>
17+
<group value="Shopping Cart"/>
18+
<group value="mtf_migrated"/>
19+
</annotations>
20+
21+
<before>
22+
<actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/>
23+
<createData entity="FlatRateShippingMethodDefault" stepKey="setDefaultFlatRateShippingMethod"/>
24+
<createData entity="SimpleSubCategory" stepKey="createSubCategory"/>
25+
<!--Create simple product-->
26+
<createData entity="SimpleProduct2" stepKey="simpleProduct1">
27+
<field key="price">10.00</field>
28+
</createData>
29+
<!--Create Bundle product-->
30+
<createData entity="BundleProductPriceViewRange" stepKey="createBundleProduct">
31+
<requiredEntity createDataKey="createSubCategory"/>
32+
</createData>
33+
<createData entity="DropDownBundleOption" stepKey="createBundleOption1_1">
34+
<requiredEntity createDataKey="createBundleProduct"/>
35+
<field key="required">True</field>
36+
</createData>
37+
<createData entity="ApiBundleLink" stepKey="linkOptionToProduct">
38+
<requiredEntity createDataKey="createBundleProduct"/>
39+
<requiredEntity createDataKey="createBundleOption1_1"/>
40+
<requiredEntity createDataKey="simpleProduct1"/>
41+
</createData>
42+
<magentoCLI command="indexer:reindex" stepKey="reindex"/>
43+
</before>
44+
<after>
45+
<deleteData createDataKey="simpleProduct1" stepKey="deleteProduct1"/>
46+
<deleteData createDataKey="createBundleProduct" stepKey="deleteBundleProduct"/>
47+
<deleteData createDataKey="createSubCategory" stepKey="deleteCategory"/>
48+
<actionGroup ref="logout" stepKey="logout"/>
49+
</after>
50+
51+
<!--Open Product page in StoreFront -->
52+
<actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProductPageAndVerifyProduct">
53+
<argument name="product" value="$$createBundleProduct$$"/>
54+
</actionGroup>
55+
56+
<!-- Click on customize And Add To Cart Button -->
57+
<actionGroup ref="StorefrontSelectCustomizeAndAddToTheCartButtonActionGroup" stepKey="clickOnCustomizeAndAddtoCartButton"/>
58+
59+
<!-- Select Product Quantity and add to the cart -->
60+
<actionGroup ref="StorefrontEnterProductQuantityAndAddToTheCartActionGroup" stepKey="enterProductQuantityAndAddToTheCart">
61+
<argument name="quantity" value="1"/>
62+
</actionGroup>
63+
<scrollToTopOfPage stepKey="scrollToTop"/>
64+
<waitForPageLoad stepKey="waitForMiniCartPanelToAppear"/>
65+
66+
<!-- Assert Product in Mini Cart -->
67+
<click selector="{{StorefrontMinicartSection.showCart}}" stepKey="clickOnMiniCart"/>
68+
<waitForPageLoad stepKey="waitForPageToLoad1"/>
69+
<actionGroup ref="AssertStorefrontMiniCartItemsActionGroup" stepKey="assertSimpleProduct3MiniCart">
70+
<argument name="productName" value="$$createBundleProduct.name$$"/>
71+
<argument name="productPrice" value="$10.00"/>
72+
<argument name="cartSubtotal" value="$10.00" />
73+
<argument name="qty" value="1"/>
74+
</actionGroup>
75+
76+
<!-- Select Mini Cart and select 'View And Edit Cart' -->
77+
<actionGroup ref="assertOneProductNameInMiniCart" stepKey="seeProductInMiniCart">
78+
<argument name="productName" value="$$createBundleProduct.name$$"/>
79+
</actionGroup>
80+
81+
<!--Remove an item from the cart using minicart-->
82+
<actionGroup ref="removeProductFromMiniCart" stepKey="removeProductFromMiniCart">
83+
<argument name="productName" value="$$createBundleProduct.name$$"/>
84+
</actionGroup>
85+
<reloadPage stepKey="reloadPage"/>
86+
87+
<!--Check the minicart is empty and verify AssertProductAbsentInMiniShoppingCart-->
88+
<actionGroup ref="assertMiniCartEmpty" stepKey="miniCartEnpty"/>
89+
<dontSee selector="{{StorefrontMinicartSection.productLinkByName($$createBundleProduct.name$$)}}" stepKey="verifyAssertProductAbsentInMiniShoppingCart"/>
90+
</test>
91+
</tests>
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
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+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
10+
<test name="StorefrontDeleteConfigurableProductFromMiniShoppingCartTest">
11+
<annotations>
12+
<stories value="DeleteConfigurableProduct"/>
13+
<title value="Storefront Delete Configurable Product From Mini Shopping Cart Test"/>
14+
<description value="Test log in to Shopping Cart and Delete Configurable Product From Mini Shopping Cart Test"/>
15+
<testCaseId value="MC-14681"/>
16+
<severity value="CRITICAL"/>
17+
<group value="Shopping Cart"/>
18+
<group value="mtf_migrated"/>
19+
</annotations>
20+
21+
<before>
22+
<actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/>
23+
<!-- Create Default Category -->
24+
<createData entity="_defaultCategory" stepKey="createCategory"/>
25+
26+
<!-- Create an attribute with three options to be used in the first child product -->
27+
<createData entity="productAttributeWithTwoOptions" stepKey="createConfigProductAttribute"/>
28+
<createData entity="productAttributeOption1" stepKey="createConfigProductAttributeOption1">
29+
<requiredEntity createDataKey="createConfigProductAttribute"/>
30+
</createData>
31+
32+
<!-- Add the attribute just created to default attribute set -->
33+
<createData entity="AddToDefaultSet" stepKey="createConfigAddToAttributeSet">
34+
<requiredEntity createDataKey="createConfigProductAttribute"/>
35+
</createData>
36+
37+
<!-- Get the first option of the attribute created -->
38+
<getData entity="ProductAttributeOptionGetter" index="1" stepKey="getConfigAttributeOption1">
39+
<requiredEntity createDataKey="createConfigProductAttribute"/>
40+
</getData>
41+
42+
<!-- Create Configurable product -->
43+
<createData entity="BaseConfigurableProduct" stepKey="createConfigProduct">
44+
<requiredEntity createDataKey="createCategory"/>
45+
</createData>
46+
47+
<!-- Create a simple product and give it the attribute with the first option -->
48+
<createData entity="ApiSimpleOne" stepKey="createConfigChildProduct1">
49+
<requiredEntity createDataKey="createConfigProductAttribute"/>
50+
<requiredEntity createDataKey="getConfigAttributeOption1"/>
51+
<field key="price">10.00</field>
52+
</createData>
53+
54+
<!-- Create the configurable product -->
55+
<createData entity="ConfigurableProductThreeOptions" stepKey="createConfigProductOption">
56+
<requiredEntity createDataKey="createConfigProduct"/>
57+
<requiredEntity createDataKey="createConfigProductAttribute"/>
58+
<requiredEntity createDataKey="getConfigAttributeOption1"/>
59+
</createData>
60+
61+
<!-- Add the first simple product to the configurable product -->
62+
<createData entity="ConfigurableProductAddChild" stepKey="createConfigProductAddChild1">
63+
<requiredEntity createDataKey="createConfigProduct"/>
64+
<requiredEntity createDataKey="createConfigChildProduct1"/>
65+
</createData>
66+
<magentoCLI command="indexer:reindex" stepKey="reindex"/>
67+
<magentoCLI command="cache:flush" stepKey="flushCache"/>
68+
</before>
69+
<after>
70+
<deleteData createDataKey="createConfigChildProduct1" stepKey="deleteSimpleProduct1"/>
71+
<deleteData createDataKey="createConfigProduct" stepKey="deleteProduct"/>
72+
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
73+
<deleteData createDataKey="createConfigProductAttribute" stepKey="deleteProductAttribute"/>
74+
<actionGroup ref="logout" stepKey="logout"/>
75+
</after>
76+
77+
<!-- Add Configurable Product to the cart -->
78+
<actionGroup ref="StorefrontAddConfigurableProductToTheCartActionGroup" stepKey="addConfigurableProductToCart">
79+
<argument name="urlKey" value="$$createConfigProduct.custom_attributes[url_key]$$" />
80+
<argument name="productAttribute" value="$$createConfigProductAttribute.default_value$$"/>
81+
<argument name="productOption" value="$$getConfigAttributeOption1.label$$"/>
82+
<argument name="qty" value="1"/>
83+
</actionGroup>
84+
85+
<!-- Select Mini Cart and select 'View And Edit Cart' -->
86+
<actionGroup ref="assertOneProductNameInMiniCart" stepKey="seeProductInMiniCart">
87+
<argument name="productName" value="$$createConfigProduct.name$$"/>
88+
</actionGroup>
89+
90+
<!--Remove an item from the cart using minicart-->
91+
<actionGroup ref="removeProductFromMiniCart" stepKey="removeProductFromMiniCart">
92+
<argument name="productName" value="$$createConfigProduct.name$$"/>
93+
</actionGroup>
94+
<reloadPage stepKey="reloadPage"/>
95+
96+
<!--Check the minicart is empty and verify AssertProductAbsentInMiniShoppingCart-->
97+
<actionGroup ref="assertMiniCartEmpty" stepKey="miniCartEnpty"/>
98+
<dontSee selector="{{StorefrontMinicartSection.productLinkByName($$createConfigProduct.name$$)}}" stepKey="verifyAssertProductAbsentInMiniShoppingCart"/>
99+
</test>
100+
</tests>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
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+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
10+
<test name="StorefrontDeleteDownloadableProductFromMiniShoppingCartTest">
11+
<annotations>
12+
<stories value="DeleteConfigurableProduct"/>
13+
<title value="Storefront Delete Downloadable Product From Mini Shopping Cart Test"/>
14+
<description value="Test log in to Shopping Cart and Delete Downloadable Product From Mini Shopping Cart Test"/>
15+
<testCaseId value="MC-14683"/>
16+
<severity value="CRITICAL"/>
17+
<group value="Shopping Cart"/>
18+
<group value="mtf_migrated"/>
19+
</annotations>
20+
21+
<before>
22+
<actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/>
23+
<createData entity="FlatRateShippingMethodDefault" stepKey="setDefaultFlatRateShippingMethod"/>
24+
<createData entity="ApiDownloadableProduct" stepKey="createDownloadableProduct"/>
25+
<createData entity="downloadableLink1" stepKey="addDownloadableLink1">
26+
<requiredEntity createDataKey="createDownloadableProduct"/>
27+
</createData>
28+
<magentoCLI command="indexer:reindex" stepKey="reindex"/>
29+
<magentoCLI command="cache:flush" stepKey="flushCache"/>
30+
</before>
31+
<after>
32+
<deleteData createDataKey="createDownloadableProduct" stepKey="deleteProduct"/>
33+
<actionGroup ref="logout" stepKey="logout"/>
34+
</after>
35+
36+
<!-- Open Downloadable Product page -->
37+
<amOnPage url="{{StorefrontProductPage.url($$createDownloadableProduct.custom_attributes[url_key]$$)}}" stepKey="OpenStoreFrontProductPage"/>
38+
<waitForPageLoad stepKey="waitForPageToLoad"/>
39+
40+
<!-- Add Downloadable product to the cart -->
41+
<actionGroup ref="StorefrontAddToCartCustomOptionsProductPageActionGroup" stepKey="addToTheCart">
42+
<argument name="productName" value="$$createDownloadableProduct.name$$" />
43+
</actionGroup>
44+
45+
<!-- Select Mini Cart and select 'View And Edit Cart' -->
46+
<actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="selectViewAndEditCart"/>
47+
48+
<!-- Assert product details in Mini Cart -->
49+
<click selector="{{StorefrontMinicartSection.showCart}}" stepKey="clickOnMiniCart"/>
50+
<waitForPageLoad stepKey="waitForPageToLoad1"/>
51+
<actionGroup ref="AssertStorefrontMiniCartItemsActionGroup" stepKey="assertMiniCart">
52+
<argument name="productName" value="$$createDownloadableProduct.name$$"/>
53+
<argument name="productPrice" value="$123.00"/>
54+
<argument name="cartSubtotal" value="123.00" />
55+
<argument name="qty" value="1"/>
56+
</actionGroup>
57+
58+
<!-- Select Mini Cart and select 'View And Edit Cart' -->
59+
<actionGroup ref="assertOneProductNameInMiniCart" stepKey="seeProductInMiniCart">
60+
<argument name="productName" value="$$createDownloadableProduct.name$$"/>
61+
</actionGroup>
62+
63+
<!--Remove an item from the cart using minicart-->
64+
<actionGroup ref="removeProductFromMiniCart" stepKey="removeProductFromMiniCart">
65+
<argument name="productName" value="$$createDownloadableProduct.name$$"/>
66+
</actionGroup>
67+
<reloadPage stepKey="reloadPage"/>
68+
69+
<!--Check the minicart is empty and verify AssertProductAbsentInMiniShoppingCart-->
70+
<actionGroup ref="assertMiniCartEmpty" stepKey="miniCartEnpty"/>
71+
<dontSee selector="{{StorefrontMinicartSection.productLinkByName($$createDownloadableProduct.name$$)}}" stepKey="verifyAssertProductAbsentInMiniShoppingCart"/>
72+
</test>
73+
</tests>

0 commit comments

Comments
 (0)