Skip to content

Commit 4c2fb8c

Browse files
committed
ACQE-8231: Admin can export ordered product report without facing any errors
- Added new test file and one new element
1 parent ebedc8a commit 4c2fb8c

File tree

2 files changed

+73
-4
lines changed

2 files changed

+73
-4
lines changed

app/code/Magento/Reports/Test/Mftf/Section/OrderReportMainSection/OrderReportMainSection.xml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!--
3-
/**
4-
* Copyright © Magento, Inc. All rights reserved.
5-
* See COPYING.txt for license details.
6-
*/
3+
/**
4+
* Copyright 2025 Adobe
5+
* All Rights Reserved.
6+
*/
77
-->
88
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
99
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
@@ -17,5 +17,6 @@
1717
<element name="fromDatePickerText" type="text" selector="span#gridTotalsCustomer_period_date_from_advice"/>
1818
<element name="toDatePicker" type="button" selector="//input[@name='report_to']/following-sibling::button"/>
1919
<element name="toDatePickerText" type="text" selector="span#gridTotalsCustomer_period_date_to_advice"/>
20+
<element name="exportBtn" type="button" selector="//button[@title='Export']"/>
2021
</section>
2122
</sections>
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright 2025 Adobe
5+
* All Rights Reserved.
6+
*/
7+
-->
8+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
9+
<test name="AdminCanExportOrderedProductsReportTest">
10+
<annotations>
11+
<features value="Report"/>
12+
<stories value="Export ordered product report"/>
13+
<title value="Admin can export ordered product report"/>
14+
<description value="Verify admin can export ordered product report without facing any errors"/>
15+
<severity value="MINOR"/>
16+
<testCaseId value="AC-13249"/>
17+
<group value="reports"/>
18+
</annotations>
19+
<before>
20+
<!-- Pre-condition -->
21+
<createData entity="_defaultCategory" stepKey="createCategory"/>
22+
<createData entity="SimpleProduct2" stepKey="createSimpleProduct"/>
23+
<createData entity="Simple_US_Customer" stepKey="createCustomer"/>
24+
<actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex">
25+
<argument name="indices" value=""/>
26+
</actionGroup>
27+
<!-- Login as a customer -->
28+
<actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginToStorefrontAccount">
29+
<argument name="Customer" value="$createCustomer$"/>
30+
</actionGroup>
31+
<!-- Add product to cart and place the order-->
32+
<actionGroup ref="StorefrontOpenProductEntityPageActionGroup" stepKey="openProductPage">
33+
<argument name="product" value="$createSimpleProduct$"/>
34+
</actionGroup>
35+
<actionGroup ref="StorefrontProductPageAddSimpleProductToCartActionGroup" stepKey="addSimpleProductToCart"/>
36+
<actionGroup ref="StorefrontOpenCheckoutPageActionGroup" stepKey="clickToProceedToCheckout"/>
37+
<actionGroup ref="StorefrontSetShippingMethodActionGroup" stepKey="selectFlatRateShippingMethod"/>
38+
<actionGroup ref="StorefrontCheckoutClickNextOnShippingStepActionGroup" stepKey="clickNextOnShippingStep"/>
39+
<actionGroup ref="CheckoutSelectCheckMoneyOrderPaymentActionGroup" stepKey="selectCheckMoneyOrder"/>
40+
<actionGroup ref="ClickPlaceOrderActionGroup" stepKey="clickPlaceOrder"/>
41+
</before>
42+
<after>
43+
<actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="logoutCustomer" />
44+
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/>
45+
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
46+
<deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/>
47+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
48+
</after>
49+
<!--Step 1 & 2: Go to REPORTS > Products > Ordered and select a date range for which the product was sold. -->
50+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
51+
<generateDate stepKey="generateStartDate" date="-1 minute" format="m/d/Y"/>
52+
<generateDate stepKey="generateEndDate" date="+1 minute" format="m/d/Y"/>
53+
<actionGroup ref="AdminGenerateProductsOrderedReportActionGroup" stepKey="NavigateToProductOrderedReportAndGenerateReport">
54+
<argument name="orderFromDate" value="$generateStartDate"/>
55+
<argument name="orderToDate" value="$generateEndDate" />
56+
</actionGroup>
57+
<!-- Verify data -->
58+
<grabTextFrom selector="{{SoldReportFilterSection.gridProduct}}" stepKey="grabData"/>
59+
<assertStringContainsString stepKey="assertFirst">
60+
<actualResult type="string">{$grabData}</actualResult>
61+
<expectedResult type="string">{{SimpleProduct2.sku}}</expectedResult>
62+
</assertStringContainsString>
63+
<!--Step 3: Click on Export and verify there is no error while we are exporting -->
64+
<waitForElementClickable selector="{{OrderReportMainSection.exportBtn}}" stepKey="waitForExportBtn"/>
65+
<click selector="{{OrderReportMainSection.exportBtn}}" stepKey="clickOnExportBtn"/>
66+
<waitForElementNotVisible selector="{{AdminCartPriceRulesFormSection.errorMessage}}" stepKey="verifyThereIsNoErrorWhileExportingOrderedReport"/>
67+
</test>
68+
</tests>

0 commit comments

Comments
 (0)