Skip to content

Commit d13d743

Browse files
committed
Merge branch '716-Convert-CreateOrderBackendTest' into mtf-mftf-migration-pr
2 parents 8a4600f + fd9bbcd commit d13d743

File tree

11 files changed

+186
-0
lines changed

11 files changed

+186
-0
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
10+
<actionGroup name="AssertAdminProductStockStatusActionGroup">
11+
<arguments>
12+
<argument name="productId" type="string"/>
13+
<argument name="stockStatus" type="string"/>
14+
</arguments>
15+
<amOnPage url="{{AdminProductEditPage.url(productId)}}" stepKey="goToProductEditPage"/>
16+
<waitForPageLoad stepKey="waitForProductPageLoad"/>
17+
<seeOptionIsSelected selector="{{AdminProductFormSection.productStockStatus}}" userInput="{{stockStatus}}"
18+
stepKey="checkProductStatus"/>
19+
</actionGroup>
20+
</actionGroups>

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@
3939
<data key="name">Pursuit Lumaflex&#38;trade; Tone Band</data>
4040
<data key="sku" unique="suffix">x&#38;trade;</data>
4141
</entity>
42+
<entity name="SimpleProduct_25" type="product" extends="SimpleProduct2">
43+
<data key="quantity">25</data>
44+
<requiredEntity type="product_extension_attribute">EavStock25</requiredEntity>
45+
</entity>
4246
<entity name="ApiSimpleProductWithCustomPrice" type="product" extends="ApiSimpleProduct">
4347
<data key="price">100</data>
4448
</entity>

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,7 @@
2626
<entity name="EavStock777" type="product_extension_attribute">
2727
<requiredEntity type="stock_item">Qty_777</requiredEntity>
2828
</entity>
29+
<entity name="EavStock25" type="product_extension_attribute">
30+
<requiredEntity type="stock_item">Qty_25</requiredEntity>
31+
</entity>
2932
</entities>

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,8 @@
4040
<data key="qty">777</data>
4141
<data key="is_in_stock">true</data>
4242
</entity>
43+
<entity name="Qty_25" type="stock_item">
44+
<data key="qty">25</data>
45+
<data key="is_in_stock">true</data>
46+
</entity>
4347
</entities>
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
10+
<actionGroup name="StorefrontCustomerReorderButtonNotVisibleActionGroup">
11+
<dontSeeElement selector="{{StorefrontCustomerOrderViewSection.reorder}}" stepKey="assertNotVisibleElement"/>
12+
</actionGroup>
13+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
10+
<actionGroup name="StorefrontNavigateToCustomerOrdersHistoryPageActionGroup">
11+
<amOnPage url="{{StorefrontCustomerOrdersHistoryPage.url}}" stepKey="amOnTheCustomerPage"/>
12+
<waitForPageLoad stepKey="waitForPageLoad"/>
13+
</actionGroup>
14+
</actionGroups>

app/code/Magento/Payment/Test/Mftf/Data/PaymentMethodData.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,8 @@
1111
<entity name="PaymentMethodCheckMoneyOrder" type="payment_method">
1212
<data key="method">checkmo</data>
1313
</entity>
14+
15+
<entity name="CashOnDeliveryPaymentMethodDefault" type="cashondelivery_payment_method">
16+
<requiredEntity type="active">CashOnDeliveryEnableConfigData</requiredEntity>
17+
</entity>
1418
</entities>

