Skip to content

#29354 :- Login as Customer storefront banner is not sticky #29415

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?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="AssertStorefrontStickyLoginAsCustomerNotificationBannerActionGroup">
<annotations>
<description>Verify Sticky Login as Customer notification banner present on page.</description>
</annotations>
<arguments>
<argument name="customerFullName" type="string"/>
<argument name="websiteName" type="string" defaultValue="Main Website"/>
</arguments>

<waitForElementVisible selector="{{StorefrontLoginAsCustomerNotificationSection.notificationText}}" stepKey="waitForNotificationBanner"/>
<see selector="{{StorefrontLoginAsCustomerNotificationSection.notificationText}}"
userInput="You are connected as {{customerFullName}} on {{websiteName}}"
stepKey="assertCorrectNotificationBannerMessage"/>
<seeElement selector="{{StorefrontLoginAsCustomerNotificationSection.closeLink}}"
stepKey="assertCloseNotificationBannerPresent"/>
<executeJS function="window.scrollTo(0,document.body.scrollHeight);" stepKey="scrollToBottomOfPage"/>
<see selector="{{StorefrontLoginAsCustomerNotificationSection.notificationText}}"
userInput="You are connected as {{customerFullName}} on {{websiteName}}"
stepKey="assertCorrectNotificationBannerMessageAfterScroll"/>
<seeElement selector="{{StorefrontLoginAsCustomerNotificationSection.closeLink}}"
stepKey="assertCloseNotificationBannerPresentAfterScroll"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
<test name="StorefrontStickyLoginAsCustomerNotificationBannerTest">
<annotations>
<features value="Login as Customer"/>
<useCaseId value="https://github.com/magento/magento2/issues/29354"/>
<stories value="Availability of sticky UI elements if module enable/disable"/>
<title value="Sticky Notification Banner is present on Storefront page"/>
<description
value="Verify that Sticky Notification Banner is present on page if 'Login as customer' functionality used"/>
<testCaseId value=""/>
<group value="login_as_customer"/>
<severity value="CRITICAL"/>
</annotations>
<before>
<magentoCLI command="config:set {{LoginAsCustomerConfigDataEnabled.path}} 1"
stepKey="enableLoginAsCustomer"/>
<actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanConfigCache">
<argument name="tags" value="config"/>
</actionGroup>
<createData entity="Simple_US_Customer_Assistance_Allowed" stepKey="createCustomer"/>
<actionGroup ref="AdminLoginActionGroup" stepKey="login"/>
</before>

<after>
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/>
<magentoCLI command="config:set {{LoginAsCustomerConfigDataEnabled.path}} 0"
stepKey="disableLoginAsCustomer"/>
<actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanConfigCache">
<argument name="tags" value="config"/>
</actionGroup>
</after>

<actionGroup ref="AdminLoginAsCustomerLoginFromCustomerPageActionGroup" stepKey="loginAsCustomerFromCustomerPage">
<argument name="customerId" value="$$createCustomer.id$$"/>
</actionGroup>

<actionGroup ref="AssertStorefrontStickyLoginAsCustomerNotificationBannerActionGroup" stepKey="assertStickyNotificationBanner">
<argument name="customerFullName" value="$$createCustomer.firstname$$ $$createCustomer.lastname$$"/>
</actionGroup>

<actionGroup ref="StorefrontSignOutNotificationBannerAndCloseTabActionGroup" stepKey="signOutAndCloseTab"/>
</test>
</tests>
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
$viewFileUrl = $block->getViewFileUrl('Magento_LoginAsCustomerFrontendUi::images/magento-icon.svg');
?>
<?php if ($block->getConfig()->isEnabled()): ?>
<div data-bind="scope: 'loginAsCustomer'" >
<div class="lac-notification-sticky"
data-mage-init='{"sticky":{"container": "body"}}'
data-bind="scope: 'loginAsCustomer'" >
<div class="lac-notification clearfix" data-bind="visible: isVisible" style="display: none">
<div class="top-container">
<div class="lac-notification-icon wrapper">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,43 +16,47 @@
// ---------------------------------------------

& when (@media-common = true) {
.lac-notification {
background-color: @lac-notification-background-color;
color: @lac-notification-color;
font-size: 16px;
.lac-notification-sticky {
position: relative;
z-index: 999;
.lac-notification {
background-color: @lac-notification-background-color;
color: @lac-notification-color;
font-size: 16px;

.lac-notification-icon {
float: left;
margin: 10px 25px 10px 10px;
.lac-notification-icon {
float: left;
margin: 10px 25px 10px 10px;

.logo-img {
display: block
.logo-img {
display: block
}
}
}

.lac-notification-text {
float: left;
padding: 15px 0;
}
.lac-notification-text {
float: left;
padding: 15px 0;
}

.lac-notification-links {
float: right;
padding: 15px 0;
.lac-notification-links {
float: right;
padding: 15px 0;

a {
color: @lac-notification-links-color;
font-size: 14px;
}
a {
color: @lac-notification-links-color;
font-size: 14px;
}

.lac-notification-close-link {
&:after {
background: url('../Magento_LoginAsCustomerFrontendUi/images/close.svg');
content: ' ';
display: inline-block;
height: 12px;
margin-left: 5px;
vertical-align: middle;
width: 12px;
.lac-notification-close-link {
&:after {
background: url('../Magento_LoginAsCustomerFrontendUi/images/close.svg');
content: ' ';
display: inline-block;
height: 12px;
margin-left: 5px;
vertical-align: middle;
width: 12px;
}
}
}
}
Expand Down