Skip to content

Commit bc147e2

Browse files
committed
refactored AdminCreateCreditMemoWithCashOnDeliveryTest
1 parent ad29452 commit bc147e2

14 files changed

+346
-4
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,8 @@
1515
<entity name="CashOnDeliveryPaymentMethodDefault" type="cashondelivery_payment_method">
1616
<requiredEntity type="active">CashOnDeliveryEnableConfigData</requiredEntity>
1717
</entity>
18+
19+
<entity name="CashOnDeliveryPaymentMethod" type="payment_method">
20+
<data key="method">cashondelivery</data>
21+
</entity>
1822
</entities>

app/code/Magento/Quote/Test/Mftf/Data/CustomerCartData.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,10 @@
2424
<requiredEntity type="payment_method">PaymentMethodCheckMoneyOrder</requiredEntity>
2525
<requiredEntity type="billing_address">BillingAddressTX</requiredEntity>
2626
</entity>
27+
28+
<entity name="CashOnDeliveryOrderPaymentMethod" type="CustomerPaymentInformation">
29+
<var key="cart_id" entityKey="return" entityType="CustomerCart"/>
30+
<requiredEntity type="payment_method">CashOnDeliveryPaymentMethod</requiredEntity>
31+
<requiredEntity type="billing_address">BillingAddressTX</requiredEntity>
32+
</entity>
2733
</entities>
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+
9+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AdminClickRefundOfflineOnMemoDetailPageActionGroup">
12+
13+
<click selector="{{AdminCreditMemoTotalSection.submitRefundOffline}}" stepKey="clickRefundOffline"/>
14+
<waitForElementVisible selector="{{AdminMessagesSection.success}}" stepKey="waitForSuccesMessage"/>
15+
<see selector="{{AdminMessagesSection.success}}" userInput="You created the credit memo." stepKey="seeSuccessMessage"/>
16+
</actionGroup>
17+
</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+
/**
5+
* Copyright © Magento, Inc. All rights reserved.
6+
* See COPYING.txt for license details.
7+
*/
8+
-->
9+
10+
<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
11+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd">
12+
13+
<entity name="CreditMemo" type="CreditMemo">
14+
<var key="quote_id" entityKey="return" entityType="CustomerCart"/>
15+
</entity>
16+
17+
</entities>
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+
/**
5+
* Copyright © Magento, Inc. All rights reserved.
6+
* See COPYING.txt for license details.
7+
*/
8+
-->
9+
10+
<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
11+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd">
12+
13+
<entity name="Invoice" type="Invoice">
14+
<var key="quote_id" entityKey="return" entityType="CustomerCart"/>
15+
</entity>
16+
17+
</entities>
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+
/**
5+
* Copyright © Magento, Inc. All rights reserved.
6+
* See COPYING.txt for license details.
7+
*/
8+
-->
9+
10+
<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
11+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd">
12+
13+
<entity name="Shipment" type="Shipment">
14+
<var key="quote_id" entityKey="return" entityType="CustomerCart"/>
15+
</entity>
16+
17+
</entities>
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+
9+
<operations xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataOperation.xsd">
11+
<operation name="CreateCreditMemo" dataType="CreditMemo" type="create" auth="adminOauth" url="V1/order/{return}/refund" method="POST">
12+
<contentType>application/json</contentType>
13+
<object key="cartItem" dataType="CartItem">
14+
<field key="quote_id">string</field>
15+
</object>
16+
</operation>
17+
</operations>
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+
9+
<operations xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataOperation.xsd">
11+
<operation name="CreateInvoice" dataType="Invoice" type="create" auth="adminOauth" url="V1/order/{return}/invoice" method="POST">
12+
<contentType>application/json</contentType>
13+
<object key="cartItem" dataType="CartItem">
14+
<field key="quote_id">string</field>
15+
</object>
16+
</operation>
17+
</operations>
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+
9+
<operations xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataOperation.xsd">
11+
<operation name="CreateShipment" dataType="Shipment" type="create" auth="adminOauth" url="V1/order/{return}/ship" method="POST">
12+
<contentType>application/json</contentType>
13+
<object key="cartItem" dataType="CartItem">
14+
<field key="quote_id">string</field>
15+
</object>
16+
</operation>
17+
</operations>

app/code/Magento/Sales/Test/Mftf/Section/AdminOrdersGridSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,6 @@
4141
<element name="viewLink" type="text" selector="//td/div[contains(.,'{{orderID}}')]/../..//a[@class='action-menu-item']" parameterized="true"/>
4242
<element name="selectOrderID" type="checkbox" selector="//td/div[text()='{{orderId}}']/../preceding-sibling::td//input" parameterized="true" timeout="60"/>
4343
<element name="orderId" type="text" selector="//table[contains(@class, 'data-grid')]//div[contains(text(), '{{orderId}}')]" parameterized="true"/>
44+
<element name="orderIdByIncrementId" type="text" selector="//input[@class='admin__control-checkbox' and @value={{incrId}}]/parent::label/parent::td/following-sibling::td" parameterized="true"/>
4445
</section>
4546
</sections>

0 commit comments

Comments
 (0)