Skip to content

Commit ff71487

Browse files
committed
Covering the Reorder functionality for an Out of Stock product
1 parent 21c7612 commit ff71487

File tree

4 files changed

+91
-0
lines changed

4 files changed

+91
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
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="AssertStorefrontCustomerElementNotVisibleActionGroup">
11+
<arguments>
12+
<argument name="selector" type="string"/>
13+
</arguments>
14+
<dontSeeElement selector="{{selector}}" stepKey="assertNotVisibleElement"/>
15+
</actionGroup>
16+
</actionGroups>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
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="NavigateToCustomerAccountPageActionGroup">
11+
<arguments>
12+
<argument name="page" type="string" />
13+
</arguments>
14+
<amOnPage url="{{page}}" stepKey="amOnTheCustomerPage"/>
15+
<waitForPageLoad stepKey="waitForPageLoad"/>
16+
</actionGroup>
17+
</actionGroups>
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
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="v"/>
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+
<severity value="AVERAGE"/>
18+
<group value="Sales"/>
19+
<group value="mtf_migrated"/>
20+
</annotations>
21+
<before>
22+
<createData entity="FlatRateShippingMethodDefault" stepKey="setDefaultFlatRateShippingMethod"/>
23+
<createData entity="CashOnDeliveryPaymentMethodDefault" stepKey="cashOnDeliveryPaymentMethod"/>
24+
<createData entity="Simple_US_Customer_CA" stepKey="simpleCustomer"/>
25+
<createData entity="SimpleProduct_25" stepKey="simpleProduct">
26+
<field key="price">5</field>
27+
</createData>
28+
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
29+
</before>
30+
<actionGroup ref="navigateToNewOrderPageExistingCustomer" stepKey="navigateToNewOrderWithExistingCustomer">
31+
<argument name="customer" value="$$simpleCustomer$$"/>
32+
</actionGroup>
33+
<actionGroup ref="addSimpleProductToOrder" stepKey="addSimpleProductToOrder">
34+
<argument name="product" value="$$simpleProduct$$"/>
35+
<argument name="productQty" value="25"/>
36+
</actionGroup>
37+
<actionGroup ref="SelectCashOnDeliveryPaymentMethodActionGroup" stepKey="selectPaymentMethod" />
38+
<actionGroup ref="orderSelectFlatRateShipping" stepKey="orderSelectFlatRateShippingMethod"/>
39+
<actionGroup ref="AdminSubmitOrderActionGroup" stepKey="submitOrder"/>
40+
<actionGroup ref="verifyCreatedOrderInformation" stepKey="verifyCreatedOrderInformation"/>
41+
<actionGroup ref="LoginToStorefrontActionGroup" stepKey="frontendCustomerLogIn">
42+
<argument name="Customer" value="$$simpleCustomer$$"/>
43+
</actionGroup>
44+
<actionGroup ref="NavigateToCustomerAccountPageActionGroup" stepKey="goToOrderHistoryPage">
45+
<argument name="page" value="{{StorefrontCustomerOrdersHistoryPage.url}}"/>
46+
</actionGroup>
47+
<actionGroup ref="AssertStorefrontCustomerElementNotVisibleActionGroup" stepKey="checkReorderButton">
48+
<argument name="selector" value="{{StorefrontCustomerOrderViewSection.reorder}}"/>
49+
</actionGroup>
50+
<after>
51+
<actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="customerLogout"/>
52+
<actionGroup ref="logout" stepKey="adminLogout"/>
53+
<deleteData createDataKey="simpleCustomer" stepKey="deleteSimpleCustomer"/>
54+
<deleteData createDataKey="simpleProduct" stepKey="deleteSimpleProduct"/>
55+
</after>
56+
</test>
57+
</tests>

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
<constraint name="Magento\Catalog\Test\Constraint\AssertProductsOutOfStock" />
2626
</variation>
2727
<variation name="CreateOrderBackendTestVariation19" summary="'Reorder' button is not visible for customer if ordered item is out of stock" ticketId="MAGETWO-63924">
28+
<data name="tag" xsi:type="string">mftf_migrated:yes</data>
2829
<data name="products/0" xsi:type="string">catalogProductSimple::default_qty_1</data>
2930
<data name="customer/dataset" xsi:type="string">default</data>
3031
<data name="billingAddress/dataset" xsi:type="string">US_address_1_without_email</data>

0 commit comments

Comments
 (0)