Skip to content

[MFTF] Refactoring StorefrontVerifyOrderHistoryCommentsTest #33667

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2 changes: 1 addition & 1 deletion app/code/Magento/Quote/Test/Mftf/Data/CustomerCartData.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,5 @@
<entity name="GetOrderData" type="CustomerCart">
<var key="cart_id" entityKey="return" entityType="CustomerCart"/>
</entity>

</entities>
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
<test name="StorefrontVerifyOrderHistoryCommentsWithHTMLTagsTest">
<annotations>
<features value="Sales"/>
<stories value="Storefront Customer Order History Comments"/>
<title value="Verify Customer Order History Comments On Storefront"/>
<description value="Verify that comment with HTML tag is displayed properly on the Order View Page on Storefront"/>
<testCaseId value="MC-42694"/>
<useCaseId value="MC-42531"/>
<severity value="MINOR"/>
<group value="Sales"/>
</annotations>
<before>
<createData entity="Simple_US_Customer" stepKey="createCustomer"/>
<createData entity="SimpleProduct2" stepKey="createProduct"/>
<createData entity="CustomerCart" stepKey="createCustomerCart">
<requiredEntity createDataKey="createCustomer"/>
</createData>
<createData entity="CustomerCartItem" stepKey="addCartItem">
<requiredEntity createDataKey="createCustomerCart"/>
<requiredEntity createDataKey="createProduct"/>
</createData>
<createData entity="CustomerAddressInformation" stepKey="addCustomerOrderAddress">
<requiredEntity createDataKey="createCustomerCart"/>
</createData>
<updateData createDataKey="createCustomerCart" entity="CustomerOrderPaymentMethod" stepKey="submitOrder">
<requiredEntity createDataKey="createCustomerCart"/>
</updateData>
</before>
<after>
<actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="customerLogout"/>
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/>
<deleteData createDataKey="createProduct" stepKey="deleteProduct"/>
</after>

<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>

<actionGroup ref="AdminOpenOrderViewPageByOrderIdActionGroup" stepKey="openOrder">
<argument name="orderId" value="$createCustomerCart.return$"/>
</actionGroup>

<actionGroup ref="AdminSalesOrderCommentsActionGroup" stepKey="fillAndSaveOrderComments">
<argument name="comment" value="{{SalesOrderComments.commentWithHyperlink}}" />
</actionGroup>

<actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginToStorefront">
<argument name="Customer" value="$$createCustomer$$"/>
</actionGroup>

<actionGroup ref="StorefrontClickViewOrderLinkOnMyOrdersPageActionGroup" stepKey="clickViewOrder"/>

<dontSee userInput="{{anchorTagFragment.anchorTag}}" selector="{{StorefrontCustomerOrderViewSection.orderComment}}" stepKey="dontSeeExposedHtmlCode"/>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think can move to action group

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@edenduong I checked - there are no more tests that use this assertion. Do you think we still need create a separate Action Group here?
Thanks.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AnnaAPak It could be groundwork for the future :)

</test>
</tests>
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
<useCaseId value="MC-42531"/>
<severity value="MINOR"/>
<group value="Sales"/>
<skip>
<issueId value="DEPRECATED">Use StorefrontOrderCommentWithHTMLTagsDisplayTest instead</issueId>
</skip>
</annotations>
<before>
<!-- Create customer -->
Expand Down