Skip to content

Commit

Permalink
Merge pull request #5960 from magento-engcom/MFTF-green
Browse files Browse the repository at this point in the history
[MFTF] Login as Customer
  • Loading branch information
naydav authored Aug 6, 2020
2 parents 5daadae + 147525d commit 49c6846
Show file tree
Hide file tree
Showing 78 changed files with 2,988 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="StorefrontAssertOnCustomerLoginPageActionGroup">
<annotations>
<description>Assert on the Storefront Customer Sign-In page.</description>
</annotations>

<seeInCurrentUrl url="{{StorefrontCustomerSignInPage.url}}" stepKey="seeOnSignInPage"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="AdminAssertContainsMessageOrderCreatedByAdminActionGroup">
<annotations>
<description>Assert Admin Order page contains message about Order created by a Store Administrator.
</description>
</annotations>
<arguments>
<argument name="orderId" type="string"/>
<argument name="adminUserFullName" type="string"/>
</arguments>

<amOnPage url="{{AdminOrderPage.url(orderId)}}" stepKey="gotoOrderPage"/>
<waitForPageLoad stepKey="waitForPageLoad"/>
<see userInput="Order Placed by {{adminUserFullName}} using Login as Customer"
stepKey="seeMessageOrderCreatedByAdmin"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="AdminAssertLoginAsCustomerConfigNotAvailableDirectlyActionGroup">
<annotations>
<description>Verify Login as Customer config section is not available by direct url.</description>
</annotations>

<amOnPage url="{{AdminLoginAsCustomerConfigPage.url}}" stepKey="navigateToLoginAsCustomerConfigSection"/>
<waitForPageLoad stepKey="waitForPageLoad"/>
<seeInCurrentUrl url="admin/system_config/index" stepKey="seeRedirectToConfigIndexPage"/>
<dontSee userInput="Login as Customer" stepKey="dontSeeLoginAsCustomer"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="AdminAssertLoginAsCustomerConfigNotVisibleActionGroup">
<annotations>
<description>Verify no Login as Customer config section available.</description>
</annotations>

<!-- TODO: update -->
<dontSee userInput="Login as Customer" stepKey="dontSeeLoginAsCustomerItem"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="AdminAssertLoginAsCustomerConfigVisibleActionGroup">
<annotations>
<description>Verify Login as Customer config section available.</description>
</annotations>

<seeElement selector="{{AdminCustomerConfigSection.loginAsCustomerSettingsHead}}" stepKey="seeLoginAsCustomerSettingsHead"/>
<seeElement selector="{{AdminCustomerConfigSection.enableExtensionLabel}}" stepKey="seeEnableExtensionLabel"/>
<seeElement selector="{{AdminCustomerConfigSection.disablePageCacheLabel}}" stepKey="seeDisablePageCacheLabel"/>
<seeElement selector="{{AdminCustomerConfigSection.storeViewToLoginToLabel}}" stepKey="seeStoreViewToLoginToLabel"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="AdminAssertLoginAsCustomerLogRecordActionGroup">
<annotations>
<description>Assert Login as Customer Log record is correct.</description>
</annotations>
<arguments>
<argument name="rowNumber" type="string"/>
<argument name="adminId" type="string"/>
<argument name="customerId" type="string"/>
</arguments>

<seeInCurrentUrl url="{{AdminLoginAsCustomerLogPage.url}}" stepKey="checkUrl"/>
<see selector="{{AdminLoginAsCustomerLogGridSection.adminIdInRow(rowNumber)}}" userInput="{{adminId}}"
stepKey="seeCorrectAdminId"/>
<see selector="{{AdminLoginAsCustomerLogGridSection.customerIdInRow(rowNumber)}}" userInput="{{customerId}}"
stepKey="seeCorrectCustomerId"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="AdminAssertLoginAsCustomerSectionLinkNotAvailableActionGroup">
<annotations>
<description>Verify Login as Customer config section isn't available.</description>
</annotations>

