Skip to content

Commit 49c6846

Browse files
authored
Merge pull request #5960 from magento-engcom/MFTF-green
[MFTF] Login as Customer
2 parents 5daadae + 147525d commit 49c6846

File tree

78 files changed

+2988
-4
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+2988
-4
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
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="StorefrontAssertOnCustomerLoginPageActionGroup">
12+
<annotations>
13+
<description>Assert on the Storefront Customer Sign-In page.</description>
14+
</annotations>
15+
16+
<seeInCurrentUrl url="{{StorefrontCustomerSignInPage.url}}" stepKey="seeOnSignInPage"/>
17+
</actionGroup>
18+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
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="AdminAssertContainsMessageOrderCreatedByAdminActionGroup">
12+
<annotations>
13+
<description>Assert Admin Order page contains message about Order created by a Store Administrator.
14+
</description>
15+
</annotations>
16+
<arguments>
17+
<argument name="orderId" type="string"/>
18+
<argument name="adminUserFullName" type="string"/>
19+
</arguments>
20+
21+
<amOnPage url="{{AdminOrderPage.url(orderId)}}" stepKey="gotoOrderPage"/>
22+
<waitForPageLoad stepKey="waitForPageLoad"/>
23+
<see userInput="Order Placed by {{adminUserFullName}} using Login as Customer"
24+
stepKey="seeMessageOrderCreatedByAdmin"/>
25+
</actionGroup>
26+
</actionGroups>
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="AdminAssertLoginAsCustomerConfigNotAvailableDirectlyActionGroup">
12+
<annotations>
13+
<description>Verify Login as Customer config section is not available by direct url.</description>
14+
</annotations>
15+
16+
<amOnPage url="{{AdminLoginAsCustomerConfigPage.url}}" stepKey="navigateToLoginAsCustomerConfigSection"/>
17+
<waitForPageLoad stepKey="waitForPageLoad"/>
18+
<seeInCurrentUrl url="admin/system_config/index" stepKey="seeRedirectToConfigIndexPage"/>
19+
<dontSee userInput="Login as Customer" stepKey="dontSeeLoginAsCustomer"/>
20+
</actionGroup>
21+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
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="AdminAssertLoginAsCustomerConfigNotVisibleActionGroup">
12+
<annotations>
13+
<description>Verify no Login as Customer config section available.</description>
14+
</annotations>
15+
16+
<!-- TODO: update -->
17+
<dontSee userInput="Login as Customer" stepKey="dontSeeLoginAsCustomerItem"/>
18+
</actionGroup>
19+
</actionGroups>
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="AdminAssertLoginAsCustomerConfigVisibleActionGroup">
12+
<annotations>
13+
<description>Verify Login as Customer config section available.</description>
14+
</annotations>
15+
16+
<seeElement selector="{{AdminCustomerConfigSection.loginAsCustomerSettingsHead}}" stepKey="seeLoginAsCustomerSettingsHead"/>
17+
<seeElement selector="{{AdminCustomerConfigSection.enableExtensionLabel}}" stepKey="seeEnableExtensionLabel"/>
18+
<seeElement selector="{{AdminCustomerConfigSection.disablePageCacheLabel}}" stepKey="seeDisablePageCacheLabel"/>
19+
<seeElement selector="{{AdminCustomerConfigSection.storeViewToLoginToLabel}}" stepKey="seeStoreViewToLoginToLabel"/>
20+
</actionGroup>
21+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
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="AdminAssertLoginAsCustomerLogRecordActionGroup">
12+
<annotations>
13+
<description>Assert Login as Customer Log record is correct.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="rowNumber" type="string"/>
17+
<argument name="adminId" type="string"/>
18+
<argument name="customerId" type="string"/>
19+
</arguments>
20+
21+
<seeInCurrentUrl url="{{AdminLoginAsCustomerLogPage.url}}" stepKey="checkUrl"/>
22+
<see selector="{{AdminLoginAsCustomerLogGridSection.adminIdInRow(rowNumber)}}" userInput="{{adminId}}"
23+
stepKey="seeCorrectAdminId"/>
24+
<see selector="{{AdminLoginAsCustomerLogGridSection.customerIdInRow(rowNumber)}}" userInput="{{customerId}}"
25+
stepKey="seeCorrectCustomerId"/>
26+
</actionGroup>
27+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
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="AdminAssertLoginAsCustomerSectionLinkNotAvailableActionGroup">
12+
<annotations>
13+
<description>Verify Login as Customer config section isn't available.</description>
14+
</annotations>
15+
16+
<conditionalClick selector="{{CaptchaFormsDisplayingSection.customer}}" dependentSelector="{{AdminCustomerConfigSection.loginAsCustomerSettingsSectionLink}}" visible="false" stepKey="expandCustomerGroup"/>
17+
<dontSeeElement selector="{{AdminCustomerConfigSection.loginAsCustomerSettingsSectionLink}}" stepKey="dontSeeLoginAsCustomerSettingsLink"/>
18+
</actionGroup>
19+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
10+
<actionGroup name="AdminEditUserRoleActionGroup">
11+
<annotations>
12+
<description>Open User Role resources for edit.</description>
13+
</annotations>
14+
<arguments>
15+
<argument name="roleName" type="string"/>
16+
</arguments>
17+
18+
<amOnPage url="{{AdminRolesPage.url}}" stepKey="navigateToUserRolesGrid"/>
19+
<fillField selector="{{AdminRoleGridSection.roleNameFilterTextField}}" userInput="{{roleName}}"
20+
stepKey="enterRoleName"/>
21+
<click selector="{{AdminDataGridHeaderSection.applyFilters}}" stepKey="clickSearch"/>
22+
<see selector="{{AdminDataGridTableSection.row('1')}}" userInput="{{roleName}}" stepKey="seeUserRole"/>
23+
<click selector="{{AdminDataGridTableSection.row('1')}}" stepKey="openRoleEditPage"/>
24+
<waitForPageLoad stepKey="waitForRoleEditPageLoad"/>
25+
<fillField selector="{{AdminEditRoleInfoSection.password}}" userInput="{{_ENV.MAGENTO_ADMIN_PASSWORD}}" stepKey="enterThePassword" />
26+
<click selector="{{AdminCreateRoleSection.roleResources}}" stepKey="clickToOpenRoleResources"/>
27+
<waitForPageLoad stepKey="waitForRoleResourceTab"/>
28+
<selectOption userInput="Custom" selector="{{AdminCreateRoleSection.resourceAccess}}"
29+
stepKey="selectResourceAccess"/>
30+
</actionGroup>
31+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
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="AdminFilterLoginAsCustomerLogActionGroup">
12+
<annotations>
13+
<description>Filter Login as Customer Log records.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="adminId" type="string"/>
17+
<argument name="customerId" type="string"/>
18+
</arguments>
19+
20+
<seeInCurrentUrl url="{{AdminLoginAsCustomerLogPage.url}}" stepKey="checkUrl"/>
21+
<click selector="{{AdminLoginAsCustomerLogToolbarSection.resetFilter}}" stepKey="resetFilters"/>
22+
<waitForLoadingMaskToDisappear stepKey="waitForResetFilter"/>
23+
<fillField selector="{{AdminLoginAsCustomerLogFiltersSection.adminId}}" userInput="{{adminId}}"
24+
stepKey="fillAdminId"/>
25+
<fillField selector="{{AdminLoginAsCustomerLogFiltersSection.customerId}}" userInput="{{customerId}}"
26+
stepKey="fillCustomerId"/>
27+
<click selector="{{AdminLoginAsCustomerLogToolbarSection.search}}" stepKey="applyFilters"/>
28+
<waitForLoadingMaskToDisappear stepKey="waitForApplyFilter"/>
29+
</actionGroup>
30+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
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="AdminLoginAsCustomerAbsentOnCustomerPageActionGroup">
12+
<annotations>
13+
<description>Verify Login as Customer Login action is absent on Customer page.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="customerId" type="string"/>
17+
</arguments>
18+
19+
<amOnPage url="{{AdminEditCustomerPage.url(customerId)}}" stepKey="gotoCustomerPage"/>
20+
<waitForPageLoad stepKey="waitForCustomerPageLoad"/>
21+
<dontSee userInput="Login as Customer" stepKey="dontSeeLoginAsCustomer"/>
22+
</actionGroup>
23+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
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="AdminLoginAsCustomerAbsentOnOrderPageActionGroup">
12+
<annotations>
13+
<description>Verify Login as Customer Login action is absent on Order page.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="orderId" type="string"/>
17+
</arguments>
18+
19+
<amOnPage url="{{AdminOrderPage.url(orderId)}}" stepKey="gotoOrderPage"/>
20+
<waitForPageLoad stepKey="waitForOrderPageLoad"/>
21+
<dontSee userInput="Login as Customer" stepKey="dontSeeLoginAsCustomer"/>
22+
</actionGroup>
23+
</actionGroups>
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="AdminLoginAsCustomerLogAbsentInMenuActionGroup">
12+
<annotations>
13+
<description>Verify Login as Customer is absent in admin menu.</description>
14+
</annotations>
15+
16+
<click selector="{{AdminMenuSection.menuItem(AdminMenuCustomers.dataUiId)}}"
17+
stepKey="clickOnCustomersMenuItem"/>
18+
<dontSeeElement selector="{{AdminMenuSection.menuItem(AdminMenuLoginAsCustomer.dataUiId)}}"
19+
stepKey="dontSeeLoginAsCustomerLog"/>
20+
</actionGroup>
21+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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="AdminLoginAsCustomerLogPageNotAvailableActionGroup">
12+
<annotations>
13+
<description>Verify Login as Customer is not available by direct url.</description>
14+
</annotations>
15+
16+
<amOnPage url="{{AdminLoginAsCustomerLogPage.url}}" stepKey="openAdminLoginAsCustomerLogPage"/>
17+
<waitForPageLoad stepKey="waitForLoginAsCustomerLogPageLoad"/>
18+
<see userInput="404 Error" selector="{{AdminHeaderSection.pageHeading}}" stepKey="see404PageHeading"/>
19+
</actionGroup>
20+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
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="AdminLoginAsCustomerLoginFromCustomerPageActionGroup">
12+
<annotations>
13+
<description>Verify Login as Customer Login action is works properly from Customer page.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="customerId" type="string"/>
17+
</arguments>
18+
19+
<amOnPage url="{{AdminEditCustomerPage.url(customerId)}}" stepKey="gotoCustomerPage"/>
20+
<waitForPageLoad stepKey="waitForCustomerPageLoad"/>
21+
<click selector="{{AdminCustomerMainActionsSection.loginAsCustomer}}" stepKey="clickLoginAsCustomerLink"/>
22+
<see selector="{{AdminConfirmationModalSection.title}}" userInput="You are about to Login as Customer"
23+
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+
<click selector="{{AdminConfirmationModalSection.ok}}" stepKey="clickLogin"/>
26+
<switchToNextTab stepKey="switchToNewTab"/>
27+
<waitForPageLoad stepKey="waitForPageLoad"/>
28+
</actionGroup>
29+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
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="AdminLoginAsCustomerLoginFromCustomerPageManualChooseActionGroup">
12+
<annotations>
13+
<description>Verify Login as Customer Login action is works properly from Customer page with manual Store View choose.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="customerId" type="string"/>
17+
<argument name="storeViewName" type="string" defaultValue="default"/>
18+
</arguments>
19+
20+
<amOnPage url="{{AdminEditCustomerPage.url(customerId)}}" stepKey="gotoCustomerPage"/>
21+
<waitForPageLoad stepKey="waitForCustomerPageLoad"/>
22+
<click selector="{{AdminCustomerMainActionsSection.loginAsCustomer}}" stepKey="clickLoginAsCustomerLink"/>
23+
<see selector="{{AdminConfirmationModalSection.title}}" userInput="Login as Customer: Select Store View" 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"/>
26+
<click selector="{{AdminConfirmationModalSection.ok}}" stepKey="clickLogin"/>
27+
<switchToNextTab stepKey="switchToNewTab"/>
28+
<waitForPageLoad stepKey="waitForPageLoad"/>
29+
</actionGroup>
30+
</actionGroups>

0 commit comments

Comments
 (0)