Skip to content

Commit

Permalink
MFTF test added
Browse files Browse the repository at this point in the history
  • Loading branch information
konarshankar07 committed Aug 6, 2020
1 parent 4f2d8de commit 43cca51
Show file tree
Hide file tree
Showing 4 changed files with 92 additions and 0 deletions.
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="StorefrontAssertLoginAsCustomerBannerVisibleActionGroup">
<annotations>
<description>Assert Login As Customer Banner is sticky</description>
</annotations>

<seeElement selector="{{StorefrontCustomerLoginAsCustomerSection.loginAsCustomerBanner}}" stepKey="verifyBannerIsVisibleBeforeScroll"/>
<scrollTo selector="{{StorefrontCustomerLoginAsCustomerSection.copyright}}" stepKey="scrollToEndOfThePage" />
<seeElement selector="{{StorefrontCustomerLoginAsCustomerSection.loginAsCustomerBanner}}" stepKey="verifyBannerIsVisibleAfterScroll"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?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="StorefrontLoginToCustomerActionGroup">
<annotations>
<description>Login to customer account using Login As customer.</description>
</annotations>
<arguments>
<argument name="customerId" type="string"/>
</arguments>

<amOnPage url="admin/loginascustomer/login/login/customer_id/{{customerId}}/" stepKey="loginAsCustomer"/>
<waitForElementVisible selector="{{StorefrontCustomerLoginAsCustomerSection.loginAsCustomerBanner}}" stepKey="waitForLoginAsCustomerPageLoad"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
<section name="StorefrontCustomerLoginAsCustomerSection">
<element name="loginAsCustomerBanner" type="text" selector=".lac-notification-sticky" timeout="30"/>
<element name="copyright" type="text" selector=".copyright" timeout="30"/>
</section>
</sections>
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?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="StorefrontLoginAsCustomerBannerTest">
<annotations>
<features value="StorefrontLoginAsCustomerBanner"/>
<stories value="User login as customer and verify banner is sticky"/>
<useCaseId value="https://github.com/magento/magento2/issues/29354"/>
<title value="User login as customer and verify banner is sticky"/>
<testCaseId value=""/>
<description value="User login as customer and verify banner is sticky"/>
<severity value="CRITICAL"/>
</annotations>
<before>
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
<createData entity="Simple_US_Customer" stepKey="createCustomer"/>
</before>

<after>
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer" />
</after>

<actionGroup ref="StorefrontLoginToCustomerActionGroup" stepKey="LoginAsCustomer">
<argument name="customerId" value="$$createCustomer.id$$"/>
</actionGroup>
<actionGroup ref="StorefrontAssertLoginAsCustomerBannerVisibleActionGroup" stepKey="assertBannerIsSticky" />
</test>
</tests>

0 comments on commit 43cca51

Please sign in to comment.