Skip to content

Commit c06e0de

Browse files
committed
MAGETWO-95812: Required RMA Attributes are not validated while Customer submits a return
- Add automated test
1 parent 2e036c4 commit c06e0de

10 files changed

+274
-0
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<!--Fill order information fields and click continue-->
12+
<actionGroup name="fillOrderInformationActionGroup">
13+
<arguments>
14+
<argument name="orderId" type="string"/>
15+
<argument name="orderLastName"/>
16+
<argument name="orderEmail"/>
17+
</arguments>
18+
<amOnPage url="{{StorefrontOrdersAndReturnsPage.url}}" stepKey="navigateToOrderAndReturnPage"/>
19+
<waitForPageLoad stepKey="waitForPageLoad"/>
20+
<fillField selector="{{OrderAndReturnInformationSection.orderId}}" userInput="{{orderId}}" stepKey="fillOrderId"/>
21+
<fillField selector="{{OrderAndReturnInformationSection.bilingLastName}}" userInput="{{orderLastName}}" stepKey="fillBillingLastName"/>
22+
<fillField selector="{{OrderAndReturnInformationSection.email}}" userInput="{{orderEmail}}" stepKey="fillEmail"/>
23+
<click selector="{{OrderAndReturnInformationSection.continueButton}}" stepKey="clickContinue"/>
24+
<waitForPageLoad stepKey="waitForOrderInformationPageLoad"/>
25+
<seeInCurrentUrl url="{{StorefrontOrderInformationPage.url}}" stepKey="seeOrderInformationUrl"/>
26+
</actionGroup>
27+
28+
<!--Enter quantity to return and submit-->
29+
<actionGroup name="fillQuantityToReturnActionGroup">
30+
<click selector="{{OrderInformationMainSection.return}}" stepKey="gotToCreateNewReturnPage"/>
31+
<waitForPageLoad stepKey="waitForReturnPageLoad"/>
32+
<fillField selector="{{CreateNewReturnMainSection.quantityToReturn}}" userInput="1" stepKey="fillQuantityToReturn"/>
33+
<click selector="{{CreateNewReturnMainSection.submit}}" stepKey="clickSubmit"/>
34+
<waitForPageLoad stepKey="waitForPageLoad"/>
35+
</actionGroup>
36+
</actionGroups>
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?xml version="1.0"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd">
10+
<entity name="EnableRMA" type="sales_rma_config">
11+
<requiredEntity type="enabled">EnableRMAStorefront</requiredEntity>
12+
</entity>
13+
<entity name="EnableRMAStorefront" type="enabled">
14+
<data key="value">1</data>
15+
</entity>
16+
17+
<entity name="DisableRMA" type="sales_rma_config">
18+
<requiredEntity type="enabled">DisableRMAStorefront</requiredEntity>
19+
</entity>
20+
<entity name="DisableRMAStorefront" type="enabled">
21+
<data key="value">0</data>
22+
</entity>
23+
</entities>
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+
<operations xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataOperation.xsd">
9+
<operation name="SalesRMAConfig" dataType="sales_rma_config" type="create" auth="adminFormKey" url="/admin/system_config/save/section/sales/" method="POST">
10+
<object key="groups" dataType="sales_rma_config">
11+
<object key="magento_rma" dataType="sales_rma_config">
12+
<object key="fields" dataType="sales_rma_config">
13+
<object key="enabled" dataType="enabled">
14+
<field key="value">string</field>
15+
</object>
16+
</object>
17+
</object>
18+
</object>
19+
</operation>
20+
</operations>
Lines changed: 14 additions & 0 deletions
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+
9+
<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd">
11+
<page name="StorefrontCreateNewReturnPage" url="rma/guest/create/order_id/" area="guest" module="Magento_Sales">
12+
<section name="CreateNewReturnMainSection"/>
13+
</page>
14+
</pages>
Lines changed: 14 additions & 0 deletions
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+
9+
<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd">
11+
<page name="StorefrontOrderInformationPage" url="sales/guest/view" area="guest" module="Magento_Sales">
12+
<section name="OrderInformationMainSection"/>
13+
</page>
14+
</pages>
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+
<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd">
11+
<page name="StorefrontOrdersAndReturnsPage" url="sales/guest/form" area="guest" module="Magento_Sales">
12+
<section name="OrderAndReturnsMainSection"/>
13+
<section name="OrderInformationSection"/>
14+
</page>
15+
</pages>
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
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="CreateNewReturnMainSection">
12+
<element name="quantityToReturn" type="input" selector="#items:qty_requested0"/>
13+
<element name="submit" type="submit" selector="//span[contains(text(), 'Submit')]"/>
14+
<element name="resolutionError" type="text" selector="//*[@id='items:resolution0']/following-sibling::div[contains(text(),'Please select an option')]"/>
15+
<element name="conditionError" type="text" selector="//*[@id='items:condition0']/following-sibling::div[contains(text(),'Please select an option')]"/>
16+
<element name="reasonError" type="text" selector="//*[@id='items:reason0']/following-sibling::div[contains(text(),'Please select an option')]"/>
17+
</section>
18+
</sections>
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+
9+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
11+
<section name="OrderAndReturnInformationSection">
12+
<element name="orderId" type="input" selector="#oar-order-id"/>
13+
<element name="bilingLastName" type="input" selector="#oar-billing-lastname"/>
14+
<element name="findOrderBy" type="select" selector="#quick-search-type-id"/>
15+
<element name="email" type="input" selector="#oar_email"/>
16+
<element name="bilingZipCode" type="input" selector="//input[@id='oar_zip']"/>
17+
<element name="continueButton" type="submit" selector="//button[@title='Continue']"/>
18+
<element name="ordersAndReturnsTitle" type="span" selector="//span[@id='page-title-wrapper']"/>
19+
</section>
20+
</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="OrderInformationMainSection">
12+
<element name="orderTitle" type="span" selector="#page-title-wrapper"/>
13+
<element name="return" type="span" selector="//span[contains(text(), 'Return')]"/>
14+
</section>
15+
</sections>
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
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="RequiredRMAAttributesValidationWhileCustomerSubmitsReturnTest">
12+
<annotations>
13+
<features value="Sales"/>
14+
<stories value="MAGETWO-95812: Required RMA Attributes are not validated while Customer submits a return"/>
15+
<title value="Required RMA Attributes Validation While Customer Submits A Return"/>
16+
<description value="Required RMA Attributes Validation While Customer Submits A Return"/>
17+
<severity value="MAJOR"/>
18+
<testCaseId value="MAGETWO-95864"/>
19+
<group value="sales"/>
20+
</annotations>
21+
<before>
22+
<!-- log in as admin -->
23+
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
24+
<!--Enabled RMA On Storefront-->
25+
<createData entity="EnableRMA" stepKey="enabledRMAOnStorefront"/>
26+
<!-- create new product -->
27+
<createData entity="_defaultCategory" stepKey="createCategory"/>
28+
<createData entity="SimpleProduct" stepKey="createSimpleProduct">
29+
<requiredEntity createDataKey="createCategory"/>
30+
</createData>
31+
</before>
32+
33+
<!-- Place an order from frontend -->
34+
35+
<actionGroup ref="AddSimpleProductToCart" stepKey="addProductToCart">
36+
<argument name="product" value="$$createSimpleProduct$$"/>
37+
</actionGroup>
38+
39+
<actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="checkoutProductFromCart"/>
40+
41+
<actionGroup ref="GuestCheckoutFillingShippingSectionActionGroup" stepKey="guestCheckoutFillingShippingSection">
42+
<argument name="customerVar" value="CustomerEntityOne" />
43+
<argument name="customerAddressVar" value="CustomerAddressSimple" />
44+
</actionGroup>
45+
46+
<!-- place for order -->
47+
<waitForElement selector="{{CheckoutPaymentSection.placeOrder}}" time="30" stepKey="waitForPlaceOrderButton"/>
48+
<click selector="{{CheckoutPaymentSection.placeOrder}}" stepKey="clickPlaceOrder"/>
49+
<waitForPageLoad stepKey="waitForPlaceOrder"/>
50+
<grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber}}" stepKey="grabOrderNumber"/>
51+
52+
<!--Complete the order from admin bay creating Invoice and then Shipment-->
53+
<amOnPage url="{{AdminOrdersPage.url}}" stepKey="goToOrdersIndexPage"/>
54+
<waitForPageLoad stepKey="waitForOrderIndexPage"/>
55+
56+
<!-- Open Order -->
57+
<actionGroup ref="filterOrderGridById" stepKey="filterOrderGridById">
58+
<argument name="orderId" value="$grabOrderNumber"/>
59+
</actionGroup>
60+
<click selector="{{AdminOrdersGridSection.firstRow}}" stepKey="clickOrderRow"/>
61+
<waitForPageLoad stepKey="waitForCreatedOrderPageOpened"/>
62+
63+
<click selector="{{AdminOrderDetailsMainActionsSection.invoice}}" stepKey="clickInvoiceAction"/>
64+
<see selector="{{AdminHeaderSection.pageTitle}}" userInput="New Invoice" stepKey="seePageNameNewInvoicePage"/>
65+
<click selector="{{AdminInvoiceMainActionsSection.submitInvoice}}" stepKey="clickSubmitInvoice"/>
66+
67+
<click selector="{{AdminOrderDetailsMainActionsSection.ship}}" stepKey="clickShipAction"/>
68+
<seeInCurrentUrl url="{{AdminShipmentNewPage.url}}" stepKey="seeOrderShipmentUrl"/>
69+
<click selector="{{AdminShipmentMainActionsSection.submitShipment}}" stepKey="clickSubmitShipment"/>
70+
71+
<!--Goes to Orders and Returns -->
72+
<amOnPage url="{{StorefrontOrdersAndReturnsPage.url}}" stepKey="goToOrderAndReturnPage"/>
73+
<waitForPageLoad stepKey="waitForOrdersAndReturnsPageLoad"/>
74+
<seeInCurrentUrl url="{{StorefrontOrdersAndReturnsPage.url}}" stepKey="seeOrdersAndReturnsUrl"/>
75+
76+
<actionGroup ref="fillOrderInformationActionGroup" stepKey="fillOrderInformationAndContinue">
77+
<argument name="orderId" value="$grabOrderNumber"/>
78+
<argument name="orderLastName" value="CustomerEntityOne.lastname"/>
79+
<argument name="orderEmail" value="CustomerEntityOne.email"/>
80+
</actionGroup>
81+
82+
<click selector="{{OrderInformationMainSection.return}}" stepKey="clickOnReturn"/>
83+
<actionGroup ref="fillQuantityToReturnActionGroup" stepKey="fillQuantityToReturn"/>
84+
85+
<seeElement selector="{{CreateNewReturnMainSection.resolutionError}}" stepKey="AssertResolutionError" />
86+
<seeElement selector="{{CreateNewReturnMainSection.conditionError}}" stepKey="AssertConditionError" />
87+
<seeElement selector="{{CreateNewReturnMainSection.reasonError}}" stepKey="AssertReasonError" />
88+
89+
<after>
90+
<!--Disable RMA On Storefront-->
91+
<createData entity="DisableRMA" stepKey="disableRMAOnStorefront"/>
92+
93+
<!--Delete the created product-->
94+
<deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/>
95+
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
96+
<actionGroup ref="logout" stepKey="logout"/>
97+
</after>
98+
</test>
99+
</tests>

0 commit comments

Comments
 (0)