Skip to content

Commit ac0c588

Browse files
authored
Merge pull request magento#7594 from magento-gl/functional--test--automation
[Bengals] MFTF Automation Phase 1
2 parents 610f7f5 + 05bc833 commit ac0c588

File tree

7 files changed

+196
-8
lines changed

7 files changed

+196
-8
lines changed
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+
9+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="StorefrontGuestSignInActionGroup">
12+
<annotations>
13+
<description>Enter email id and password, click on sign in button.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="email" type="string" defaultValue=""/>
17+
<argument name="password" type="string" defaultValue=""/>
18+
</arguments>
19+
<fillField selector="{{StorefrontCustomerSignInPopupFormSection.email}}" userInput="{{email}}" stepKey="fillEmailId"/>
20+
<fillField selector="{{StorefrontCustomerSignInPopupFormSection.password}}" userInput="{{password}}" stepKey="fillPassword"/>
21+
<waitForElementVisible selector="{{StorefrontCustomerSignInPopupFormSection.createAnAccount}}" stepKey="seeCreateAnAccount"/>
22+
<waitForElementVisible selector="{{StorefrontCustomerSignInPopupFormSection.forgotYourPassword}}" stepKey="seeForgotYourPassword"/>
23+
<click selector="{{StorefrontCustomerSignInPopupFormSection.signIn}}" stepKey="clickOnSignIn"/>
24+
</actionGroup>
25+
</actionGroups>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
-->
88

99
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10-
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
1111
<section name="CheckoutShippingGuestInfoSection">
1212
<element name="email" type="input" selector="#customer-email"/>
1313
<element name="firstName" type="input" selector="input[name=firstname]"/>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
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="StorefrontShoppingCartGuestCheckoutDisabledTest">
12+
<annotations>
13+
<features value="Backend"/>
14+
<stories value="Modal window for Sign In is shown if Guest checkout is disabled. "/>
15+
<title value="Modal window for Sign In is shown if Guest checkout is disabled."/>
16+
<description value="Modal window for Sign In is shown if Guest checkout is disabled. Flow from Shopping Cart"/>
17+
<severity value="CRITICAL"/>
18+
<testCaseId value="MC-27419"/>
19+
<group value="module-checkout"/>
20+
</annotations>
21+
<before>
22+
<!-- create category and simple product -->
23+
<createData entity="_defaultCategory" stepKey="createCategory"/>
24+
<createData entity="SimpleProduct" stepKey="createProduct">
25+
<requiredEntity createDataKey="createCategory"/>
26+
</createData>
27+
<!--Goto Admin Configuration page and Allow Guest Checkout is No-->
28+
<createData entity="DisableAllowGuestCheckout" stepKey="storeConfigurationAllowGuestCheckoutNo">
29+
</createData>
30+
<!-- create customer and clean the cache and index-->
31+
<createData entity="Simple_US_Customer" stepKey="createCustomer"/>
32+
</before>
33+
<!-- Goto storefront and add product to cart-->
34+
<amOnPage url="{{StorefrontCategoryPage.url($$createCategory.custom_attributes[url_key]$$)}}" stepKey="onCategoryPage"/>
35+
<waitForPageLoad stepKey="waitForPageLoad6"/>
36+
<actionGroup ref="StorefrontHoverProductOnCategoryPageActionGroup" stepKey="hoverProduct"/>
37+
<actionGroup ref="StorefrontClickAddToCartButtonActionGroup" stepKey="addToCart"/>
38+
<waitForElementVisible selector="{{StorefrontCategoryMainSection.SuccessMsg}}" time="30" stepKey="waitForProductAdded"/>
39+
<see selector="{{StorefrontCategoryMainSection.SuccessMsg}}" userInput="You added $$createProduct.name$$ to your shopping cart." stepKey="seeAddedToCartMessage"/>
40+
<see selector="{{StorefrontMinicartSection.quantity}}" userInput="1" stepKey="seeCartQuantity"/>
41+
<!-- Checkout form mini cart-->
42+
<actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="guestGoToCheckoutFromMiniCart"/>
43+
<!-- click on Place Order and Guest sing in -->
44+
<actionGroup ref="StorefrontGuestSignInActionGroup" stepKey="singInForPlaceOrder">
45+
<argument name="email" value="$$createCustomer.email$$"/>
46+
<argument name="password" value="$$createCustomer.password$$"/>
47+
</actionGroup>
48+
<after>
49+
<!--Goto Admin Configuration page and Allow Guest Checkout is Yes-->
50+
<createData entity="EnableAllowGuestCheckout" stepKey="storeConfigurationAllowGuestCheckoutYes">
51+
</createData>
52+
<!-- Delete created category, product and customer-->
53+
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
54+
<deleteData createDataKey="createProduct" stepKey="deleteProduct"/>
55+
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/>
56+
</after>
57+
</test>
58+
</tests>

app/code/Magento/Config/Test/Mftf/Section/SalesConfigSection.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@
1414
<element name="ShippingTaxClass" type="select" selector="#tax_classes_shipping_tax_class"/>
1515
<element name="EnableTaxClassForShipping" type="checkbox" selector="#tax_classes_shipping_tax_class_inherit"/>
1616
</section>
17-
</sections>
17+
</sections>

