Skip to content

Commit a2c8136

Browse files
authored
Merge pull request #156 from magento-pangolin/MC-8120
MC-8120 Backport for MC-13097
2 parents 744ffc8 + 65e8db2 commit a2c8136

8 files changed

+162
-0
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
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="LoginAsCustomerOnCheckoutPageActionGroup">
12+
<arguments>
13+
<argument name="customer" type="entity"/>
14+
</arguments>
15+
<waitForPageLoad stepKey="waitForCheckoutShippingSectionToLoad"/>
16+
<fillField selector="{{CheckoutShippingSection.email}}" userInput="{{customer.email}}" stepKey="fillEmailField"/>
17+
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskToDisappear"/>
18+
<waitForElementVisible selector="{{CheckoutShippingSection.password}}" stepKey="waitForElementVisible"/>
19+
<fillField selector="{{CheckoutShippingSection.password}}" userInput="{{customer.password}}" stepKey="fillPasswordField"/>
20+
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskToDisappear2"/>
21+
<waitForElementVisible selector="{{CheckoutShippingSection.loginButton}}" stepKey="waitForLoginButtonVisible"/>
22+
<doubleClick selector="{{CheckoutShippingSection.loginButton}}" stepKey="clickLoginBtn"/>
23+
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskToDisappear3"/>
24+
<waitForPageLoad stepKey="waitToBeLoggedIn"/>
25+
<waitForElementNotVisible selector="{{CheckoutShippingSection.email}}" stepKey="waitForEmailInvisible"/>
26+
</actionGroup>
27+
</actionGroups>

