File tree Expand file tree Collapse file tree 3 files changed +15
-10
lines changed
Email/Controller/Adminhtml/Email/Template
OrderCancellationUi/Test/Mftf Expand file tree Collapse file tree 3 files changed +15
-10
lines changed Original file line number Diff line number Diff line change 5
5
*/
6
6
namespace Magento \Email \Controller \Adminhtml \Email \Template ;
7
7
8
+ use Magento \Framework \App \Action \HttpPostActionInterface ;
8
9
use Magento \Framework \App \Action \HttpGetActionInterface ;
9
10
10
11
/**
11
12
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
12
13
*/
13
- class DefaultTemplate extends \Magento \Email \Controller \Adminhtml \Email \Template implements HttpGetActionInterface
14
+ class DefaultTemplate extends \Magento \Email \Controller \Adminhtml \Email \Template implements
15
+ HttpPostActionInterface,
16
+ HttpGetActionInterface
14
17
{
15
18
/**
16
19
* @var \Magento\Email\Model\Template\Config
Original file line number Diff line number Diff line change 1
1
<?xml version =" 1.0" encoding =" UTF-8" ?>
2
2
<!--
3
3
/**
4
- * Copyright 2023 Adobe
5
- * All Rights Reserved.
4
+ * Copyright 2025 Adobe
5
+ * All Rights Reserved.
6
6
*/
7
7
-->
8
8
<sections xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance" xsi : noNamespaceSchemaLocation =" urn:magento:mftf:Page/etc/SectionObject.xsd" >
16
16
<element name =" referenceToLatestOrderId" type =" text" selector =" .table-order-items tr:first-child td.id" />
17
17
<element name =" messageAtTheTop" type =" text" selector =" .messages .message-error" />
18
18
<element name =" loadingMask" type =" text" selector =" .loading-mask" />
19
+ <element name =" linkToOpenViewOrder" type =" button" selector =" .actions .action.view" />
19
20
</section >
20
21
</sections >
Original file line number Diff line number Diff line change 1
1
<?xml version =" 1.0" encoding =" UTF-8" ?>
2
2
<!--
3
3
/**
4
- * Copyright 2023 Adobe
5
- * All Rights Reserved.
4
+ * Copyright 2025 Adobe
5
+ * All Rights Reserved.
6
6
*/
7
7
-->
8
8
<tests xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance" xsi : noNamespaceSchemaLocation =" urn:magento:mftf:Test/etc/testSchema.xsd" >
77
77
<expectedResult type =" string" >Closed</expectedResult >
78
78
<actualResult type =" variable" >$getLatestOrderStatus</actualResult >
79
79
</assertEquals >
80
-
80
+ <!-- open order view page -->
81
+ <click selector =" {{CustomerOrderCancellationSection.linkToOpenViewOrder}}" stepKey =" clickOnLinkToViewOrder" />
81
82
<!-- Grab Order Id for later usage-->
82
- <grabTextFrom selector =" {{CustomerOrderCancellationSection.referenceToLatestOrderId}}" stepKey =" getOrderId" />
83
-
83
+ <grabFromCurrentUrl regex =" ~/order_id/(\d+)/~" stepKey =" getOrderId" />
84
84
<!-- Go to Admin Sales Order View Page-->
85
- <amOnPage url =" {{AdminSalesOrderViewPage.url({$getOrderId})}}" stepKey =" navigateToSalesOrderViewPage" />
85
+ <actionGroup ref =" AdminOpenOrderByEntityIdActionGroup" stepKey =" navigateToSalesOrderViewPage" >
86
+ <argument name =" entityId" value =" {$getOrderId}" />
87
+ </actionGroup >
86
88
<waitForPageLoad stepKey =" waitForAdminSalesOrderViewPageLoad" />
87
-
88
89
<!-- Check Order History block-->
89
90
<grabTextFrom selector =" {{AdminSalesOrderViewSection.orderHistoryNoteListFirstComment}}" stepKey =" getOrderCancellationReason" />
90
91
<assertEquals message =" Order cancellation reason should be Other." stepKey =" assertOrderCancellationReason" after =" getOrderCancellationReason" >
You can’t perform that action at this time.
0 commit comments