app/code/Magento/Payment/Test/Mftf/Metadata/payment_method-meta.xml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,18 @@
1111
<operation name="CreatePaymentMethod" dataType="payment_method" type="create">
1212
<field key="method">string</field>
1313
</operation>
14+
<operation name="cashondeliveryPaymentMethodSetup" dataType="cashondelivery_payment_method" type="create" auth="adminFormKey" url="/admin/system_config/save/section/payment/" method="POST">
15+
<object key="groups" dataType="cashondelivery_payment_method">
16+
<object key="cashondelivery" dataType="cashondelivery_payment_method">
17+
<object key="fields" dataType="cashondelivery_payment_method">
18+
<object key="active" dataType="active">
19+
<field key="value">string</field>
20+
</object>
21+
<object key="title" dataType="title">
22+
<field key="value">string</field>
23+
</object>
24+
</object>
25+
</object>
26+
</object>
27+
</operation>
1428
</operations>
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
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="AdminCreateOrderAndCheckTheReorderTest">
12+
<annotations>
13+
<title value="'Reorder' button is not visible for customer if ordered item is out of stock"/>
14+
<stories value="MAGETWO-63924: 'Reorder' button is not visible for customer if ordered item is out of stock"/>
15+
<description value="'Reorder' button is not visible for customer if ordered item is out of stock"/>
16+
<features value="Sales"/>
17+
<testCaseId value="MC-22109"/>
18+
<severity value="MAJOR"/>
19+
<group value="Sales"/>
20+
<group value="mtf_migrated"/>
21+
</annotations>
22+
<before>
23+
<createData entity="FlatRateShippingMethodDefault" stepKey="setDefaultFlatRateShippingMethod"/>
24+
<createData entity="CashOnDeliveryPaymentMethodDefault" stepKey="cashOnDeliveryPaymentMethod"/>
25+
<createData entity="Simple_US_Customer_CA" stepKey="simpleCustomer"/>
26+
<createData entity="SimpleProduct_25" stepKey="simpleProduct">
27+
<field key="price">5</field>
28+
</createData>
29+
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
30+
</before>
31+
<actionGroup ref="navigateToNewOrderPageExistingCustomer" stepKey="navigateToNewOrderWithExistingCustomer">
32+
<argument name="customer" value="$$simpleCustomer$$"/>
33+
</actionGroup>
34+
<actionGroup ref="addSimpleProductToOrder" stepKey="addSimpleProductToOrder">
35+
<argument name="product" value="$$simpleProduct$$"/>
36+
<argument name="productQty" value="{{SimpleProduct_25.quantity}}"/>
37+
</actionGroup>
38+
<actionGroup ref="SelectCashOnDeliveryPaymentMethodActionGroup" stepKey="selectPaymentMethod"/>
39+
<actionGroup ref="orderSelectFlatRateShipping" stepKey="orderSelectFlatRateShippingMethod"/>
40+
<actionGroup ref="AdminSubmitOrderActionGroup" stepKey="submitOrder"/>
41+
<actionGroup ref="verifyCreatedOrderInformation" stepKey="verifyCreatedOrderInformation"/>
42+
<actionGroup ref="LoginToStorefrontActionGroup" stepKey="frontendCustomerLogIn">
43+
<argument name="Customer" value="$$simpleCustomer$$"/>
44+
</actionGroup>
45+
<actionGroup ref="StorefrontNavigateToCustomerOrdersHistoryPageActionGroup" stepKey="goToOrderHistoryPage"/>
46+
<actionGroup ref="StorefrontCustomerReorderButtonNotVisibleActionGroup" stepKey="checkReorderButton"/>
47+
<after>
48+
<actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="customerLogout"/>
49+
<actionGroup ref="logout" stepKey="adminLogout"/>
50+
<magentoCLI command="config:set payment/cashondelivery/active 0" stepKey="disableCashOnDeliveryMethod"/>
51+
<deleteData createDataKey="simpleCustomer" stepKey="deleteSimpleCustomer"/>
52+
<deleteData createDataKey="simpleProduct" stepKey="deleteSimpleProduct"/>
53+
</after>
54+
</test>
55+
</tests>
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
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="AdminCreateOrderWithSimpleProductTest">
12+
<annotations>
13+
<title value="Create Order in Admin with simple product"/>
14+
<stories value="MAGETWO-12798: Create order with condition available product qty = ordered product qty"/>
15+
<description value="Create order with simple product and assert if it gets out of stock after ordering it."/>
16+
<features value="Sales"/>
17+
<testCaseId value="MC-22110"/>
18+
<severity value="MAJOR"/>
19+
<group value="Sales"/>
20+
<group value="mtf_migrated"/>
21+
</annotations>
22+
<before>
23+
<createData entity="FlatRateShippingMethodDefault" stepKey="setDefaultFlatRateShippingMethod"/>
24+
<createData entity="CashOnDeliveryPaymentMethodDefault" stepKey="cashOnDeliveryPaymentMethod"/>
25+
<createData entity="Simple_US_Customer_CA" stepKey="simpleCustomer"/>
26+
<createData entity="SimpleProduct_25" stepKey="simpleProduct">
27+
<field key="price">5</field>
28+
</createData>
29+
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
30+
</before>
31+
<actionGroup ref="navigateToNewOrderPageExistingCustomer" stepKey="navigateToNewOrderWithExistingCustomer">
32+
<argument name="customer" value="$$simpleCustomer$$"/>
33+
</actionGroup>
34+
<actionGroup ref="addSimpleProductToOrder" stepKey="addSimpleProductToOrder">
35+
<argument name="product" value="$$simpleProduct$$"/>
36+
<argument name="productQty" value="{{SimpleProduct_25.quantity}}"/>
37+
</actionGroup>
38+
<actionGroup ref="SelectCashOnDeliveryPaymentMethodActionGroup" stepKey="selectPaymentMethod"/>
39+
<actionGroup ref="orderSelectFlatRateShipping" stepKey="orderSelectFlatRateShippingMethod"/>
40+
<actionGroup ref="AdminSubmitOrderActionGroup" stepKey="submitOrder"/>
41+
<actionGroup ref="verifyCreatedOrderInformation" stepKey="verifyCreatedOrderInformation"/>
42+
<actionGroup ref="AssertAdminProductStockStatusActionGroup" stepKey="checkProductStockStatus">
43+
<argument name="productId" value="$$simpleProduct.id$$"/>
44+
<argument name="stockStatus" value="Out of Stock"/>
45+
</actionGroup>
46+
<after>
47+
<actionGroup ref="logout" stepKey="logout"/>
48+
<magentoCLI command="config:set payment/cashondelivery/active 0" stepKey="disableCashOnDeliveryMethod"/>
49+
<deleteData createDataKey="simpleCustomer" stepKey="deleteSimpleCustomer"/>
50+
<deleteData createDataKey="simpleProduct" stepKey="deleteSimpleProduct"/>
51+
</after>
52+
</test>
53+
</tests>

0 commit comments

Comments
 (0)