|
| 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="AdminProductGridFilteringByDateWithCustomLocaleTest"> |
| 11 | + <annotations> |
| 12 | + <features value="Catalog"/> |
| 13 | + <stories value="Filter products"/> |
| 14 | + <title value="Product grid date filters does not work for en_GB locale"/> |
| 15 | + <description value="Product grid date filters does not work for en_GB locale"/> |
| 16 | + <severity value="CRITICAL"/> |
| 17 | + <testCaseId value="MC-40644"/> |
| 18 | + <useCaseId value="MC-40240"/> |
| 19 | + <group value="catalog"/> |
| 20 | + </annotations> |
| 21 | + |
| 22 | + <before> |
| 23 | + <!-- Deploy static content with United Kingdom locale--> |
| 24 | + <magentoCLI command="setup:static-content:deploy en_GB" stepKey="deployStaticContentWithUnitedKingdomLocale"/> |
| 25 | + <createData entity="_defaultCategory" stepKey="createCategory"/> |
| 26 | + <createData entity="SimpleProduct" stepKey="createProduct"> |
| 27 | + <requiredEntity createDataKey="createCategory"/> |
| 28 | + </createData> |
| 29 | + |
| 30 | + <!-- Create new User --> |
| 31 | + <actionGroup ref="AdminLoginActionGroup" stepKey="adminLogin"/> |
| 32 | + <actionGroup ref="AdminCreateUserWithRoleAndLocaleActionGroup" stepKey="createAdminUser"> |
| 33 | + <argument name="user" value="activeAdmin"/> |
| 34 | + <argument name="role" value="roleDefaultAdministrator"/> |
| 35 | + <argument name="interfaceLocale" value="en_GB"/> |
| 36 | + </actionGroup> |
| 37 | + </before> |
| 38 | + <after> |
| 39 | + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> |
| 40 | + <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> |
| 41 | + <actionGroup ref="DeleteProductAttributeActionGroup" stepKey="deleteAttribute"> |
| 42 | + <argument name="ProductAttribute" value="dateProductAttribute"/> |
| 43 | + </actionGroup> |
| 44 | + <actionGroup ref="AdminGridFilterResetActionGroup" stepKey="resetGridFilter"/> |
| 45 | + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> |
| 46 | + </after> |
| 47 | + |
| 48 | + <!-- Generate date for use as default value, needs to be MM/d/YYYY and mm/d/yy --> |
| 49 | + <generateDate date="now" format="m/j/Y" stepKey="generateDefaultDate"/> |
| 50 | + <generateDate date="now" format="j/m/Y" stepKey="generateDefaultDateGB"/> |
| 51 | + |
| 52 | + <!-- Navigate to Stores > Attributes > Product. --> |
| 53 | + <actionGroup ref="AdminOpenProductAttributePageActionGroup" stepKey="goToProductAttributes"/> |
| 54 | + |
| 55 | + <!-- Create new Product Attribute as TextField, with code and default value. --> |
| 56 | + <actionGroup ref="CreateProductAttributeWithDateFieldActionGroup" stepKey="createAttribute"> |
| 57 | + <argument name="attribute" value="dateProductAttribute"/> |
| 58 | + <argument name="date" value="{$generateDefaultDate}"/> |
| 59 | + </actionGroup> |
| 60 | + |
| 61 | + <!-- Go to default attribute set edit page --> |
| 62 | + <amOnPage url="{{AdminProductAttributeSetEditPage.url}}/{{AddToDefaultSet.attributeSetId}}/" stepKey="onAttributeSetEdit"/> |
| 63 | + <!-- Assert created attribute in unassigned section --> |
| 64 | + <see userInput="{{dateProductAttribute.attribute_code}}" selector="{{AdminProductAttributeSetEditSection.unassignedAttributesTree}}" stepKey="seeAttributeInUnassigned"/> |
| 65 | + <!-- Assign attribute to a group --> |
| 66 | + <actionGroup ref="AssignAttributeToGroupActionGroup" stepKey="assignAttributeToGroup"> |
| 67 | + <argument name="group" value="Product Details"/> |
| 68 | + <argument name="attribute" value="{{dateProductAttribute.attribute_code}}"/> |
| 69 | + </actionGroup> |
| 70 | + <!-- Assert attribute in a group --> |
| 71 | + <see userInput="{{dateProductAttribute.attribute_code}}" selector="{{AdminProductAttributeSetEditSection.groupTree}}" stepKey="seeAttributeInGroup"/> |
| 72 | + <!-- Save attribute set --> |
| 73 | + <actionGroup ref="SaveAttributeSetActionGroup" stepKey="SaveAttributeSet"/> |
| 74 | + |
| 75 | + <!-- Open Product Edit Page and set custom attribute value --> |
| 76 | + <actionGroup ref="SearchForProductOnBackendActionGroup" stepKey="searchForProduct"> |
| 77 | + <argument name="product" value="$createProduct$"/> |
| 78 | + </actionGroup> |
| 79 | + <actionGroup ref="OpenEditProductOnBackendActionGroup" stepKey="openEditProduct"> |
| 80 | + <argument name="product" value="$createProduct$"/> |
| 81 | + </actionGroup> |
| 82 | + <fillField selector="{{AdminProductFormSection.newAddedAttributeInput(dateProductAttribute.attribute_code)}}" userInput="{$generateDefaultDate}" stepKey="fillCustomDateValue"/> |
| 83 | + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> |
| 84 | + |
| 85 | + <!-- Logout master admin and Login as new User --> |
| 86 | + <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutMasterAdmin"/> |
| 87 | + <actionGroup ref="AdminLoginActionGroup" stepKey="loginToNewAdmin"> |
| 88 | + <argument name="username" value="{{activeAdmin.username}}"/> |
| 89 | + <argument name="password" value="{{activeAdmin.password}}"/> |
| 90 | + </actionGroup> |
| 91 | + |
| 92 | + <!-- Open Product Index Page and filter the product --> |
| 93 | + <actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="navigateToProductIndex2"/> |
| 94 | + <actionGroup ref="FilterProductGridByCustomDateRangeActionGroup" stepKey="filterProductGridByCustomDateRange"> |
| 95 | + <argument name="code" value="{{dateProductAttribute.attribute_code}}"/> |
| 96 | + <argument name="date" value="{$generateDefaultDateGB}"/> |
| 97 | + </actionGroup> |
| 98 | + <!-- Check products filtering --> |
| 99 | + <see selector="{{AdminProductGridSection.productGridNameProduct($createProduct.name$)}}" userInput="$createProduct.name$" stepKey="seeProductName"/> |
| 100 | + </test> |
| 101 | +</tests> |
0 commit comments