|
| 1 | +<?xml version="1.0" encoding="UTF-8"?> |
| 2 | +<!-- |
| 3 | + /** |
| 4 | + * Copyright © Magento, Inc. All rights reserved. |
| 5 | + * See COPYING.txt for license details. |
| 6 | + */ |
| 7 | +--> |
| 8 | + |
| 9 | +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> |
| 10 | + <test name="AdminReportsOrderedGroupedBySkuTest"> |
| 11 | + <annotations> |
| 12 | + <title value="Verify grouped by SKU on report"/> |
| 13 | + <description value="Verify the list of configurable product grouped by SKU, on report page 'Reports > Products > Ordered'"/> |
| 14 | + <group value="reports"/> |
| 15 | + </annotations> |
| 16 | + <before> |
| 17 | + <createData entity="_defaultCategory" stepKey="createCategory"/> |
| 18 | + <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> |
| 19 | + <actionGroup ref="CreateConfigurableProductActionGroup" stepKey="createConfigurableProduct"> |
| 20 | + <argument name="product" value="_defaultProduct"/> |
| 21 | + <argument name="category" value="$$createCategory$$"/> |
| 22 | + </actionGroup> |
| 23 | + <createData entity="Simple_US_Customer" stepKey="createCustomer"/> |
| 24 | + </before> |
| 25 | + <after> |
| 26 | + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> |
| 27 | + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> |
| 28 | + <actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteConfigurableProduct"> |
| 29 | + <argument name="sku" value="{{_defaultProduct.sku}}"/> |
| 30 | + </actionGroup> |
| 31 | + <actionGroup ref="DeleteProductAttributeByLabelActionGroup" stepKey="deleteAttributeSet"> |
| 32 | + <argument name="ProductAttribute" value="colorProductAttribute"/> |
| 33 | + </actionGroup> |
| 34 | + <actionGroup ref="logout" stepKey="logout"/> |
| 35 | + </after> |
| 36 | + |
| 37 | + <!--Add first configurable product to order--> |
| 38 | + <actionGroup ref="NavigateToNewOrderPageExistingCustomerActionGroup" stepKey="navigateToFirstOrderWithExistingCustomer"> |
| 39 | + <argument name="customer" value="$$createCustomer$$"/> |
| 40 | + </actionGroup> |
| 41 | + <actionGroup ref="AddConfigurableProductToOrderActionGroup" stepKey="addFirstConfigurableProductToOrder"> |
| 42 | + <argument name="product" value="_defaultProduct"/> |
| 43 | + <argument name="attribute" value="colorProductAttribute"/> |
| 44 | + <argument name="option" value="colorProductAttribute1"/> |
| 45 | + </actionGroup> |
| 46 | + <click selector="{{AdminOrderFormActionSection.SubmitOrder}}" stepKey="submitFirstOrder"/> |
| 47 | + |
| 48 | + <!--Add second configurable product to order--> |
| 49 | + <actionGroup ref="NavigateToNewOrderPageExistingCustomerActionGroup" stepKey="navigateToSecondOrderWithExistingCustomer"> |
| 50 | + <argument name="customer" value="$$createCustomer$$"/> |
| 51 | + </actionGroup> |
| 52 | + <actionGroup ref="AddConfigurableProductToOrderActionGroup" stepKey="addSecondConfigurableProductToOrder"> |
| 53 | + <argument name="product" value="_defaultProduct"/> |
| 54 | + <argument name="attribute" value="colorProductAttribute"/> |
| 55 | + <argument name="option" value="colorProductAttribute2"/> |
| 56 | + </actionGroup> |
| 57 | + <click selector="{{AdminOrderFormActionSection.SubmitOrder}}" stepKey="submitSecondOrder"/> |
| 58 | + |
| 59 | + <!-- Get date --> |
| 60 | + <generateDate stepKey="generateStartDate" date="-1 minute" format="m/d/Y"/> |
| 61 | + <generateDate stepKey="generateEndDate" date="+1 minute" format="m/d/Y"/> |
| 62 | + <actionGroup ref="AdminGenerateProductsOrderedReportActionGroup" stepKey="generateReport"> |
| 63 | + <argument name="orderFromDate" value="$generateStartDate"/> |
| 64 | + <argument name="orderToDate" value="$generateEndDate" /> |
| 65 | + </actionGroup> |
| 66 | + |
| 67 | + <!-- Verify data --> |
| 68 | + <grabTextFrom selector="{{SoldReportFilterSection.gridProduct}}" stepKey="grabData"/> |
| 69 | + <assertContains stepKey="assertFirst"> |
| 70 | + <actualResult type="string">{$grabData}</actualResult> |
| 71 | + <expectedResult type="string">{{_defaultProduct.sku}}-{{colorProductAttribute1.name}}</expectedResult> |
| 72 | + </assertContains> |
| 73 | + <assertContains stepKey="assertSecond"> |
| 74 | + <actualResult type="string">{$grabData}</actualResult> |
| 75 | + <expectedResult type="string">{{_defaultProduct.sku}}-{{colorProductAttribute2.name}}</expectedResult> |
| 76 | + </assertContains> |
| 77 | + </test> |
| 78 | +</tests> |
0 commit comments