|
| 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" |
| 10 | + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> |
| 11 | + <test name="StorefrontRetainLocalCacheStorageTest"> |
| 12 | + <annotations> |
| 13 | + <features value="Customer"/> |
| 14 | + <stories value="Local cache storage is not retained for the expected period."/> |
| 15 | + <title value="Verify that Local cache storage is retained for the expected period."/> |
| 16 | + <description value="Verify that Local cache storage is retained for the expected period."/> |
| 17 | + <severity value="AVERAGE"/> |
| 18 | + <testCaseId value="AC-3635"/> |
| 19 | + <group value="customer"/> |
| 20 | + </annotations> |
| 21 | + <before> |
| 22 | + <createData entity="Simple_US_Customer" stepKey="createCustomer"/> |
| 23 | + <magentoCLI command="config:set general/locale/timezone UTC" stepKey="setTimezone"/> |
| 24 | + </before> |
| 25 | + <after> |
| 26 | + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> |
| 27 | + <magentoCLI command="config:set general/locale/timezone America/Los_Angeles" stepKey="setTimezone"/> |
| 28 | + <!--Restore default configuration settings.--> |
| 29 | + <magentoCLI command="config:set {{DefaultWebCookieLifetimeConfigData.path}} {{DefaultWebCookieLifetimeConfigData.value}}" stepKey="setDefaultCookieLifetime"/> |
| 30 | + <!--Clear cache and perform reindex--> |
| 31 | + <magentoCLI command="indexer:reindex" stepKey="performReindex"/> |
| 32 | + <magentoCLI command="cache:clean" stepKey="cleanCache"/> |
| 33 | + <magentoCLI command="cache:flush" stepKey="flushCache"/> |
| 34 | + </after> |
| 35 | + <!--Login to storefront from customer--> |
| 36 | + <actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginCustomer"> |
| 37 | + <argument name="Customer" value="$$createCustomer$$"/> |
| 38 | + </actionGroup> |
| 39 | + <see userInput="Welcome, $$createCustomer.firstname$$ $$createCustomer.lastname$$!" selector="{{StorefrontPanelHeaderSection.welcomeMessage}}" stepKey="checkWelcomeMessage"/> |
| 40 | + |
| 41 | + <!--Grab timezone offset--> |
| 42 | + <executeJS function="return new Date().getTimezoneOffset();" stepKey="getTimezoneOffset"/> |
| 43 | + <actionGroup ref="StorefrontVerifyCustomerDefaultCookieExpiryDateActionGroup" stepKey="VerifyCookiesExpiryDate"> |
| 44 | + <argument name="timezoneOffset" value="{$getTimezoneOffset}"/> |
| 45 | + </actionGroup> |
| 46 | + |
| 47 | + <!--Logout customer before in case of it logged in from previous test--> |
| 48 | + <actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="customerLogoutStorefront"/> |
| 49 | + |
| 50 | + <!--Login as admin--> |
| 51 | + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> |
| 52 | + <actionGroup ref="AssertAdminSuccessLoginActionGroup" stepKey="assertLoggedIn"/> |
| 53 | + |
| 54 | + <!--Clear browser locale storage for magento site--> |
| 55 | + <resetCookie userInput="section_data_ids" stepKey="resetCookieForMagentoCacheSectionDataIds"/> |
| 56 | + <resetCookie userInput="mage-cache-sessid" stepKey="resetCookieForMagentoCacheSessionId"/> |
| 57 | + <resetCookie userInput="mage-cache-storage" stepKey="resetCookieForMagentoCacheStorage"/> |
| 58 | + |
| 59 | + <!--Set-Cookie Lifetime to 30 days (2592000) under Stores > Configuration > General > Web > Default Cookie Settings--> |
| 60 | + <actionGroup ref="AdminNavigateToDefaultCookieSettingsActionGroup" stepKey="goToCurrencySetupPage"/> |
| 61 | + <!--Ensure the checkbox `use system value` is unchecked.--> |
| 62 | + <uncheckOption selector="{{AdminDefaultCookieSettingsSection.DefaultCookieLifetimeSystemValueCheckbox}}" stepKey="uncheckCheckboxForSystemValue"/> |
| 63 | + <fillField userInput="2592000" selector="{{AdminDefaultCookieSettingsSection.DefaultCookieLifetime}}" stepKey="fillDefaultLabel"/> |
| 64 | + <click selector="{{AdminDefaultCookieSettingsSection.Save}}" stepKey="clickSaveConfig"/> |
| 65 | + |
| 66 | + <!--Clear cache and perform reindex--> |
| 67 | + <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> |
| 68 | + <argument name="indices" value=""/> |
| 69 | + </actionGroup> |
| 70 | + <actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanInvalidatedCaches"> |
| 71 | + <argument name="tags" value=""/> |
| 72 | + </actionGroup> |
| 73 | + <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutFromAdmin"/> |
| 74 | + |
| 75 | + <!--Login storefront again using registered customer credentials--> |
| 76 | + <actionGroup ref="StorefrontOpenCustomerLoginPageActionGroup" stepKey="goToSignInPage"/> |
| 77 | + <actionGroup ref="StorefrontFillCustomerLoginFormActionGroup" stepKey="fillLoginFormWithCustomerData"> |
| 78 | + <argument name="customer" value="$$createCustomer$$"/> |
| 79 | + </actionGroup> |
| 80 | + <actionGroup ref="StorefrontClickSignOnCustomerLoginFormActionGroup" stepKey="clickSignInAccountButtonFirstAttempt"/> |
| 81 | + |
| 82 | + <!--Grab current timezone offset after 30 days--> |
| 83 | + <executeJS function="return {$getTimezoneOffset} + (30*24*60);" stepKey="getTimezoneOffsetAfterReset"/> |
| 84 | + <actionGroup ref="StorefrontVerifyCustomerDefaultCookieExpiryDateActionGroup" stepKey="VerifyCookiesExpiryDateAfterReset"> |
| 85 | + <argument name="timezoneOffset" value="{$getTimezoneOffsetAfterReset}"/> |
| 86 | + </actionGroup> |
| 87 | + </test> |
| 88 | +</tests> |
0 commit comments