|
| 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 | +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| 9 | + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> |
| 10 | + <test name="AdminCheckingDateAfterChangeFrenchCanadaInterfaceLocaleTest"> |
| 11 | + <annotations> |
| 12 | + <features value="Ui"/> |
| 13 | + <stories value="Invalid date-time format in the admin order grid for French local"/> |
| 14 | + <title value="Checking date format in orders grid column after changing admin interface locale to French(Canada)"/> |
| 15 | + <description value="Checking date format in orders grid column after changing admin interface locale to French(Canada)"/> |
| 16 | + <severity value="MAJOR"/> |
| 17 | + <testCaseId value="AC-2623"/> |
| 18 | + <useCaseId value="ACP2E-362"/> |
| 19 | + <group value="backend"/> |
| 20 | + <group value="ui"/> |
| 21 | + <group value="sales"/> |
| 22 | + </annotations> |
| 23 | + <before> |
| 24 | + <!--Deploy static content with French(Canada) locale--> |
| 25 | + <magentoCLI command="setup:static-content:deploy fr_CA" stepKey="deployStaticContentWithFrenchLocale"/> |
| 26 | + <!--Create entities--> |
| 27 | + <createData entity="SimpleProduct2" stepKey="createProduct"/> |
| 28 | + <createData entity="Simple_US_Customer" stepKey="createCustomer"/> |
| 29 | + <!--Login to Admin page--> |
| 30 | + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> |
| 31 | + </before> |
| 32 | + <after> |
| 33 | + <!--Delete entities--> |
| 34 | + <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> |
| 35 | + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> |
| 36 | + <!--Set Admin "Interface Locale" to default value--> |
| 37 | + <actionGroup ref="SetAdminAccountActionGroup" stepKey="setAdminInterfaceLocaleToDefaultValue"> |
| 38 | + <argument name="InterfaceLocaleByValue" value="en_US"/> |
| 39 | + </actionGroup> |
| 40 | + <!--Clear filters--> |
| 41 | + <actionGroup ref="AdminOrdersGridClearFiltersActionGroup" stepKey="clearOrderFilters"/> |
| 42 | + <!--Logout from Admin page--> |
| 43 | + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> |
| 44 | + </after> |
| 45 | + |
| 46 | + <!--Create order--> |
| 47 | + <actionGroup ref="CreateOrderActionGroup" stepKey="createOrder"> |
| 48 | + <argument name="product" value="$$createProduct$$"/> |
| 49 | + <argument name="customer" value="$$createCustomer$$"/> |
| 50 | + </actionGroup> |
| 51 | + <grabTextFrom selector="{{AdminOrderDetailsInformationSection.orderId}}" stepKey="grabOrderId"/> |
| 52 | + |
| 53 | + <!--Filter orders grid by ID on Admin page--> |
| 54 | + <actionGroup ref="FilterOrderGridByIdActionGroup" stepKey="filterOrderGridById"> |
| 55 | + <argument name="orderId" value="{$grabOrderId}"/> |
| 56 | + </actionGroup> |
| 57 | + |
| 58 | + <!--Get date from "Purchase Date" column--> |
| 59 | + <grabTextFrom selector="{{AdminOrdersGridSection.gridCell('1','Purchase Date')}}" stepKey="grabPurchaseDateInDefaultLocale"/> |
| 60 | + |
| 61 | + <!--Get month name in default locale (US)--> |
| 62 | + <executeJS function="return (new Date('{$grabPurchaseDateInDefaultLocale}').toLocaleDateString('en-US', {month: 'short'}))" stepKey="getMonthNameInUS"/> |
| 63 | + |
| 64 | + <!--Checking Date with default "Interface Locale"--> |
| 65 | + <assertStringContainsString stepKey="checkingDateWithDefaultInterfaceLocale"> |
| 66 | + <expectedResult type="variable">getMonthNameInUS</expectedResult> |
| 67 | + <actualResult type="variable">grabPurchaseDateInDefaultLocale</actualResult> |
| 68 | + </assertStringContainsString> |
| 69 | + |
| 70 | + <!--Set Admin "Interface Locale" to "Français (Canada) / français (Canada)"--> |
| 71 | + <actionGroup ref="SetAdminAccountActionGroup" stepKey="setAdminInterfaceLocaleToFrance"> |
| 72 | + <argument name="InterfaceLocaleByValue" value="fr_CA"/> |
| 73 | + </actionGroup> |
| 74 | + |
| 75 | + <!--Filter orders grid by ID on Admin page after changing "Interface Locale"--> |
| 76 | + <actionGroup ref="FilterOrderGridByIdActionGroup" stepKey="filterOrderGridByIdAfterSetFrenchLocale"> |
| 77 | + <argument name="orderId" value="{$grabOrderId}"/> |
| 78 | + </actionGroup> |
| 79 | + |
| 80 | + <!--Get date from "Purchase Date" column after changing "Interface Locale"--> |
| 81 | + <grabTextFrom selector="{{AdminOrdersGridSection.gridCell('1','Purchase Date')}}" stepKey="grabPurchaseDateInFrenchLocale"/> |
| 82 | + |
| 83 | + <!--Get month name in French--> |
| 84 | + <executeJS function="return (new Date('{$grabPurchaseDateInDefaultLocale}').toLocaleDateString('fr-CA', {month: 'short'}))" stepKey="getMonthNameInFrench"/> |
| 85 | + |
| 86 | + <!--Checking Date after changing "Interface Locale"--> |
| 87 | + <assertStringContainsString stepKey="checkingDateAfterChangeInterfaceLocale"> |
| 88 | + <expectedResult type="variable">getMonthNameInFrench</expectedResult> |
| 89 | + <actualResult type="variable">grabPurchaseDateInFrenchLocale</actualResult> |
| 90 | + </assertStringContainsString> |
| 91 | + </test> |
| 92 | +</tests> |
0 commit comments