Skip to content

Commit 0266008

Browse files
committed
MC-42531: HTML Tags are displaying on customer's order comment section on frontend
- Corrected the MFTF test file based on PR comments.
1 parent c7faeec commit 0266008

File tree

4 files changed

+14
-3
lines changed

4 files changed

+14
-3
lines changed

app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerOrderViewSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
<element name="pager" type="block" selector=".pager"/>
2121
<element name="createdDate" type="text" selector=".block-order-details-comments .comment-date"/>
2222
<element name="orderPlacedBy" type="text" selector=".block-order-details-comments .comment-content"/>
23+
<element name="orderComment" type="text" selector=".block-order-details-comments .comment-content"/>
2324
<element name="productName" type="text" selector="//td[@data-th='Product Name']"/>
2425
<element name="productRows" type="text" selector="#my-orders-table tbody tr"/>
2526
<element name="productNameByRow" type="text" parameterized="true" selector="#my-orders-table tbody:nth-of-type({{index}}) td.name"/>

app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminSalesOrderCommentsActionGroup.xml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@
1212
<annotations>
1313
<description>Adding comments on admin sales order details page</description>
1414
</annotations>
15-
<fillField selector="{{AdminSalesOrderCommentsSection.historyComment}}" userInput="{{SalesOrderComments.comment}}" stepKey="fillComment"/>
15+
<arguments>
16+
<argument name="comment" type="string"/>
17+
</arguments>
18+
<fillField selector="{{AdminSalesOrderCommentsSection.historyComment}}" userInput="{{comment}}" stepKey="fillComment"/>
1619
<checkOption selector="{{AdminSalesOrderCommentsSection.historyVisible}}" stepKey="checkVisibleOnStoreFront"/>
1720
<click selector="{{AdminSalesOrderCommentsSection.submitOrderComment}}" stepKey="clickSaveCommentButton"/>
1821
<waitForPageLoad stepKey="waitForSaveComments"/>

app/code/Magento/Sales/Test/Mftf/Data/OrderCommentsData.xml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd">
1111
<entity name="SalesOrderComments" type="order">
12-
<data key="comment">&#x3C;a href=&#x22;https://business.adobe.com/products/magento/magento-commerce.html&#x22;&#x3E;Testing Html Tags&#x3C;/a&#x3E;</data>
12+
<data key="commentWithHyperlink">&#x3C;a href=&#x22;https://business.adobe.com/products/magento/magento-commerce.html&#x22;&#x3E;Testing Html Tags&#x3C;/a&#x3E;</data>
13+
</entity>
14+
<entity name="assertCommentsWithHtmlTags" type="string">
15+
<data key="anchorTag">a href</data>
1316
</entity>
1417
</entities>

app/code/Magento/Sales/Test/Mftf/Test/StorefrontVerifyOrderHistoryCommentsTest.xml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,13 @@
6262
<argument name="orderId" value="{$orderNumber}"/>
6363
</actionGroup>
6464

65-
<actionGroup ref="AdminSalesOrderCommentsActionGroup" stepKey="fillAndSaveOrderComments"/>
65+
<actionGroup ref="AdminSalesOrderCommentsActionGroup" stepKey="fillAndSaveOrderComments">
66+
<argument name="comment" value="{{SalesOrderComments.commentWithHyperlink}}" />
67+
</actionGroup>
6668

6769
<actionGroup ref="StorefrontOpenMyAccountPageActionGroup" stepKey="navigateToCustomerDashboardPage"/>
6870
<actionGroup ref="StorefrontClickViewOrderLinkOnMyOrdersPageActionGroup" stepKey="clickViewOrder"/>
71+
72+
<dontSee userInput="{{assertCommentsWithHtmlTags.anchorTag}}" selector="{{StorefrontCustomerOrderViewSection.orderComment}}" stepKey="dontSeeExposedHtmlCode"/>
6973
</test>
7074
</tests>

0 commit comments

Comments
 (0)