Skip to content

Commit 804ed71

Browse files
refactoring MFTF test
1 parent 00b3ff2 commit 804ed71

6 files changed

+84
-92
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
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="StorefrontAssertStickyLoginAsCustomerNotificationBannerActionGroup">
12+
<annotations>
13+
<description>Verify Sticky Login as Customer notification banner present on page.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="customerFullName" type="string"/>
17+
<argument name="websiteName" type="string" defaultValue="Main Website"/>
18+
</arguments>
19+
20+
<waitForElementVisible selector="{{StorefrontLoginAsCustomerNotificationSection.notificationText}}" stepKey="waitForNotificationBanner"/>
21+
<see selector="{{StorefrontLoginAsCustomerNotificationSection.notificationText}}"
22+
userInput="You are connected as {{customerFullName}} on {{websiteName}}"
23+
stepKey="assertCorrectNotificationBannerMessage"/>
24+
<seeElement selector="{{StorefrontLoginAsCustomerNotificationSection.closeLink}}"
25+
stepKey="assertCloseNotificationBannerPresent"/>
26+
<executeJS function="window.scrollTo(0,document.body.scrollHeight);" stepKey="scrollToBottomOfPage"/>
27+
<see selector="{{StorefrontLoginAsCustomerNotificationSection.notificationText}}"
28+
userInput="You are connected as {{customerFullName}} on {{websiteName}}"
29+
stepKey="assertCorrectNotificationBannerMessageAfterScroll"/>
30+
<seeElement selector="{{StorefrontLoginAsCustomerNotificationSection.closeLink}}"
31+
stepKey="assertCloseNotificationBannerPresentAfterScroll"/>
32+
</actionGroup>
33+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
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+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
11+
<test name="StorefrontStickyLoginAsCustomerNotificationBannerTest">
12+
<annotations>
13+
<features value="Login as Customer"/>
14+
<useCaseId value="https://github.com/magento/magento2/issues/29354"/>
15+
<stories value="Availability of sticky UI elements if module enable/disable"/>
16+
<title value="Sticky Notification Banner is present on Storefront page"/>
17+
<description
18+
value="Verify that Sticky Notification Banner is present on page if 'Login as customer' functionality used"/>
19+
<testCaseId value=""/>
20+
<severity value="CRITICAL"/>
21+
</annotations>
22+
<before>
23+
<magentoCLI command="config:set {{LoginAsCustomerConfigDataEnabled.path}} 1"
24+
stepKey="enableLoginAsCustomer"/>
25+
<actionGroup ref="CliCacheFlushActionGroup" stepKey="flushConfigCache">
26+
<argument name="tags" value="config"/>
27+
</actionGroup>
28+
<createData entity="Simple_US_Customer" stepKey="createCustomer"/>
29+
<actionGroup ref="AdminLoginActionGroup" stepKey="login"/>
30+
</before>
31+
32+
<after>
33+
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/>
34+
<magentoCLI command="config:set {{LoginAsCustomerConfigDataEnabled.path}} 0"
35+
stepKey="disableLoginAsCustomer"/>
36+
<actionGroup ref="CliCacheFlushActionGroup" stepKey="flushConfigCache">
37+
<argument name="tags" value="config"/>
38+
</actionGroup>
39+
</after>
40+
41+
<actionGroup ref="AdminLoginAsCustomerLoginFromCustomerPageActionGroup" stepKey="loginAsCustomerFromCustomerPage">
42+
<argument name="customerId" value="$$createCustomer.id$$"/>
43+
</actionGroup>
44+
45+
<actionGroup ref="StorefrontAssertStickyLoginAsCustomerNotificationBannerActionGroup" stepKey="assertStickyNotificationBanner">
46+
<argument name="customerFullName" value="$$createCustomer.firstname$$ $$createCustomer.lastname$$"/>
47+
</actionGroup>
48+
49+
<actionGroup ref="StorefrontSignOutNotificationBannerAndCloseTabActionGroup" stepKey="signOutAndCloseTab"/>
50+
</test>
51+
</tests>

app/code/Magento/LoginAsCustomerFrontendUi/Test/Mftf/ActionGroup/StorefrontAssertLoginAsCustomerBannerVisibleActionGroup.xml

Lines changed: 0 additions & 20 deletions
This file was deleted.

app/code/Magento/LoginAsCustomerFrontendUi/Test/Mftf/ActionGroup/StorefrontLoginToCustomerActionGroup.xml

Lines changed: 0 additions & 22 deletions
This file was deleted.

app/code/Magento/LoginAsCustomerFrontendUi/Test/Mftf/Section/StorefrontCustomerLoginAsCustomerSection.xml

Lines changed: 0 additions & 15 deletions
This file was deleted.

app/code/Magento/LoginAsCustomerFrontendUi/Test/Mftf/Test/StorefrontLoginAsCustomerBannerTest.xml

Lines changed: 0 additions & 35 deletions
This file was deleted.

0 commit comments

Comments
 (0)