app/code/Magento/Checkout/Test/Mftf/Section/CheckoutShippingSection.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,7 @@
3737
<element name="namePrefixOption" type="select" selector="select[name=prefix] option[value='{{optionValue}}']" parameterized="true"/>
3838
<element name="nameSuffix" type="select" selector="[name='suffix']"/>
3939
<element name="nameSuffixOption" type="text" selector="select[name='suffix'] option[value='{{optionValue}}']" parameterized="true" timeout="30"/>
40+
<element name="password" type="input" selector="#customer-password"/>
41+
<element name="loginButton" type="button" selector=".action.login"/>
4042
</section>
4143
</sections>
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
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="StorefrontCustomerLoginDuringCheckoutTest">
12+
<annotations>
13+
<features value="OnePageCheckout"/>
14+
<stories value="Customer Login during checkout"/>
15+
<title value="Storefront customer login during checkout test"/>
16+
<description value="Logging during checkout for customer without addresses in address book"/>
17+
<severity value="CRITICAL"/>
18+
<testCaseId value="MC-8120"/>
19+
<group value="OnePageCheckout"/>
20+
</annotations>
21+
<before>
22+
<!-- Create simple product -->
23+
<createData entity="SimpleProduct3" stepKey="createProduct"/>
24+
25+
<!-- Login as admin -->
26+
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
27+
</before>
28+
<after>
29+
<!-- Delete simple product -->
30+
<deleteData createDataKey="createProduct" stepKey="deleteProduct"/>
31+
32+
<!-- Customer log out -->
33+
<actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="customerLogout"/>
34+
35+
<!-- Delete customer -->
36+
<actionGroup ref="AdminDeleteCustomerActionGroup" stepKey="deleteCustomer">
37+
<argument name="customerEmail" value="CustomerEntityOne.email"/>
38+
</actionGroup>
39+
40+
<!-- Logout admin -->
41+
<actionGroup ref="logout" stepKey="logout"/>
42+
</after>
43+
<!-- Go to Storefront as Guest and create new account -->
44+
<actionGroup ref="SignUpNewUserFromStorefrontActionGroup" stepKey="createNewCustomerAccount"/>
45+
46+
<!-- Sign Out -->
47+
<actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="customerLogout"/>
48+
49+
<!-- Add simple product to cart as Guest -->
50+
<amOnPage url="{{StorefrontProductPage.url($$createProduct.custom_attributes[url_key]$$)}}" stepKey="goToProductPage"/>
51+
<waitForPageLoad stepKey="waitForPageLoad"/>
52+
<actionGroup ref="StorefrontAddProductToCartActionGroup" stepKey="cartAddSimpleProductToCart">
53+
<argument name="product" value="$$createProduct$$"/>
54+
<argument name="productCount" value="1"/>
55+
</actionGroup>
56+
57+
<!-- Go to Checkout page -->
58+
<actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="goToShoppingCartFromMinicart"/>
59+
<click selector="{{StorefrontCheckoutCartSummarySection.proceedToCheckout}}" stepKey="clickProceedToCheckout"/>
60+
<waitForPageLoad stepKey="waitForProceedToCheckout"/>
61+
62+
<!-- Input in field email and password for newly created customer; click Login button -->
63+
<actionGroup ref="LoginAsCustomerOnCheckoutPageActionGroup" stepKey="customerLogin">
64+
<argument name="customer" value="CustomerEntityOne"/>
65+
</actionGroup>
66+
67+
<!-- Shipping form is pre-filed with first name and last name -->
68+
<seeInField selector="{{CheckoutShippingSection.firstName}}" userInput="{{CustomerEntityOne.firstname}}" stepKey="seeCustomerFirstNameInField"/>
69+
<seeInField selector="{{CheckoutShippingSection.lastName}}" userInput="{{CustomerEntityOne.lastname}}" stepKey="seeCustomerLastNameInField"/>
70+
</test>
71+
</tests>
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
10+
<actionGroup name="AdminDeleteCustomerActionGroup">
11+
<arguments>
12+
<argument name="customerEmail"/>
13+
</arguments>
14+
<amOnPage url="{{AdminCustomerPage.url}}" stepKey="navigateToCustomersPage"/>
15+
<conditionalClick selector="{{AdminCustomerFiltersSection.clearAll}}" dependentSelector="{{AdminCustomerFiltersSection.clearAll}}" visible="true" stepKey="clickClearFilters"/>
16+
<click stepKey="chooseCustomer" selector="{{AdminCustomerGridMainActionsSection.customerCheckbox(customerEmail)}}"/>
17+
<click stepKey="openActions" selector="{{AdminCustomerGridMainActionsSection.actions}}"/>
18+
<waitForPageLoad stepKey="waitActions"/>
19+
<click stepKey="delete" selector="{{AdminCustomerGridMainActionsSection.delete}}"/>
20+
<waitForPageLoad stepKey="waitForConfirmationAlert"/>
21+
<click stepKey="accept" selector="{{AdminCustomerGridMainActionsSection.ok}}"/>
22+
<waitForPageLoad stepKey="waitForDelete"/>
23+
<see stepKey="seeSuccessMessage" userInput="were deleted."/>
24+
</actionGroup>
25+
</actionGroups>
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
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="StorefrontCustomerLogoutActionGroup">
12+
<amOnPage url="{{StorefrontCustomerLogoutPage.url}}" stepKey="storefrontSignOut"/>
13+
</actionGroup>
14+
15+
<actionGroup name="StorefrontSignOutActionGroup">
16+
<click selector="{{StoreFrontSignOutSection.customerAccount}}" stepKey="clickCustomerButton"/>
17+
<click selector="{{StoreFrontSignOutSection.signOut}}" stepKey="clickToSignOut"/>
18+
<waitForPageLoad stepKey="waitForPageLoad"/>
19+
<see userInput="You are signed out" stepKey="signOut"/>
20+
</actionGroup>
21+
</actionGroups>
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
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+
<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd">
10+
<page name="StorefrontCustomerLogoutPage" url="customer/account/logout/" area="storefront" module="Magento_Customer"/>
11+
</pages>

app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerFiltersSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
<element name="emailInput" type="input" selector="input[name=email]"/>
1515
<element name="apply" type="button" selector="button[data-action=grid-filter-apply]" timeout="30"/>
1616
<element name="clearFilters" type="button" selector=".admin__data-grid-header button[data-action='grid-filter-reset']" timeout="30"/>
17+
<element name="clearAll" type="button" selector=".admin__data-grid-header .action-tertiary.action-clear"/>
1718
<element name="viewDropdown" type="button" selector=".admin__data-grid-action-bookmarks button.admin__action-dropdown"/>
1819
</section>
1920
</sections>

app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerGridMainActionsSection.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,9 @@
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
1111
<section name="AdminCustomerGridMainActionsSection">
1212
<element name="addNewCustomer" type="button" selector="#add" timeout="30"/>
13+
<element name="customerCheckbox" type="button" selector="//*[contains(text(),'{{arg}}')]/../preceding-sibling::td[contains(@class, 'data-grid-checkbox-cell')]//input" parameterized="true"/>
14+
<element name="delete" type="button" selector="//*[contains(@class, 'admin__data-grid-header')]//span[contains(@class,'action-menu-item') and text()='Delete']"/>
15+
<element name="actions" type="text" selector=".action-select"/>
16+
<element name="ok" type="button" selector=".modal-footer button.action-accept"/>
1317
</section>
1418
</sections>

0 commit comments

Comments
 (0)