Skip to content

Commit b532d4e

Browse files
magento/magento2-login-as-customer#58: If multiple stores exist under a specific website, user is logged into the default website for that store - MFTF tests fix.
1 parent 268382f commit b532d4e

5 files changed

+23
-17
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@
1414
</annotations>
1515
<arguments>
1616
<argument name="customerId" type="string"/>
17-
<argument name="storeViewName" type="string" defaultValue="default"/>
17+
<argument name="storeName" type="string" defaultValue="default"/>
1818
</arguments>
1919

2020
<amOnPage url="{{AdminEditCustomerPage.url(customerId)}}" stepKey="gotoCustomerPage"/>
2121
<waitForPageLoad stepKey="waitForCustomerPageLoad"/>
2222
<click selector="{{AdminCustomerMainActionsSection.loginAsCustomer}}" stepKey="clickLoginAsCustomerLink"/>
2323
<see selector="{{AdminConfirmationModalSection.title}}" userInput="Login as Customer: Select Store" stepKey="seeModal"/>
24-
<see selector="{{AdminConfirmationModalSection.message}}" userInput="Actions taken while in &quot;Login as Customer&quot; will affect actual customer data." stepKey="seeModalMessage"/>
25-
<selectOption selector="{{AdminLoginAsCustomerConfirmationModalSection.storeView}}" userInput="{{storeViewName}}" stepKey="selectStoreView"/>
24+
<see selector="{{AdminConfirmationModalSection.message}}" userInput="Actions taken while in &quot;Login as Customer&quot; will affect actual customer data." stepKey="seeModalMessage"/>
25+
<selectOption selector="{{AdminLoginAsCustomerConfirmationModalSection.store}}" userInput="{{storeName}}" stepKey="selectStore"/>
2626
<click selector="{{AdminConfirmationModalSection.ok}}" stepKey="clickLogin"/>
2727
<switchToNextTab stepKey="switchToNewTab"/>
2828
<waitForPageLoad stepKey="waitForPageLoad"/>

app/code/Magento/LoginAsCustomer/Test/Mftf/Section/AdminLoginAsCustomerConfirmationModalSection.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@
99
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
1111
<section name="AdminLoginAsCustomerConfirmationModalSection">
12-
<element name="storeView" type="select" selector="//select[@id='lac-confirmation-popup-store-id']"/>
12+
<element name="store" type="select" selector="//select[@id='lac-confirmation-popup-store-id']"/>
1313
</section>
1414
</sections>

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@
2929
command="config:set {{StorefrontDisableAddStoreCodeToUrls.path}} {{StorefrontDisableAddStoreCodeToUrls.value}}"
3030
stepKey="disableAddStoreCodeToUrls" after="enableLoginAsCustomerAutoDetection"/>
3131
</after>
32-
<actionGroup ref="AssertStorefrontStoreCodeInUrlActionGroup" stepKey="seeCustomStoreCodeInUrl" after="assertCustomStoreView">
33-
<argument name="storeCode" value="{{customStore.code}}"/>
32+
<actionGroup ref="AssertStorefrontStoreCodeInUrlActionGroup" stepKey="seeCustomStoreViewCodeInUrl" after="assertCustomStoreView">
33+
<argument name="storeCode" value="{{customStoreEN.code}}"/>
3434
</actionGroup>
3535
</test>
3636
</tests>

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

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,6 @@
1818
value="Verify admin user can directly login into customer account to Custom store view when Store View To Login In = Manual Choose"/>
1919
<severity value="CRITICAL"/>
2020
<group value="login_as_customer"/>
21-
<skip>
22-
<issueId value="https://github.com/magento/magento2-login-as-customer/issues/58"/>
23-
</skip>
2421
</annotations>
2522
<before>
2623
<createData entity="Simple_US_Customer_Assistance_Allowed" stepKey="createCustomer"/>
@@ -30,11 +27,23 @@
3027
stepKey="enableLoginAsCustomerManualChoose"/>
3128
<magentoCLI command="cache:flush config" stepKey="flushCacheBeforeTestRun"/>
3229
<actionGroup ref="AdminLoginActionGroup" stepKey="adminLogin"/>
33-
<actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createCustomStoreView"/>
30+
<actionGroup ref="AdminCreateNewStoreGroupActionGroup" stepKey="createCustomStore">
31+
<argument name="website" value="{{_defaultWebsite.name}}"/>
32+
<argument name="storeGroupName" value="{{customStoreGroup.name}}"/>
33+
<argument name="storeGroupCode" value="{{customStoreGroup.code}}"/>
34+
</actionGroup>
35+
<actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createFirstCustomStoreView">
36+
<argument name="StoreGroup" value="customStoreGroup"/>
37+
<argument name="customStore" value="customStoreEN"/>
38+
</actionGroup>
39+
<actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createSecondCustomStoreView">
40+
<argument name="StoreGroup" value="customStoreGroup"/>
41+
<argument name="customStore" value="customStoreFR"/>
42+
</actionGroup>
3443
</before>
3544
<after>
36-
<actionGroup ref="AdminDeleteStoreViewActionGroup" stepKey="deleteCustomStoreView">
37-
<argument name="customStore" value="customStore"/>
45+
<actionGroup ref="DeleteCustomStoreActionGroup" stepKey="deleteCustomStore">
46+
<argument name="storeGroupName" value="customStoreGroup.name"/>
3847
</actionGroup>
3948
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
4049
<magentoCLI command="config:set {{LoginAsCustomerConfigDataEnabled.path}} 0"
@@ -49,7 +58,7 @@
4958
<actionGroup ref="AdminLoginAsCustomerLoginFromCustomerPageManualChooseActionGroup"
5059
stepKey="loginAsCustomerFromCustomerPage">
5160
<argument name="customerId" value="$$createCustomer.id$$"/>
52-
<argument name="storeViewName" value="{{customStore.name}}"/>
61+
<argument name="storeName" value="{{customStoreGroup.name}}"/>
5362
</actionGroup>
5463

5564
<!-- Assert Customer logged on on custom store view -->
@@ -58,7 +67,7 @@
5867
<argument name="customerEmail" value="$$createCustomer.email$$"/>
5968
</actionGroup>
6069
<actionGroup ref="StorefrontAssertCustomerOnStoreViewActionGroup" stepKey="assertCustomStoreView">
61-
<argument name="storeViewName" value="{{customStore.name}}"/>
70+
<argument name="storeViewName" value="{{customStoreEN.name}}"/>
6271
</actionGroup>
6372

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

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@
1616
<description value="Login as customer sees special prices on category"/>
1717
<severity value="CRITICAL"/>
1818
<group value="login_as_customer"/>
19-
<skip>
20-
<issueId value="https://github.com/magento/magento2-login-as-customer/pull/193"/>
21-
</skip>
2219
</annotations>
2320
<before>
2421
<magentoCLI command="config:set {{LoginAsCustomerConfigDataEnabled.path}} 1"

0 commit comments

Comments
 (0)