Skip to content

Commit 3e06664

Browse files
MFTF update.
1 parent 68242f2 commit 3e06664

5 files changed

+64
-12
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
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="StorefrontAssertCustomerOnStoreViewActionGroup">
12+
<annotations>
13+
<description>Assert Customer is on the provided Store View.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="storeViewName" type="string" defaultValue="Default Store View"/>
17+
</arguments>
18+
19+
<see selector="{{StorefrontHeaderSection.storeViewSwitcher}}" userInput="{{storeViewName}}" stepKey="clickStoreViewSwitcher"/>
20+
</actionGroup>
21+
</actionGroups>

app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/StorefrontAssertLoginAsCustomerLoggedInActionGroup.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@
1717
<argument name="customerEmail" type="string"/>
1818
</arguments>
1919

20-
<amOnPage url="{{StorefrontCustomerDashboardPage.url}}" stepKey="gotoCustomerAccountPage"/>
21-
<waitForPageLoad stepKey="waitForCustomerAccountPageLoad"/>
20+
<seeInCurrentUrl url="{{StorefrontCustomerDashboardPage.url}}" stepKey="assertOnCustomerAccountPage"/>
2221
<see selector="{{StorefrontPanelHeaderSection.welcomeMessage}}" userInput="Welcome, {{customerFullName}}!" stepKey="assertCorrectWelcomeMessage"/>
2322
<see selector="{{StorefrontCustomerDashboardAccountInformationSection.ContactInformation}}"
2423
userInput="{{customerEmail}}" stepKey="assertCustomerEmailInContactInformation"/>

app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerAutoDetectionTest.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818
value="Verify admin user can directly login into customer account to Default store view when Store View To Login In = Auto detection"/>
1919
<severity value="BLOCKER"/>
2020
<group value="login_as_customer"/>
21+
<skip>
22+
<issueId value="https://github.com/magento/magento2-login-as-customer/pull/135"/>
23+
</skip>
2124
</annotations>
2225
<before>
2326
<createData entity="Simple_US_Customer" stepKey="createCustomer"/>
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
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="AdminLoginAsCustomerManualChooseStoreCodeInUrlTest" extends="AdminLoginAsCustomerManualChooseTest">
12+
<annotations>
13+
<features value="Login As Customer"/>
14+
<stories value="Select Store View based on 'Store View To Login In' setting"/>
15+
<title
16+
value="Admin user directly login into customer account with store View To Login In = Manual Choose when store code is added to url"/>
17+
<description
18+
value="Verify admin user can directly login into customer account to Custom store view when Store View To Login In = Manual Choose when store code is added to url"/>
19+
<severity value="CRITICAL"/>
20+
<group value="login_as_customer"/>
21+
</annotations>
22+
<before>
23+
<magentoCLI
24+
command="config:set {{StorefrontEnableAddStoreCodeToUrls.path}} {{StorefrontEnableAddStoreCodeToUrls.value}}"
25+
stepKey="enableAddStoreCodeToUrls" after="enableLoginAsCustomerManualChoose"/>
26+
</before>
27+
<after>
28+
<magentoCLI
29+
command="config:set {{StorefrontDisableAddStoreCodeToUrls.path}} {{StorefrontDisableAddStoreCodeToUrls.value}}"
30+
stepKey="disableAddStoreCodeToUrls" after="enableLoginAsCustomerAutoDetection"/>
31+
</after>
32+
<actionGroup ref="AssertStorefrontStoreCodeInUrlActionGroup" stepKey="seeCustomStoreCodeInUrl" after="assertCustomStoreView">
33+
<argument name="storeCode" value="{{customStore.code}}"/>
34+
</actionGroup>
35+
</test>
36+
</tests>

app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerManualChooseTest.xml

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,11 @@
2828
stepKey="enableLoginAsCustomer"/>
2929
<magentoCLI command="config:set {{LoginAsCustomerStoreViewLogin.path}} 1"
3030
stepKey="enableLoginAsCustomerManualChoose"/>
31-
<magentoCLI
32-
command="config:set {{StorefrontEnableAddStoreCodeToUrls.path}} {{StorefrontEnableAddStoreCodeToUrls.value}}"
33-
stepKey="enableAddStoreCodeToUrls"/>
3431
<magentoCLI command="cache:flush config" stepKey="flushCacheBeforeTestRun"/>
3532
<actionGroup ref="AdminLoginActionGroup" stepKey="adminLogin"/>
3633
<actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createCustomStoreView"/>
3734
</before>
3835
<after>
39-
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/>
4036
<actionGroup ref="AdminDeleteStoreViewActionGroup" stepKey="deleteCustomStoreView">
4137
<argument name="customStore" value="customStore"/>
4238
</actionGroup>
@@ -45,10 +41,8 @@
4541
stepKey="disableLoginAsCustomer"/>
4642
<magentoCLI command="config:set {{LoginAsCustomerStoreViewLogin.path}} 0"
4743
stepKey="enableLoginAsCustomerAutoDetection"/>
48-
<magentoCLI
49-
command="config:set {{StorefrontDisableAddStoreCodeToUrls.path}} {{StorefrontDisableAddStoreCodeToUrls.value}}"
50-
stepKey="disableAddStoreCodeToUrls"/>
5144
<magentoCLI command="cache:flush config" stepKey="flushCacheAfterTestRun"/>
45+
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/>
5246
</after>
5347

5448
<!-- Login As Customer from Customer page -->
@@ -63,9 +57,8 @@
6357
<argument name="customerFullName" value="$$createCustomer.firstname$$ $$createCustomer.lastname$$"/>
6458
<argument name="customerEmail" value="$$createCustomer.email$$"/>
6559
</actionGroup>
66-
<actionGroup ref="StorefrontClickOnHeaderLogoActionGroup" stepKey="clickOnStorefrontHeaderLogo"/>
67-
<actionGroup ref="AssertStorefrontStoreCodeInUrlActionGroup" stepKey="seeCustomStoreCodeInUrl">
68-
<argument name="storeCode" value="{{customStore.code}}"/>
60+
<actionGroup ref="StorefrontAssertCustomerOnStoreViewActionGroup" stepKey="assertCustomStoreView">
61+
<argument name="storeViewName" value="{{customStore.name}}"/>
6962
</actionGroup>
7063

7164
<!-- Log out Customer and close tab -->

0 commit comments

Comments
 (0)