|
| 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 | + <!-- Login as a customer --> |
| 25 | + <actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginToStorefrontAccount"> |
| 26 | + <argument name="Customer" value="$createCustomer$"/> |
| 27 | + </actionGroup> |
| 28 | + <!-- Add product to cart and place the order--> |
| 29 | + <actionGroup ref="StorefrontOpenProductEntityPageActionGroup" stepKey="openProductPage"> |
| 30 | + <argument name="product" value="$createSimpleProduct$"/> |
| 31 | + </actionGroup> |
| 32 | + <actionGroup ref="StorefrontProductPageAddSimpleProductToCartActionGroup" stepKey="addSimpleProductToCart"/> |
| 33 | + <actionGroup ref="StorefrontOpenCheckoutPageActionGroup" stepKey="clickToProceedToCheckout"/> |
| 34 | + <actionGroup ref="StorefrontSetShippingMethodActionGroup" stepKey="selectFlatRateShippingMethod"/> |
| 35 | + <actionGroup ref="StorefrontCheckoutClickNextOnShippingStepActionGroup" stepKey="clickNextOnShippingStep"/> |
| 36 | + <actionGroup ref="CheckoutSelectCheckMoneyOrderPaymentActionGroup" stepKey="selectCheckMoneyOrder"/> |
| 37 | + <actionGroup ref="ClickPlaceOrderActionGroup" stepKey="clickPlaceOrder"/> |
| 38 | + </before> |
| 39 | + <after> |
| 40 | + <actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="logoutCustomer" /> |
| 41 | + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> |
| 42 | + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> |
| 43 | + <deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/> |
| 44 | + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> |
| 45 | + </after> |
| 46 | + <!--Step 1 & 2: Go to REPORTS > Products > Ordered and select a date range for which the product was sold. --> |
| 47 | + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> |
| 48 | + <generateDate stepKey="generateStartDate" date="-1 minute" format="m/d/Y"/> |
| 49 | + <generateDate stepKey="generateEndDate" date="+1 minute" format="m/d/Y"/> |
| 50 | + <actionGroup ref="AdminGenerateProductsOrderedReportActionGroup" stepKey="NavigateToProductOrderedReportAndGenerateReport"> |
| 51 | + <argument name="orderFromDate" value="$generateStartDate"/> |
| 52 | + <argument name="orderToDate" value="$generateEndDate" /> |
| 53 | + </actionGroup> |
| 54 | + <!-- Verify data --> |
| 55 | + <grabTextFrom selector="{{SoldReportFilterSection.gridProduct}}" stepKey="grabData"/> |
| 56 | + <assertStringContainsString stepKey="assertFirst"> |
| 57 | + <actualResult type="string">{$grabData}</actualResult> |
| 58 | + <expectedResult type="string">{{SimpleProduct2.sku}}</expectedResult> |
| 59 | + </assertStringContainsString> |
| 60 | + <!--Step 3: Click on Export and verify there is no error while we are exporting --> |
| 61 | + <waitForElementClickable selector="{{OrderReportMainSection.exportBtn}}" stepKey="waitForExportBtn"/> |
| 62 | + <click selector="{{OrderReportMainSection.exportBtn}}" stepKey="clickOnExportBtn"/> |
| 63 | + <waitForElementNotVisible selector="{{AdminCartPriceRulesFormSection.errorMessage}}" stepKey="verifyThereIsNoErrorWhileExportingOrderedReport"/> |
| 64 | + </test> |
| 65 | +</tests> |
0 commit comments