app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerSignInFormSection/StorefrontCustomerSignInPopupFormSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
<element name="email" type="input" selector="#customer-email"/>
1313
<element name="password" type="input" selector="#pass"/>
1414
<element name="signIn" type="button" selector="#send2" timeout="30"/>
15+
<element name="forgotYourPassword" type="button" selector="//a[@class='action']//span[contains(text(),'Forgot Your Password?')]" timeout="30"/>
1516
<element name="createAnAccount" type="button" selector="//div[contains(@class,'actions-toolbar')]//a[contains(.,'Create an Account')]" timeout="30"/>
1617
</section>
1718
</sections>
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
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="StorefrontReorderVirtualProductAsCustomerTest" >
12+
<annotations>
13+
<stories value="Reorder on Storefront for Virtual product"/>
14+
<title value="Reorder on Storefront for Virtual product"/>
15+
<description value="Verify customer able to reorder on Storefront for simple products."/>
16+
<testCaseId value="MC-26873"/>
17+
<severity value="MAJOR"/>
18+
<group value="Reorder_Product"/>
19+
</annotations>
20+
21+
<before>
22+
23+
<!-- create default category -->
24+
<createData entity="_defaultCategory" stepKey="createCategory"/>
25+
26+
<!-- create virtual product -->
27+
<createData entity="VirtualProduct" stepKey="createVirtualProduct">
28+
<requiredEntity createDataKey="createCategory"/>
29+
</createData>
30+
31+
<!-- assign virtual product to default category -->
32+
<createData entity="AssignProductToCategory" stepKey="assignCategoryToVirtualProduct">
33+
<requiredEntity createDataKey="createCategory"/>
34+
<requiredEntity createDataKey="createVirtualProduct"/>
35+
</createData>
36+
37+
<!-- create customer -->
38+
<createData entity="CustomerEntityOne" stepKey="createCustomer"/>
39+
</before>
40+
41+
<after>
42+
<!-- delete category,product,customer -->
43+
<deleteData createDataKey="createVirtualProduct" stepKey="deleteVirtualProduct"/>
44+
<deleteData createDataKey="createCategory" stepKey="deleteSimpleCategory"/>
45+
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/>
46+
</after>
47+
48+
<!-- Login as customer -->
49+
<actionGroup ref="LoginToStorefrontActionGroup" stepKey="storefrontCustomerLogin">
50+
<argument name="Customer" value="$$createCustomer$$"/>
51+
</actionGroup>
52+
53+
<!-- Customer placed order from storefront with payment method -->
54+
<actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addProductToCart">
55+
<argument name="product" value="$$createVirtualProduct$$"/>
56+
</actionGroup>
57+
58+
<actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="goToCheckoutFromMinicart"/>
59+
60+
<actionGroup ref="CheckoutPlaceOrderActionGroup" stepKey="clickOnPlaceOrder">
61+
<argument name="orderNumberMessage" value="CONST.successCheckoutOrderNumberMessage"/>
62+
<argument name="emailYouMessage" value="CONST.successCheckoutEmailYouMessage"/>
63+
</actionGroup>
64+
65+
<!-- order number is captured for future validation -->
66+
<grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber22}}" stepKey="getOrderNumber"/>
67+
68+
<!-- Log in as admin-->
69+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
70+
71+
<!-- Go to orders page and validate the order details -->
72+
<actionGroup ref="OpenOrderByIdActionGroup" stepKey="addFilterToGridAndOpenOrder">
73+
<argument name="orderId" value="{$getOrderNumber}"/>
74+
</actionGroup>
75+
76+
<!--Create Invoice-->
77+
<actionGroup ref="AdminCreateInvoiceActionGroup" stepKey="createInvoice"/>
78+
79+
<!-- Open My Account Page from Customer dropdown -->
80+
<actionGroup ref="StorefrontOpenMyAccountPageActionGroup" stepKey="goToMyAccountPage"/>
81+
82+
<!-- Goto Orders tab from Sidebar menu in Storefront page -->
83+
<actionGroup ref="StorefrontCustomerGoToSidebarMenu" stepKey="goToSidebarMenu">
84+
<argument name="menu" value="My Orders"/>
85+
</actionGroup>
86+
87+
<!-- Clicking View Order from My Orders Grid -->
88+
<actionGroup ref="StorefrontClickViewOrderLinkOnMyOrdersPageActionGroup" stepKey="clickViewOrder"/>
89+
90+
<!-- Clicking on Reorder link from Order Details Tab -->
91+
<click selector="{{StorefrontCustomerOrderViewSection.reorder}}" stepKey="clickReorder"/>
92+
93+
94+
<actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="goToCheckoutFromMiniCart"/>
95+
96+
<!-- Reordering the virtual product -->
97+
<actionGroup ref="CheckoutPlaceOrderActionGroup" stepKey="reorderVirtualProduct">
98+
<argument name="orderNumberMessage" value="CONST.successCheckoutOrderNumberMessage"/>
99+
<argument name="emailYouMessage" value="CONST.successCheckoutEmailYouMessage"/>
100+
</actionGroup>
101+
102+
</test>
103+
</tests>

composer.lock

Lines changed: 7 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)