<conditionalClick selector="{{CaptchaFormsDisplayingSection.customer}}" dependentSelector="{{AdminCustomerConfigSection.loginAsCustomerSettingsSectionLink}}" visible="false" stepKey="expandCustomerGroup"/>
<dontSeeElement selector="{{AdminCustomerConfigSection.loginAsCustomerSettingsSectionLink}}" stepKey="dontSeeLoginAsCustomerSettingsLink"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="AdminEditUserRoleActionGroup">
<annotations>
<description>Open User Role resources for edit.</description>
</annotations>
<arguments>
<argument name="roleName" type="string"/>
</arguments>

<amOnPage url="{{AdminRolesPage.url}}" stepKey="navigateToUserRolesGrid"/>
<fillField selector="{{AdminRoleGridSection.roleNameFilterTextField}}" userInput="{{roleName}}"
stepKey="enterRoleName"/>
<click selector="{{AdminDataGridHeaderSection.applyFilters}}" stepKey="clickSearch"/>
<see selector="{{AdminDataGridTableSection.row('1')}}" userInput="{{roleName}}" stepKey="seeUserRole"/>
<click selector="{{AdminDataGridTableSection.row('1')}}" stepKey="openRoleEditPage"/>
<waitForPageLoad stepKey="waitForRoleEditPageLoad"/>
<fillField selector="{{AdminEditRoleInfoSection.password}}" userInput="{{_ENV.MAGENTO_ADMIN_PASSWORD}}" stepKey="enterThePassword" />
<click selector="{{AdminCreateRoleSection.roleResources}}" stepKey="clickToOpenRoleResources"/>
<waitForPageLoad stepKey="waitForRoleResourceTab"/>
<selectOption userInput="Custom" selector="{{AdminCreateRoleSection.resourceAccess}}"
stepKey="selectResourceAccess"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="AdminFilterLoginAsCustomerLogActionGroup">
<annotations>
<description>Filter Login as Customer Log records.</description>
</annotations>
<arguments>
<argument name="adminId" type="string"/>
<argument name="customerId" type="string"/>
</arguments>

<seeInCurrentUrl url="{{AdminLoginAsCustomerLogPage.url}}" stepKey="checkUrl"/>
<click selector="{{AdminLoginAsCustomerLogToolbarSection.resetFilter}}" stepKey="resetFilters"/>
<waitForLoadingMaskToDisappear stepKey="waitForResetFilter"/>
<fillField selector="{{AdminLoginAsCustomerLogFiltersSection.adminId}}" userInput="{{adminId}}"
stepKey="fillAdminId"/>
<fillField selector="{{AdminLoginAsCustomerLogFiltersSection.customerId}}" userInput="{{customerId}}"
stepKey="fillCustomerId"/>
<click selector="{{AdminLoginAsCustomerLogToolbarSection.search}}" stepKey="applyFilters"/>
<waitForLoadingMaskToDisappear stepKey="waitForApplyFilter"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="AdminLoginAsCustomerAbsentOnCustomerPageActionGroup">
<annotations>
<description>Verify Login as Customer Login action is absent on Customer page.</description>
</annotations>
<arguments>
<argument name="customerId" type="string"/>
</arguments>

<amOnPage url="{{AdminEditCustomerPage.url(customerId)}}" stepKey="gotoCustomerPage"/>
<waitForPageLoad stepKey="waitForCustomerPageLoad"/>
<dontSee userInput="Login as Customer" stepKey="dontSeeLoginAsCustomer"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="AdminLoginAsCustomerAbsentOnOrderPageActionGroup">
<annotations>
<description>Verify Login as Customer Login action is absent on Order page.</description>
</annotations>
<arguments>
<argument name="orderId" type="string"/>
</arguments>

