|
| 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="AdminRedirectToStartupPageAfterLoginIfSecretKeyEnabledTest"> |
| 12 | + <annotations> |
| 13 | + <features value="Backend"/> |
| 14 | + <stories value="Login on the Admin Backend"/> |
| 15 | + <title value="Admin should not be redirected to the requested page after login if secret key is enabled"/> |
| 16 | + <description value="Admin should not be redirected to the requested page after login if secret key is enabled"/> |
| 17 | + <severity value="AVERAGE"/> |
| 18 | + <testCaseId value="AC-1145"/> |
| 19 | + <useCaseId value="MC-43161"/> |
| 20 | + <group value="backend"/> |
| 21 | + </annotations> |
| 22 | + <before> |
| 23 | + <!-- Add Secret Key to URLs --> |
| 24 | + <magentoCLI command="config:set admin/security/use_form_key 1" stepKey="enableUrlSecretKeys"/> |
| 25 | + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> |
| 26 | + </before> |
| 27 | + <after> |
| 28 | + <magentoCLI command="config:set admin/security/use_form_key 0" stepKey="disableUrlSecretKeys"/> |
| 29 | + <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutFromAdmin"/> |
| 30 | + </after> |
| 31 | + |
| 32 | + <!-- Assert succesful login without any error message --> |
| 33 | + <dontSeeElement selector="{{AdminMessagesSection.error}}" stepKey="dontSeeErrorMessage1"/> |
| 34 | + <!-- Assert current page is dashboard --> |
| 35 | + <seeCurrentUrlMatches regex="~\/admin\/dashboard\/~" stepKey="seeCurrentUrlMatchesDashboardUrl"/> |
| 36 | + <grabFromCurrentUrl stepKey="dashboardUrl"/> |
| 37 | + <!-- Navigate to web configuration --> |
| 38 | + <actionGroup ref="AdminNavigateMenuActionGroup" stepKey="navigateToFindPartnersAndExtensions"> |
| 39 | + <argument name="menuUiId" value="magento-backend-stores"/> |
| 40 | + <argument name="submenuUiId" value="magento-config-system-config"/> |
| 41 | + </actionGroup> |
| 42 | + <actionGroup ref="AdminOpenConfigNavItemActionGroup" stepKey="navigateToWebConfig"> |
| 43 | + <argument name="navItem" value="Web" /> |
| 44 | + </actionGroup> |
| 45 | + <!-- Grab current URL --> |
| 46 | + <grabFromCurrentUrl stepKey="webConfigurationUrl"/> |
| 47 | + <!-- Logout --> |
| 48 | + <grabAttributeFrom selector="{{AdminHeaderSection.signOut}}" userInput="href" stepKey="logoutUrl"/> |
| 49 | + <amOnPage url="{$logoutUrl}" stepKey="logout2"/> |
| 50 | + <!-- Login with directt url --> |
| 51 | + <actionGroup ref="AdminLoginWithCustomUrlActionGroup" stepKey="loginAndRedirectToRequestedPage"> |
| 52 | + <argument name="customUrl" value="$webConfigurationUrl"/> |
| 53 | + </actionGroup> |
| 54 | + <!-- Assert succesful login without any error message --> |
| 55 | + <dontSeeElement selector="{{AdminMessagesSection.error}}" stepKey="dontSeeErrorMessage2"/> |
| 56 | + <!-- Assert current page is dashboard --> |
| 57 | + <seeCurrentUrlMatches regex="~\/admin\/dashboard\/~" stepKey="seeCurrentUrlMatchesDashboardUrl2"/> |
| 58 | + </test> |
| 59 | +</tests> |
0 commit comments