Skip to content

Commit

Permalink
Merge pull request #156 from magento-pangolin/MC-8120
Browse files Browse the repository at this point in the history
MC-8120 Backport for MC-13097
  • Loading branch information
kabothu authored Jun 13, 2019
2 parents 744ffc8 + 65e8db2 commit a2c8136
Show file tree
Hide file tree
Showing 8 changed files with 162 additions and 0 deletions.
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="LoginAsCustomerOnCheckoutPageActionGroup">
<arguments>
<argument name="customer" type="entity"/>
</arguments>
<waitForPageLoad stepKey="waitForCheckoutShippingSectionToLoad"/>
<fillField selector="{{CheckoutShippingSection.email}}" userInput="{{customer.email}}" stepKey="fillEmailField"/>
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskToDisappear"/>
<waitForElementVisible selector="{{CheckoutShippingSection.password}}" stepKey="waitForElementVisible"/>
<fillField selector="{{CheckoutShippingSection.password}}" userInput="{{customer.password}}" stepKey="fillPasswordField"/>
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskToDisappear2"/>
<waitForElementVisible selector="{{CheckoutShippingSection.loginButton}}" stepKey="waitForLoginButtonVisible"/>
<doubleClick selector="{{CheckoutShippingSection.loginButton}}" stepKey="clickLoginBtn"/>
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskToDisappear3"/>
<waitForPageLoad stepKey="waitToBeLoggedIn"/>
<waitForElementNotVisible selector="{{CheckoutShippingSection.email}}" stepKey="waitForEmailInvisible"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,7 @@
<element name="namePrefixOption" type="select" selector="select[name=prefix] option[value='{{optionValue}}']" parameterized="true"/>
<element name="nameSuffix" type="select" selector="[name='suffix']"/>
<element name="nameSuffixOption" type="text" selector="select[name='suffix'] option[value='{{optionValue}}']" parameterized="true" timeout="30"/>
<element name="password" type="input" selector="#customer-password"/>
<element name="loginButton" type="button" selector=".action.login"/>
</section>
</sections>
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
<?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="StorefrontCustomerLoginDuringCheckoutTest">
<annotations>
<features value="OnePageCheckout"/>
<stories value="Customer Login during checkout"/>
<title value="Storefront customer login during checkout test"/>
<description value="Logging during checkout for customer without addresses in address book"/>
<severity value="CRITICAL"/>
<testCaseId value="MC-8120"/>
<group value="OnePageCheckout"/>
</annotations>
<before>
<!-- Create simple product -->
<createData entity="SimpleProduct3" stepKey="createProduct"/>

<!-- Login as admin -->
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
</before>
<after>
<!-- Delete simple product -->
<deleteData createDataKey="createProduct" stepKey="deleteProduct"/>

<!-- Customer log out -->
<actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="customerLogout"/>

<!-- Delete customer -->
<actionGroup ref="AdminDeleteCustomerActionGroup" stepKey="deleteCustomer">
<argument name="customerEmail" value="CustomerEntityOne.email"/>
</actionGroup>

<!-- Logout admin -->
<actionGroup ref="logout" stepKey="logout"/>
</after>
<!-- Go to Storefront as Guest and create new account -->
<actionGroup ref="SignUpNewUserFromStorefrontActionGroup" stepKey="createNewCustomerAccount"/>

<!-- Sign Out -->
<actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="customerLogout"/>

<!-- Add simple product to cart as Guest -->
<amOnPage url="{{StorefrontProductPage.url($$createProduct.custom_attributes[url_key]$$)}}" stepKey="goToProductPage"/>
<waitForPageLoad stepKey="waitForPageLoad"/>
<actionGroup ref="StorefrontAddProductToCartActionGroup" stepKey="cartAddSimpleProductToCart">
<argument name="product" value="$$createProduct$$"/>
<argument name="productCount" value="1"/>
</actionGroup>

<!-- Go to Checkout page -->
<actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="goToShoppingCartFromMinicart"/>
<click selector="{{StorefrontCheckoutCartSummarySection.proceedToCheckout}}" stepKey="clickProceedToCheckout"/>
<waitForPageLoad stepKey="waitForProceedToCheckout"/>