<amOnPage url="{{AdminOrderPage.url(orderId)}}" stepKey="gotoOrderPage"/>
<waitForPageLoad stepKey="waitForOrderPageLoad"/>
<dontSee userInput="Login as Customer" stepKey="dontSeeLoginAsCustomer"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="AdminLoginAsCustomerLogAbsentInMenuActionGroup">
<annotations>
<description>Verify Login as Customer is absent in admin menu.</description>
</annotations>

<click selector="{{AdminMenuSection.menuItem(AdminMenuCustomers.dataUiId)}}"
stepKey="clickOnCustomersMenuItem"/>
<dontSeeElement selector="{{AdminMenuSection.menuItem(AdminMenuLoginAsCustomer.dataUiId)}}"
stepKey="dontSeeLoginAsCustomerLog"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="AdminLoginAsCustomerLogPageNotAvailableActionGroup">
<annotations>
<description>Verify Login as Customer is not available by direct url.</description>
</annotations>

<amOnPage url="{{AdminLoginAsCustomerLogPage.url}}" stepKey="openAdminLoginAsCustomerLogPage"/>
<waitForPageLoad stepKey="waitForLoginAsCustomerLogPageLoad"/>
<see userInput="404 Error" selector="{{AdminHeaderSection.pageHeading}}" stepKey="see404PageHeading"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="AdminLoginAsCustomerLoginFromCustomerPageActionGroup">
<annotations>
<description>Verify Login as Customer Login action is works properly from Customer page.</description>
</annotations>
<arguments>
<argument name="customerId" type="string"/>
</arguments>

<amOnPage url="{{AdminEditCustomerPage.url(customerId)}}" stepKey="gotoCustomerPage"/>
<waitForPageLoad stepKey="waitForCustomerPageLoad"/>
<click selector="{{AdminCustomerMainActionsSection.loginAsCustomer}}" stepKey="clickLoginAsCustomerLink"/>
<see selector="{{AdminConfirmationModalSection.title}}" userInput="You are about to Login as Customer"
stepKey="seeModal"/>
<see selector="{{AdminConfirmationModalSection.message}}" userInput="Actions taken while in &quot;Login as Customer&quot; will affect actual customer data." stepKey="seeModalMessage"/>
<click selector="{{AdminConfirmationModalSection.ok}}" stepKey="clickLogin"/>
<switchToNextTab stepKey="switchToNewTab"/>
<waitForPageLoad stepKey="waitForPageLoad"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="AdminLoginAsCustomerLoginFromCustomerPageManualChooseActionGroup">
<annotations>
<description>Verify Login as Customer Login action is works properly from Customer page with manual Store View choose.</description>
</annotations>
<arguments>
<argument name="customerId" type="string"/>
<argument name="storeViewName" type="string" defaultValue="default"/>
</arguments>

<amOnPage url="{{AdminEditCustomerPage.url(customerId)}}" stepKey="gotoCustomerPage"/>
<waitForPageLoad stepKey="waitForCustomerPageLoad"/>
<click selector="{{AdminCustomerMainActionsSection.loginAsCustomer}}" stepKey="clickLoginAsCustomerLink"/>
<see selector="{{AdminConfirmationModalSection.title}}" userInput="Login as Customer: Select Store View" stepKey="seeModal"/>
<see selector="{{AdminConfirmationModalSection.message}}" userInput="Actions taken while in &quot;Login as Customer&quot; will affect actual customer data." stepKey="seeModalMessage"/>
<selectOption selector="{{AdminLoginAsCustomerConfirmationModalSection.storeView}}" userInput="{{storeViewName}}" stepKey="selectStoreView"/>
<click selector="{{AdminConfirmationModalSection.ok}}" stepKey="clickLogin"/>
<switchToNextTab stepKey="switchToNewTab"/>
<waitForPageLoad stepKey="waitForPageLoad"/>
</actionGroup>
</actionGroups>
Loading

0 comments on commit 49c6846

Please sign in to comment.