Skip to content

Commit c8258ed

Browse files
authored
Merge pull request #115 from magento-pangolin/MC-4764
MC-4764
2 parents bfccd1b + ff6ec5a commit c8258ed

File tree

6 files changed

+292
-2
lines changed

6 files changed

+292
-2
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
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+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
11+
<section name="AdminCustomerActivitiesComparisonListSection">
12+
<element name="addProductToOrder" type="text" selector="//div[@id='order-sidebar_compared']//tr[td[.='{{productName}}']]//input[contains(@name,'add')]" parameterized="true" timeout="30"/>
13+
<element name="addToOrderConfigure" type="button" selector="//div[@id='order-sidebar_compared']//tr[td[contains(.,'{{productName}}')]]//a[contains(@class, 'icon-configure')]" parameterized="true" timeout="30"/>
14+
</section>
15+
</sections>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
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+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
11+
<section name="AdminCustomerActivitiesConfigureSection">
12+
<element name="addAttribute" type="select" selector="[id*='attribute']" timeout="30"/>
13+
<element name="okButton" type="button" selector="//button[contains(concat(' ',normalize-space(@class),' '),' action-primary ')]" timeout="30"/>
14+
</section>
15+
</sections>

app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerCreateNewOrderSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,6 @@
1313
<element name="productName" type="text" selector="#order-items_grid span[id*=order_item]"/>
1414
<element name="productPrice" type="text" selector=".even td[class=col-price] span[class=price]"/>
1515
<element name="productQty" type="input" selector="td[class=col-qty] input"/>
16+
<element name="gridCell" type="text" selector="//div[contains(@id, 'order-items_grid')]//tbody[{{row}}]//td[count(//table[contains(@class, 'order-tables')]//th[contains(., '{{column}}')]/preceding-sibling::th) +1 ]" parameterized="true" timeout="30"/>
1617
</section>
1718
</sections>
Lines changed: 163 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,163 @@
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="MoveConfigurableProductsInComparedOnOrderPageTest">
12+
<annotations>
13+
<features value="Sales"/>
14+
<stories value="Add Products to Order from Products in Comparison List Section"/>
15+
<title value="Move configurable products in compared on order page test"/>
16+
<description value="Move configurable products in compared on order page test"/>
17+
<severity value="CRITICAL"/>
18+
<testCaseId value="MC-16104"/>
19+
<group value="sales"/>
20+
<group value="mtf_migrated"/>
21+
</annotations>
22+
<before>
23+
<!-- Create customer -->
24+
<createData entity="Simple_US_Customer_CA" stepKey="createCustomer"/>
25+
26+
<!-- Create category -->
27+
<createData entity="_defaultCategory" stepKey="createCategory"/>
28+
29+
<!-- Create first configurable product -->
30+
<createData entity="ApiConfigurableProduct" stepKey="createFirstConfigProduct">
31+
<requiredEntity createDataKey="createCategory"/>
32+
</createData>
33+
<createData entity="productAttributeWithTwoOptions" stepKey="createFirstConfigProductAttribute"/>
34+
<createData entity="productAttributeOption1" stepKey="createFirstConfigProductAttributeOption">
35+
<requiredEntity createDataKey="createFirstConfigProductAttribute"/>
36+
</createData>
37+
<createData entity="AddToDefaultSet" stepKey="createFirstConfigAddToAttributeSet">
38+
<requiredEntity createDataKey="createFirstConfigProductAttribute"/>
39+
</createData>
40+
<getData entity="ProductAttributeOptionGetter" index="1" stepKey="getFirstConfigAttributeOption">
41+
<requiredEntity createDataKey="createFirstConfigProductAttribute"/>
42+
</getData>
43+
<createData entity="ApiSimpleOne" stepKey="createFirstConfigChildProduct">
44+
<requiredEntity createDataKey="createFirstConfigProductAttribute"/>
45+
<requiredEntity createDataKey="getFirstConfigAttributeOption"/>
46+
<requiredEntity createDataKey="createCategory"/>
47+
</createData>
48+
<createData entity="ConfigurableProductTwoOptions" stepKey="createFirstConfigProductOption">
49+
<requiredEntity createDataKey="createFirstConfigProduct"/>
50+
<requiredEntity createDataKey="createFirstConfigProductAttribute"/>
51+
<requiredEntity createDataKey="getFirstConfigAttributeOption"/>
52+
</createData>
53+
<createData entity="ConfigurableProductAddChild" stepKey="createFirstConfigProductAddChild">
54+
<requiredEntity createDataKey="createFirstConfigProduct"/>
55+
<requiredEntity createDataKey="createFirstConfigChildProduct"/>
56+
</createData>
57+
58+
<!-- Create second configurable product -->
59+
<createData entity="ApiConfigurableProduct" stepKey="createSecondConfigProduct">
60+
<requiredEntity createDataKey="createCategory"/>
61+
</createData>
62+
<createData entity="productAttributeWithTwoOptions" stepKey="createSecondConfigProductAttribute"/>
63+
<createData entity="productAttributeOption1" stepKey="createSecondConfigProductAttributeOption">
64+
<requiredEntity createDataKey="createSecondConfigProductAttribute"/>
65+
</createData>
66+
<createData entity="AddToDefaultSet" stepKey="createSecondConfigAddToAttributeSet">
67+
<requiredEntity createDataKey="createSecondConfigProductAttribute"/>
68+
</createData>
69+
<getData entity="ProductAttributeOptionGetter" index="1" stepKey="getSecondConfigAttributeOption">
70+
<requiredEntity createDataKey="createSecondConfigProductAttribute"/>
71+
</getData>
72+
<createData entity="ApiSimpleOne" stepKey="createSecondConfigChildProduct">
73+
<requiredEntity createDataKey="createSecondConfigProductAttribute"/>
74+
<requiredEntity createDataKey="getSecondConfigAttributeOption"/>
75+
<requiredEntity createDataKey="createCategory"/>
76+
</createData>
77+
<createData entity="ConfigurableProductTwoOptions" stepKey="createSecondConfigProductOption">
78+
<requiredEntity createDataKey="createSecondConfigProduct"/>
79+
<requiredEntity createDataKey="createSecondConfigProductAttribute"/>
80+
<requiredEntity createDataKey="getSecondConfigAttributeOption"/>
81+
</createData>
82+
<createData entity="ConfigurableProductAddChild" stepKey="createSecondConfigProductAddChild">
83+
<requiredEntity createDataKey="createSecondConfigProduct"/>
84+
<requiredEntity createDataKey="createSecondConfigChildProduct"/>
85+
</createData>
86+
</before>
87+
<after>
88+
<!-- Admin logout -->
89+
<actionGroup ref="logout" stepKey="logout"/>
90+
91+
<!-- Logout customer -->
92+
<actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="logoutCustomer"/>
93+
94+
<!-- Delete configurable products data -->
95+
<deleteData createDataKey="createFirstConfigChildProduct" stepKey="deleteFirstConfigChildProduct"/>
96+
<deleteData createDataKey="createFirstConfigProduct" stepKey="deleteFirstConfigProduct"/>
97+
<deleteData createDataKey="createFirstConfigProductAttribute" stepKey="deleteFirstConfigProductAttribute"/>
98+
<deleteData createDataKey="createSecondConfigChildProduct" stepKey="deleteSecondConfigChildProduct"/>
99+
<deleteData createDataKey="createSecondConfigProduct" stepKey="deleteSecondConfigProduct"/>
100+
<deleteData createDataKey="createSecondConfigProductAttribute" stepKey="deleteSecondConfigProductAttribute"/>
101+
102+
<!-- Delete category -->
103+
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
104+
</after>
105+
106+
<!-- Login as customer -->
107+
<actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginAsCustomer">
108+
<argument name="Customer" value="$$createCustomer$$" />
109+
</actionGroup>
110+
111+
<!-- Add first product to compare list -->
112+
<actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openFirstProductPage">
113+
<argument name="productUrl" value="$$createFirstConfigProduct.custom_attributes[url_key]$$"/>
114+
</actionGroup>
115+
<scrollTo selector="{{StorefrontProductInfoMainSection.productAddToCompare}}" stepKey="scrollToCompareProductButton"/>
116+
<actionGroup ref="StorefrontAddProductToCompareActionGroup" stepKey="addFirstProductToCompare">
117+
<argument name="productVar" value="$$createFirstConfigProduct$$"/>
118+
</actionGroup>
119+
120+
<!-- Add second product to compare list -->
121+
<actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openSecondProductPage">
122+
<argument name="productUrl" value="$$createSecondConfigProduct.custom_attributes[url_key]$$"/>
123+
</actionGroup>
124+
<scrollTo selector="{{StorefrontProductInfoMainSection.productAddToCompare}}" stepKey="scrollToCompareProductBtn"/>
125+
<actionGroup ref="StorefrontAddProductToCompareActionGroup" stepKey="addSecondProductToCompare">
126+
<argument name="productVar" value="$$createSecondConfigProduct$$"/>
127+
</actionGroup>
128+
129+
<!-- Login as admin -->
130+
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
131+
132+
<!-- Open Customers -> All Customers -->
133+
<amOnPage url="{{AdminCustomerPage.url}}" stepKey="openCustomersGridPage"/>
134+
<waitForPageLoad stepKey="waitForCustomerPageLoad"/>
135+
<actionGroup ref="OpenEditCustomerFromAdminActionGroup" stepKey="openEditCustomerPage">
136+
<argument name="customer" value="$$createCustomer$$"/>
137+
</actionGroup>
138+
139+
<!-- Click 'Create Order' -->
140+
<click selector="{{AdminCustomerMainActionsSection.createOrderBtn}}" stepKey="clickCreateOrder"/>
141+
142+
<!-- Add configure to first product -->
143+
<click selector="{{AdminCustomerActivitiesComparisonListSection.addToOrderConfigure($$createFirstConfigProduct.name$$)}}" stepKey="configureFirstProduct"/>
144+
<selectOption selector="{{AdminCustomerActivitiesConfigureSection.addAttribute}}" userInput="$$getFirstConfigAttributeOption.value$$" stepKey="selectOptionForFirstProduct"/>
145+
<click selector="{{AdminCustomerActivitiesConfigureSection.okButton}}" stepKey="clickOkBtnForFirstProduct"/>
146+
<waitForPageLoad stepKey="waitForConfigureForFirstProductLoad"/>
147+
148+
<!-- Add configure to second product -->
149+
<click selector="{{AdminCustomerActivitiesComparisonListSection.addToOrderConfigure($$createSecondConfigProduct.name$$)}}" stepKey="configureSecondProduct"/>
150+
<selectOption selector="{{AdminCustomerActivitiesConfigureSection.addAttribute}}" userInput="$$getSecondConfigAttributeOption.value$$" stepKey="selectOptionForSecond"/>
151+
<click selector="{{AdminCustomerActivitiesConfigureSection.okButton}}" stepKey="clickOkBtnForSecondProduct"/>
152+
<waitForPageLoad stepKey="waitForConfigureForSecondProductLoad"/>
153+
154+
<!-- Click 'Update Changes' -->
155+
<click selector="{{AdminCustomerCreateNewOrderSection.updateChangesBtn}}" stepKey="clickUpdateChangesBtn"/>
156+
157+
<!-- Assert products in items ordered grid -->
158+
<see selector="{{AdminCustomerCreateNewOrderSection.gridCell('1', 'Product')}}" userInput="$$createFirstConfigProduct.name$$" stepKey="seeFirstProductName"/>
159+
<see selector="{{AdminCustomerCreateNewOrderSection.gridCell('1', 'Price')}}" userInput="$123.00" stepKey="seeFirstProductPrice"/>
160+
<see selector="{{AdminCustomerCreateNewOrderSection.gridCell('2', 'Product')}}" userInput="$$createSecondConfigProduct.name$$" stepKey="seeSecondProductName"/>
161+
<see selector="{{AdminCustomerCreateNewOrderSection.gridCell('2', 'Price')}}" userInput="$123.00" stepKey="seeSecondProductPrice"/>
162+
</test>
163+
</tests>
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
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="MoveSimpleProductsInComparedOnOrderPageTest">
12+
<annotations>
13+
<features value="Sales"/>
14+
<stories value="Add Products to Order from Products in Comparison List Section"/>
15+
<title value="Move simple products in compared on order page test"/>
16+
<description value="Move simple products in compared on order page test"/>
17+
<severity value="CRITICAL"/>
18+
<testCaseId value="MC-16103"/>
19+
<group value="sales"/>
20+
<group value="mtf_migrated"/>
21+
</annotations>
22+
<before>
23+
<!-- Create customer -->
24+
<createData entity="Simple_US_Customer_CA" stepKey="createCustomer"/>
25+
26+
<!-- Create simple products -->
27+
<createData entity="SimpleProduct2" stepKey="createFirstSimpleProduct">
28+
<field key="price">560</field>
29+
</createData>
30+
<createData entity="SimpleProduct2" stepKey="createSecondSimpleProduct">
31+
<field key="price">560</field>
32+
</createData>
33+
</before>
34+
<after>
35+
<!-- Admin logout -->
36+
<actionGroup ref="logout" stepKey="logout"/>
37+
38+
<!-- Logout customer -->
39+
<actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="logoutCustomer"/>
40+
41+
<!-- Delete created entities -->
42+
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/>
43+
<deleteData createDataKey="createFirstSimpleProduct" stepKey="deleteFirstSimpleProduct"/>
44+
<deleteData createDataKey="createSecondSimpleProduct" stepKey="deleteSecondSimpleProduct"/>
45+
</after>
46+
47+
<!-- Login as customer -->
48+
<actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginAsCustomer">
49+
<argument name="Customer" value="$$createCustomer$$" />
50+
</actionGroup>
51+
52+
<!-- Add first product to compare list -->
53+
<actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openFirstProductPage">
54+
<argument name="productUrl" value="$$createFirstSimpleProduct.custom_attributes[url_key]$$"/>
55+
</actionGroup>
56+
<scrollTo selector="{{StorefrontProductInfoMainSection.productAddToCompare}}" stepKey="scrollToCompareProductButton"/>
57+
<actionGroup ref="StorefrontAddProductToCompareActionGroup" stepKey="addFirstProductToCompare">
58+
<argument name="productVar" value="$$createFirstSimpleProduct$$"/>
59+
</actionGroup>
60+
61+
<!-- Add second product to compare list -->
62+
<actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openSecondProductPage">
63+
<argument name="productUrl" value="$$createSecondSimpleProduct.custom_attributes[url_key]$$"/>
64+
</actionGroup>
65+
<scrollTo selector="{{StorefrontProductInfoMainSection.productAddToCompare}}" stepKey="scrollToCompareButton"/>
66+
<actionGroup ref="StorefrontAddProductToCompareActionGroup" stepKey="addSecondProductToCompare">
67+
<argument name="productVar" value="$$createSecondSimpleProduct$$"/>
68+
</actionGroup>
69+
70+
<!-- Login as admin -->
71+
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
72+
73+
<!-- Open Customers -> All Customers -->
74+
<amOnPage url="{{AdminCustomerPage.url}}" stepKey="openCustomersGridPage"/>
75+
<waitForPageLoad stepKey="waitForCustomerPageLoad"/>
76+
<actionGroup ref="OpenEditCustomerFromAdminActionGroup" stepKey="openEditCustomerPage">
77+
<argument name="customer" value="$$createCustomer$$"/>
78+
</actionGroup>
79+
80+
<!-- Click 'Create Order' -->
81+
<click selector="{{AdminCustomerMainActionsSection.createOrderBtn}}" stepKey="clickCreateOrder"/>
82+
83+
<!-- Select products in comparison list section -->
84+
<click selector="{{AdminCustomerActivitiesComparisonListSection.addProductToOrder($$createFirstSimpleProduct.name$$)}}" stepKey="addFirstProductToOrder"/>
85+
<click selector="{{AdminCustomerActivitiesComparisonListSection.addProductToOrder($$createSecondSimpleProduct.name$$)}}" stepKey="addSecondProductToOrder"/>
86+
87+
<!-- Click 'Update Changes' -->
88+
<click selector="{{AdminCustomerCreateNewOrderSection.updateChangesBtn}}" stepKey="clickUpdateChangesBtn"/>
89+
90+
<!-- Assert products in items ordered grid -->
91+
<see selector="{{AdminCustomerCreateNewOrderSection.gridCell('1', 'Product')}}" userInput="$$createFirstSimpleProduct.name$$" stepKey="seeFirstProductName"/>
92+
<see selector="{{AdminCustomerCreateNewOrderSection.gridCell('1', 'Price')}}" userInput="$$createFirstSimpleProduct.price$$" stepKey="seeFirstProductPrice"/>
93+
<see selector="{{AdminCustomerCreateNewOrderSection.gridCell('2', 'Product')}}" userInput="$$createSecondSimpleProduct.name$$" stepKey="seeSecondProductName"/>
94+
<see selector="{{AdminCustomerCreateNewOrderSection.gridCell('2', 'Price')}}" userInput="$$createSecondSimpleProduct.price$$" stepKey="seeSecondProductPrice"/>
95+
</test>
96+
</tests>

dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/MoveProductsInComparedOnOrderPageTest.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@
88
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd">
99
<testCase name="Magento\Sales\Test\TestCase\MoveProductsInComparedOnOrderPageTest" summary="Add Products to Order from Products in Comparison List Section" ticketId="MAGETWO-28050">
1010
<variation name="MoveProductsInComparedOnOrderPageTestVariation1">
11-
<data name="tag" xsi:type="string">to_maintain:yes</data>
11+
<data name="tag" xsi:type="string">to_maintain:yes, mftf_migrated:yes</data>
1212
<data name="products/0" xsi:type="string">catalogProductSimple::default</data>
1313
<data name="products/1" xsi:type="string">catalogProductSimple::default</data>
1414
<constraint name="Magento\Sales\Test\Constraint\AssertProductInItemsOrderedGrid" />
1515
</variation>
1616
<variation name="MoveProductsInComparedOnOrderPageTestVariation2">
17-
<data name="tag" xsi:type="string">to_maintain:yes</data>
17+
<data name="tag" xsi:type="string">to_maintain:yes, mftf_migrated:yes</data>
1818
<data name="products/0" xsi:type="string">configurableProduct::configurable_with_qty_1</data>
1919
<data name="products/1" xsi:type="string">configurableProduct::configurable_with_qty_1</data>
2020
<constraint name="Magento\Sales\Test\Constraint\AssertProductInItemsOrderedGrid" />

0 commit comments

Comments
 (0)