Skip to content

Commit f7c246b

Browse files
magento/magento2-login-as-customer#150: Opt-in/out - tests fix.
1 parent 92af26b commit f7c246b

26 files changed

+65
-31
lines changed

app/code/Magento/Customer/Test/Mftf/Metadata/CustomerExtensionAttributeMeta.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,12 @@
99
<operations xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataOperation.xsd">
1111
<operation name="CreateCustomerExtensionAttribute" dataType="customer_extension_attribute" type="create">
12+
<field key="assistance_allowed">integer</field>
1213
<field key="is_subscribed">boolean</field>
1314
<field key="extension_attribute">customer_nested_extension_attribute</field>
1415
</operation>
1516
<operation name="UpdateCustomerExtensionAttribute" dataType="customer_extension_attribute" type="update">
17+
<field key="assistance_allowed">integer</field>
1618
<field key="is_subscribed">boolean</field>
1719
<field key="extension_attribute">customer_nested_extension_attribute</field>
1820
</operation>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
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+
<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd">
11+
<entity name="Simple_US_Customer_Assistance_Allowed" type="customer" extends="Simple_US_Customer">
12+
<requiredEntity type="customer_extension_attribute">AssistanceAllowed</requiredEntity>
13+
</entity>
14+
<entity name="Simple_US_CA_Customer_Assistance_Allowed" type="customer" extends="Simple_US_CA_Customer">
15+
<requiredEntity type="customer_extension_attribute">AssistanceAllowed</requiredEntity>
16+
</entity>
17+
</entities>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
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+
<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd">
11+
<entity name="AssistanceDisallowed" type="customer_extension_attribute">
12+
<data key="assistance_allowed">1</data>
13+
</entity>
14+
<entity name="AssistanceAllowed" type="customer_extension_attribute">
15+
<data key="assistance_allowed">2</data>
16+
</entity>
17+
</entities>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
<magentoCLI command="config:set {{LoginAsCustomerStoreViewLogin.path}} 0"
2828
stepKey="enableLoginAsCustomerAutoDetection"/>
2929
<magentoCLI command="cache:flush config" stepKey="flushCacheBeforeTestRun"/>
30-
<createData entity="Simple_US_Customer" stepKey="createCustomer"/>
30+
<createData entity="Simple_US_Customer_Assistance_Allowed" stepKey="createCustomer"/>
3131
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsDefaultAdminUserBefore"/>
3232

3333
<!--Create New Role-->

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
<createData entity="SimpleProduct" stepKey="createSimpleProduct">
2929
<requiredEntity createDataKey="createCategory"/>
3030
</createData>
31-
<createData entity="Simple_US_Customer" stepKey="createCustomer"/>
31+
<createData entity="Simple_US_Customer_Assistance_Allowed" stepKey="createCustomer"/>
3232
<actionGroup ref="AdminLoginActionGroup" stepKey="login"/>
3333
</before>
3434
<after>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<group value="login_as_customer"/>
2121
</annotations>
2222
<before>
23-
<createData entity="Simple_US_Customer" stepKey="createCustomer"/>
23+
<createData entity="Simple_US_Customer_Assistance_Allowed" stepKey="createCustomer"/>
2424
<magentoCLI command="config:set {{LoginAsCustomerConfigDataEnabled.path}} 1"
2525
stepKey="enableLoginAsCustomer"/>
2626
<magentoCLI command="config:set {{LoginAsCustomerStoreViewLogin.path}} 0"

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,14 @@
4242
<argument name="customStore" value="customStoreEN"/>
4343
</actionGroup>
4444
<actionGroup ref="AdminCreateCustomerWithWebSiteAndGroupActionGroup" stepKey="createCustomer">
45-
<argument name="customerData" value="Simple_US_Customer"/>
45+
<argument name="customerData" value="Simple_US_Customer_Assistance_Allowed"/>
4646
<argument name="website" value="{{customWebsite.name}}"/>
4747
<argument name="storeView" value="{{customStoreEN.name}}"/>
4848
</actionGroup>
4949
</before>
5050
<after>
5151
<actionGroup ref="AdminDeleteCustomerActionGroup" stepKey="deleteCustomer">
52-
<argument name="customerEmail" value="Simple_US_Customer.email"/>
52+
<argument name="customerEmail" value="Simple_US_Customer_Assistance_Allowed.email"/>
5353
</actionGroup>
5454
<actionGroup ref="AdminDeleteWebsiteActionGroup" stepKey="deleteWebsite">
5555
<argument name="websiteName" value="{{customWebsite.name}}"/>
@@ -65,7 +65,7 @@
6565

6666
<!-- Login as Customer from Customer page -->
6767
<actionGroup ref="OpenEditCustomerFromAdminActionGroup" stepKey="OpenEditCustomerFrom">
68-
<argument name="customer" value="Simple_US_Customer"/>
68+
<argument name="customer" value="Simple_US_Customer_Assistance_Allowed"/>
6969
</actionGroup>
7070
<grabFromCurrentUrl regex="~id/(\d+)/~" stepKey="customerId" />
7171
<actionGroup ref="AdminLoginAsCustomerLoginFromCustomerPageActionGroup"

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
<magentoCLI command="config:set {{LoginAsCustomerStoreViewLogin.path}} 0"
2525
stepKey="enableLoginAsCustomerAutoDetection"/>
2626
<magentoCLI command="cache:flush config" stepKey="flushCacheBeforeTestRun"/>
27-
<createData entity="Simple_US_Customer" stepKey="createCustomer"/>
27+
<createData entity="Simple_US_Customer_Assistance_Allowed" stepKey="createCustomer"/>
2828
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAdmin"/>
2929
</before>
3030
<after>

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626
stepKey="enableLoginAsCustomerAutoDetection"/>
2727
<magentoCLI command="cache:flush config" stepKey="flushCacheBeforeTestRun"/>
2828
<createData entity="NewAdminUser" stepKey="createNewAdmin"/>
29-
<createData entity="Simple_US_Customer" stepKey="createFirstCustomer"/>
30-
<createData entity="Simple_US_CA_Customer" stepKey="createSecondCustomer"/>
29+
<createData entity="Simple_US_Customer_Assistance_Allowed" stepKey="createFirstCustomer"/>
30+
<createData entity="Simple_US_CA_Customer_Assistance_Allowed" stepKey="createSecondCustomer"/>
3131
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsDefaultUser"/>
3232
</before>
3333
<after>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
</skip>
2424
</annotations>
2525
<before>
26-
<createData entity="Simple_US_Customer" stepKey="createCustomer"/>
26+
<createData entity="Simple_US_Customer_Assistance_Allowed" stepKey="createCustomer"/>
2727
<magentoCLI command="config:set {{LoginAsCustomerConfigDataEnabled.path}} 1"
2828
stepKey="enableLoginAsCustomer"/>
2929
<magentoCLI command="config:set {{LoginAsCustomerStoreViewLogin.path}} 1"

0 commit comments

Comments
 (0)