Skip to content

Commit c5ebdf1

Browse files
authored
Merge pull request magento#189 from magento-pangolin/MC-224
MC-224
2 parents af4cf5e + 15a9093 commit c5ebdf1

File tree

1 file changed

+145
-0
lines changed

1 file changed

+145
-0
lines changed
Lines changed: 145 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
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="AdminCreateAndEditBundleProductSettingsTest">
12+
<annotations>
13+
<features value="Bundle"/>
14+
<stories value="Create/Edit bundle product in Admin"/>
15+
<title value="Admin should be able to set/edit other product information when creating/editing a bundle product"/>
16+
<description value="Admin should be able to set/edit other product information when creating/editing a bundle product"/>
17+
<severity value="CRITICAL"/>
18+
<testCaseId value="MC-224"/>
19+
<group value="Catalog"/>
20+
</annotations>
21+
<before>
22+
<!-- Create a Website -->
23+
<createData entity="customWebsite" stepKey="createWebsite"/>
24+
25+
<!-- Create a simple product for a bundle option -->
26+
<createData entity="SimpleProduct2" stepKey="createSimpleProduct"/>
27+
28+
<!-- Login as admin -->
29+
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
30+
</before>
31+
<after>
32+
<!-- Delete the simple product -->
33+
<deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/>
34+
35+
<!-- Log out -->
36+
<actionGroup ref="logout" stepKey="logout"/>
37+
</after>
38+
39+
<!-- Create new bundle product -->
40+
<actionGroup ref="GoToSpecifiedCreateProductPage" stepKey="createBundleProduct">
41+
<argument name="productType" value="bundle"/>
42+
</actionGroup>
43+
44+
<!-- Fill all main fields -->
45+
<actionGroup ref="fillMainBundleProductForm" stepKey="fillMainProductFields"/>
46+
47+
<!-- Add the bundle option to the product -->
48+
<actionGroup ref="addBundleOptionWithOneProduct" stepKey="addBundleOption">
49+
<argument name="x" value="0"/>
50+
<argument name="n" value="1"/>
51+
<argument name="prodOneSku" value="$$createSimpleProduct.sku$$"/>
52+
<argument name="prodTwoSku" value=""/>
53+
<argument name="optionTitle" value="{{RadioButtonsOption.title}}"/>
54+
<argument name="inputType" value="{{RadioButtonsOption.type}}"/>
55+
</actionGroup>
56+
57+
<!-- Set product in created Website -->
58+
<actionGroup ref="AdminAssignProductInWebsiteActionGroup" stepKey="selectProductInWebsites">
59+
<argument name="website" value="$createWebsite.website[name]$"/>
60+
</actionGroup>
61+
62+
<!-- Set Design settings for the product -->
63+
<actionGroup ref="AdminSetProductDesignSettingsActionGroup" stepKey="setProductDesignSettings">
64+
<argument name="designSettings" value="simpleLumaDesignThreeColumns"/>
65+
</actionGroup>
66+
67+
<!-- Set Gift Options settings for the product -->
68+
<actionGroup ref="AdminSwitchProductGiftMessageStatusActionGroup" stepKey="enableGiftMessageSettings">
69+
<argument name="status" value="1"/>
70+
</actionGroup>
71+
72+
<!-- Save product form -->
73+
<actionGroup ref="saveProductForm" stepKey="clickSaveButton"/>
74+
75+
<!-- Open product page -->
76+
<actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openStorefrontProductPage">
77+
<argument name="productUrl" value="{{BundleProduct.name}}"/>
78+
</actionGroup>
79+
80+
<!-- Assert product Design settings "layout 3 columns" -->
81+
<seeElement selector="{{StorefrontProductPageDesignSection.layoutThreeColumns}}" stepKey="seeDesignChanges"/>
82+
83+
<!-- Assert Gift Option product settings is present -->
84+
<actionGroup ref="StorefrontAddBundleProductFromProductToCartActionGroup" stepKey="addProductToCart">
85+
<argument name="productName" value="{{BundleProduct.name}}"/>
86+
</actionGroup>
87+
<actionGroup ref="StorefrontOpenCartFromMinicartActionGroup" stepKey="openShoppingCart"/>
88+
<actionGroup ref="StorefrontAssertGiftMessageFieldsActionGroup" stepKey="assertGiftMessageFieldsArePresent"/>
89+
90+
<!-- Open created product -->
91+
<actionGroup ref="SearchForProductOnBackendActionGroup" stepKey="searchForSimpleProduct">
92+
<argument name="product" value="BundleProduct"/>
93+
</actionGroup>
94+
<actionGroup ref="OpenEditProductOnBackendActionGroup" stepKey="openEditProduct">
95+
<argument name="product" value="BundleProduct"/>
96+
</actionGroup>
97+
98+
<!-- Assert product in assigned to Website -->
99+
<actionGroup ref="AssertProductIsAssignedToWebsite" stepKey="seeCustomWebsiteIsChecked">
100+
<argument name="website" value="$createWebsite.website[name]$"/>
101+
</actionGroup>
102+
103+
<!-- Edit product in Websites -->
104+
<actionGroup ref="AdminUnassignProductInWebsiteActionGroup" stepKey="uncheckProductInWebsites">
105+
<argument name="website" value="$createWebsite.website[name]$"/>
106+
</actionGroup>
107+
108+
<!-- Edit product Search Engine Optimization settings -->
109+
<actionGroup ref="AdminChangeProductSEOSettingsActionGroup" stepKey="editProductSEOSettings">
110+
<argument name="productName" value="ApiBundleProduct.name"/>
111+
</actionGroup>
112+
113+
<!-- Edit Design settings for the product -->
114+
<actionGroup ref="AdminSetProductDesignSettingsActionGroup" stepKey="editProductDesignSettings"/>
115+
116+
<!-- Edit Gift Option product settings -->
117+
<actionGroup ref="AdminSwitchProductGiftMessageStatusActionGroup" stepKey="disableGiftMessageSettings"/>
118+
119+
<!-- Save product form -->
120+
<actionGroup ref="saveProductForm" stepKey="clickSaveProduct"/>
121+
122+
<!-- Verify Url Key after changing -->
123+
<actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openProductPage">
124+
<argument name="productUrl" value="{{ApiBundleProduct.name}}"/>
125+
</actionGroup>
126+
127+
<!-- Assert product design settings "Layout empty" -->
128+
<seeElement selector="{{StorefrontProductPageDesignSection.layoutTwoColumnsLeft}}" stepKey="seeNewDesignChanges"/>
129+
130+
<!-- Assert Gift Option product settings -->
131+
<actionGroup ref="StorefrontOpenCartFromMinicartActionGroup" stepKey="openCart"/>
132+
<dontSeeElement selector="{{StorefrontProductCartGiftOptionSection.giftOptions}}" stepKey="dontSeeGiftOptionBtn"/>
133+
134+
<!-- Delete created bundle product -->
135+
<actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteProduct">
136+
<argument name="product" value="BundleProduct"/>
137+
</actionGroup>
138+
139+
<!-- Delete created Website -->
140+
<actionGroup ref="AdminDeleteWebsiteActionGroup" stepKey="deleteWebsite">
141+
<argument name="websiteName" value="$createWebsite.website[name]$"/>
142+
</actionGroup>
143+
</test>
144+
</tests>
145+

0 commit comments

Comments
 (0)