<!-- Input in field email and password for newly created customer; click Login button -->
<actionGroup ref="LoginAsCustomerOnCheckoutPageActionGroup" stepKey="customerLogin">
<argument name="customer" value="CustomerEntityOne"/>
</actionGroup>

<!-- Shipping form is pre-filed with first name and last name -->
<seeInField selector="{{CheckoutShippingSection.firstName}}" userInput="{{CustomerEntityOne.firstname}}" stepKey="seeCustomerFirstNameInField"/>
<seeInField selector="{{CheckoutShippingSection.lastName}}" userInput="{{CustomerEntityOne.lastname}}" stepKey="seeCustomerLastNameInField"/>
</test>
</tests>
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?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="AdminDeleteCustomerActionGroup">
<arguments>
<argument name="customerEmail"/>
</arguments>
<amOnPage url="{{AdminCustomerPage.url}}" stepKey="navigateToCustomersPage"/>
<conditionalClick selector="{{AdminCustomerFiltersSection.clearAll}}" dependentSelector="{{AdminCustomerFiltersSection.clearAll}}" visible="true" stepKey="clickClearFilters"/>
<click stepKey="chooseCustomer" selector="{{AdminCustomerGridMainActionsSection.customerCheckbox(customerEmail)}}"/>
<click stepKey="openActions" selector="{{AdminCustomerGridMainActionsSection.actions}}"/>
<waitForPageLoad stepKey="waitActions"/>
<click stepKey="delete" selector="{{AdminCustomerGridMainActionsSection.delete}}"/>
<waitForPageLoad stepKey="waitForConfirmationAlert"/>
<click stepKey="accept" selector="{{AdminCustomerGridMainActionsSection.ok}}"/>
<waitForPageLoad stepKey="waitForDelete"/>
<see stepKey="seeSuccessMessage" userInput="were deleted."/>
</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="StorefrontCustomerLogoutActionGroup">
<amOnPage url="{{StorefrontCustomerLogoutPage.url}}" stepKey="storefrontSignOut"/>
</actionGroup>

<actionGroup name="StorefrontSignOutActionGroup">
<click selector="{{StoreFrontSignOutSection.customerAccount}}" stepKey="clickCustomerButton"/>
<click selector="{{StoreFrontSignOutSection.signOut}}" stepKey="clickToSignOut"/>
<waitForPageLoad stepKey="waitForPageLoad"/>
<see userInput="You are signed out" stepKey="signOut"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd">
<page name="StorefrontCustomerLogoutPage" url="customer/account/logout/" area="storefront" module="Magento_Customer"/>
</pages>
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
<element name="emailInput" type="input" selector="input[name=email]"/>
<element name="apply" type="button" selector="button[data-action=grid-filter-apply]" timeout="30"/>
<element name="clearFilters" type="button" selector=".admin__data-grid-header button[data-action='grid-filter-reset']" timeout="30"/>
<element name="clearAll" type="button" selector=".admin__data-grid-header .action-tertiary.action-clear"/>
<element name="viewDropdown" type="button" selector=".admin__data-grid-action-bookmarks button.admin__action-dropdown"/>
</section>
</sections>
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,9 @@
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
<section name="AdminCustomerGridMainActionsSection">
<element name="addNewCustomer" type="button" selector="#add" timeout="30"/>
<element name="customerCheckbox" type="button" selector="//*[contains(text(),'{{arg}}')]/../preceding-sibling::td[contains(@class, 'data-grid-checkbox-cell')]//input" parameterized="true"/>
<element name="delete" type="button" selector="//*[contains(@class, 'admin__data-grid-header')]//span[contains(@class,'action-menu-item') and text()='Delete']"/>
<element name="actions" type="text" selector=".action-select"/>
<element name="ok" type="button" selector=".modal-footer button.action-accept"/>
</section>
</sections>

0 comments on commit a2c8136

Please sign in to comment.