Skip to content

Commit 70cab94

Browse files
magento2-login-as-customer/issues/35: "Verify that UI elements are present and links are working if 'Login as customer' functionality enabled" test added.
1 parent 4f0a514 commit 70cab94

17 files changed

+313
-2
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
<!-- Verify Login As Customer Login action is absent on Customer grid page -->
1212
<actionGroup name="AdminLoginAsCustomerAbsentOnCustomerGridPageActionGroup">
1313
<amOnPage url="{{AdminCustomerPage.url}}" stepKey="gotoCustomerGridPage"/>
14+
<waitForPageLoad stepKey="waitForCustomerGridPageLoad"/>
1415
<dontSee userInput="Login As Customer" stepKey="dontSeeLoginAsCustomer"/>
1516
</actionGroup>
1617
</actionGroups>

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,10 @@
1111
<!-- Verify Login As Customer Login action is absent on Customer page -->
1212
<actionGroup name="AdminLoginAsCustomerAbsentOnCustomerPageActionGroup">
1313
<arguments>
14-
<argument name="customerId"/>
14+
<argument name="customerId" type="string"/>
1515
</arguments>
1616
<amOnPage url="{{AdminEditCustomerPage.url(customerId)}}" stepKey="gotoCustomerPage"/>
17+
<waitForPageLoad stepKey="waitForCustomerPageLoad"/>
1718
<dontSee userInput="Login As Customer" stepKey="dontSeeLoginAsCustomer"/>
1819
</actionGroup>
1920
</actionGroups>

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
<!-- Verify Login As Customer Login action is absent on Order grid page -->
1212
<actionGroup name="AdminLoginAsCustomerAbsentOnOrderGridPageActionGroup">
1313
<amOnPage url="{{AdminOrdersPage.url}}" stepKey="gotoOrderGridPage"/>
14+
<waitForPageLoad stepKey="waitForOrderGridPageLoad"/>
1415
<dontSee userInput="Login As Customer" stepKey="dontSeeLoginAsCustomer"/>
1516
</actionGroup>
1617
</actionGroups>

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,10 @@
1111
<!-- Verify Login As Customer Login action is absent on Order page -->
1212
<actionGroup name="AdminLoginAsCustomerAbsentOnOrderPageActionGroup">
1313
<arguments>
14-
<argument name="orderId"/>
14+
<argument name="orderId" type="string"/>
1515
</arguments>
1616
<amOnPage url="{{AdminOrderPage.url(orderId)}}" stepKey="gotoOrderPage"/>
17+
<waitForPageLoad stepKey="waitForOrderPageLoad"/>
1718
<dontSee userInput="Login As Customer" stepKey="dontSeeLoginAsCustomer"/>
1819
</actionGroup>
1920
</actionGroups>

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
<!-- Verify Login As Customer is not available by direct url -->
1212
<actionGroup name="AdminLoginAsCustomerLogPageNotAvailableActionGroup">
1313
<amOnPage url="{{AdminLoginAsCustomerLogPage.url}}" stepKey="openAdminLoginAsCustomerLogPage"/>
14+
<waitForPageLoad stepKey="waitForLoginAsCustomerLogPageLoad"/>
1415
<see selector="{{AdminHeaderSection.pageHeading}}" userInput="404 Error" stepKey="see404PageHeading"/>
1516
</actionGroup>
1617
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
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+
<!-- Verify Login As Customer Login action is works properly from Customer grid page -->
12+
<actionGroup name="AdminLoginAsCustomerLoginFromCustomerGirdPageActionGroup">
13+
<arguments>
14+
<argument name="customerEmail" type="string"/>
15+
</arguments>
16+
<amOnPage url="{{AdminCustomerPage.url}}" stepKey="gotoCustomerGridPage"/>
17+
<waitForPageLoad stepKey="waitForCustomerGridPageLoad"/>
18+
<click selector="{{AdminCustomerGridSection.customerLoginAsCustomerLinkByEmail(customerEmail)}}" stepKey="clickLoginAsCustomerLink"/>
19+
<switchToNextTab stepKey="switchToNewTab"/>
20+
<waitForElementVisible selector="{{StorefrontCMSPageSection.mainTitle}}" stepKey="waitForPageLoad"/>
21+
</actionGroup>
22+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
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+
<!-- Verify Login As Customer Login action is works properly from Customer page -->
12+
<actionGroup name="AdminLoginAsCustomerLoginFromCustomerPageActionGroup">
13+
<arguments>
14+
<argument name="customerId" type="string"/>
15+
</arguments>
16+
<amOnPage url="{{AdminEditCustomerPage.url(customerId)}}" stepKey="gotoCustomerPage"/>
17+
<waitForPageLoad stepKey="waitForCustomerPageLoad"/>
18+
<click selector="{{AdminCustomerMainActionsSection.loginAsCustomer}}" stepKey="clickLoginAsCustomerLink"/>
19+
<switchToNextTab stepKey="switchToNewTab"/>
20+
<waitForPageLoad stepKey="waitForPageLoad"/>
21+
</actionGroup>
22+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
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+
<!-- Verify Login As Customer Login action is works properly from Order grid page -->
12+
<actionGroup name="AdminLoginAsCustomerLoginFromOrderGridPageActionGroup">
13+
<arguments>
14+
<argument name="orderId" type="string"/>
15+
</arguments>
16+
<amOnPage url="{{AdminOrdersPage.url}}" stepKey="gotoOrderGridPage"/>
17+
<waitForPageLoad stepKey="waitForOrderGridPageLoad"/>
18+
<click selector="{{AdminOrdersGridSection.loginAsCustomerLink(orderId)}}" stepKey="clickLoginAsCustomerLink"/>
19+
<switchToNextTab stepKey="switchToNewTab"/>
20+
<waitForPageLoad stepKey="waitForPageLoad"/>
21+
</actionGroup>
22+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
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+
<!-- Verify Login As Customer Login action is works properly from Order grid page -->
12+
<actionGroup name="AdminLoginAsCustomerLoginFromOrderPageActionGroup">
13+
<arguments>
14+
<argument name="orderId" type="string"/>
15+
</arguments>
16+
<amOnPage url="{{AdminOrderPage.url(orderId)}}" stepKey="gotoOrderPage"/>
17+
<waitForPageLoad stepKey="waitForOrderPageLoad"/>
18+
<click selector="{{AdminOrderDetailsMainActionsSection.loginAsCustomer}}" stepKey="clickLoginAsCustomerLink"/>
19+
<switchToNextTab stepKey="switchToNewTab"/>
20+
<waitForPageLoad stepKey="waitForPageLoad"/>
21+
</actionGroup>
22+
</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+
<!-- Verify Admin successfully logged in as Customer -->
12+
<actionGroup name="StorefrontAssertLoginAsCustomerLoggedInActionGroup">
13+
<arguments>
14+
<argument name="customerFullName" type="string"/>
15+
<argument name="customerEmail" type="string"/>
16+
</arguments>
17+
<seeInCurrentUrl url="{{StorefrontLoginAsCustomerLoginProceedPage.url}}" stepKey="assertOnProceedPage"/>
18+
<!-- TODO: uncomment after fix -->
19+
<!-- <seeInTitle userInput="You are logged in." stepKey="assertYouAreLoggedInInTitle"/>-->
20+
<see selector="{{StorefrontCMSPageSection.mainTitle}}" userInput="You are logged in."
21+
stepKey="assertYouAreLoggedInOnPage"/>
22+
<!-- TODO: uncomment after fix -->
23+
<!-- <see selector="{{LoggedInCustomerHeaderLinksSection.customerDropdownMenu}}" userInput="Welcome, {{customerFullName}}!" stepKey="assertCorrectWelcomeMessage"/>-->
24+
<amOnPage url="{{StorefrontCustomerDashboardPage.url}}" stepKey="gotoCustomerAccountPage"/>
25+
<waitForPageLoad stepKey="waitForCustomerAccountPageLoad"/>
26+
<see selector="{{StorefrontCustomerDashboardAccountInformationSection.ContactInformation}}"
27+
userInput="{{customerEmail}}" stepKey="assertCustomerEmailInContactInformation"/>
28+
</actionGroup>
29+
</actionGroups>

0 commit comments

Comments
 (0)