Skip to content

Commit 727a055

Browse files
committed
MC-43161: "Invalid security or form key. Please refresh the page" error message after login with custom backend frontname and URL secret key enabled.
1 parent 3d262f8 commit 727a055

File tree

3 files changed

+32
-5
lines changed

3 files changed

+32
-5
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AdminAssertNoErrorMessageActionGroup">
12+
<dontSeeElement selector="{{AdminMessagesSection.error}}" stepKey="dontSeeErrorMessage"/>
13+
</actionGroup>
14+
</actionGroups>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AdminClickLogoutActionGroup">
12+
<grabAttributeFrom selector="{{AdminHeaderSection.signOut}}" userInput="href" stepKey="logoutUrl"/>
13+
<amOnPage url="{$logoutUrl}" stepKey="logout2"/>
14+
</actionGroup>
15+
</actionGroups>

app/code/Magento/Backend/Test/Mftf/Test/AdminRedirectToStartupPageAfterLoginIfSecretKeyEnabledTest.xml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,9 @@
3030
</after>
3131

3232
<!-- Assert succesful login without any error message -->
33-
<dontSeeElement selector="{{AdminMessagesSection.error}}" stepKey="dontSeeErrorMessage1"/>
33+
<actionGroup ref="AdminAssertNoErrorMessageActionGroup" stepKey="dontSeeErrorMessage1"/>
3434
<!-- Assert current page is dashboard -->
3535
<seeCurrentUrlMatches regex="~\/admin\/dashboard\/~" stepKey="seeCurrentUrlMatchesDashboardUrl"/>
36-
<grabFromCurrentUrl stepKey="dashboardUrl"/>
3736
<!-- Navigate to web configuration -->
3837
<actionGroup ref="AdminNavigateMenuActionGroup" stepKey="navigateToFindPartnersAndExtensions">
3938
<argument name="menuUiId" value="magento-backend-stores"/>
@@ -45,14 +44,13 @@
4544
<!-- Grab current URL -->
4645
<grabFromCurrentUrl stepKey="webConfigurationUrl"/>
4746
<!-- Logout -->
48-
<grabAttributeFrom selector="{{AdminHeaderSection.signOut}}" userInput="href" stepKey="logoutUrl"/>
49-
<amOnPage url="{$logoutUrl}" stepKey="logout2"/>
47+
<actionGroup ref="AdminClickLogoutActionGroup" stepKey="logout2"/>
5048
<!-- Login with directt url -->
5149
<actionGroup ref="AdminLoginWithCustomUrlActionGroup" stepKey="loginAndRedirectToRequestedPage">
5250
<argument name="customUrl" value="$webConfigurationUrl"/>
5351
</actionGroup>
5452
<!-- Assert succesful login without any error message -->
55-
<dontSeeElement selector="{{AdminMessagesSection.error}}" stepKey="dontSeeErrorMessage2"/>
53+
<actionGroup ref="AdminAssertNoErrorMessageActionGroup" stepKey="dontSeeErrorMessage2"/>
5654
<!-- Assert current page is dashboard -->
5755
<seeCurrentUrlMatches regex="~\/admin\/dashboard\/~" stepKey="seeCurrentUrlMatchesDashboardUrl2"/>
5856
</test>

0 commit comments

Comments
 (0)