Skip to content

Commit 5146696

Browse files
author
Alexander Akimov
authored
Merge pull request #2801 from magento-tsg/2.3-develop-mftf-pr2
[TSG] MFTF for 2.3 (pr2) (2.3.0)
2 parents 120836e + 1229301 commit 5146696

File tree

7 files changed

+236
-3
lines changed

7 files changed

+236
-3
lines changed

dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Catalog/Section/AdminProductGridSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,6 @@
2727
<element name="table" type="text" selector="#container > div > div.admin__data-grid-wrap > table"/>
2828
<element name="firstRow" type="button" selector="tr.data-row:nth-of-type(1)"/>
2929
<element name="productGridCheckboxOnRow" type="checkbox" selector="//*[@id='container']//tr[{{row}}]/td[1]//input" parameterized="true"/>
30+
<element name="productGridNameProduct" type="input" selector="//tbody//tr//td//div[contains(., '{{var1}}')]" parameterized="true" timeout="30"/>
3031
</section>
3132
</sections>

dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Checkout/Page/CheckoutSuccessPage.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88

99
<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1010
xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/PageObject.xsd">
11-
<page name="CheckoutSuccessPage" url="/checkout/onepage/success/" area="storefront" module="Checkout">
11+
<page name="CheckoutSuccessPage" url="/checkout/onepage/success/" area="storefront" module="Magento_Checkout">
1212
<section name="CheckoutSuccessMainSection"/>
13+
<section name="CheckoutSuccessRegisterSection"/>
1314
</page>
1415
</pages>

dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Checkout/Section/CheckoutShippingMethodsSection.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1010
xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/SectionObject.xsd">
1111
<section name="CheckoutShippingMethodsSection">
12-
<element name="next" type="button" selector="button.button.action.continue.primary"/>
12+
<element name="next" type="button" selector="button.button.action.continue.primary" timeout="30"/>
1313
<element name="firstShippingMethod" type="radio" selector="//*[@id='checkout-shipping-method-load']//input[@class='radio']"/>
1414
<element name="shippingMethodRow" type="text" selector=".form.methods-shipping table tbody tr"/>
1515
<element name="checkShippingMethodByName" type="radio" selector="//div[@id='checkout-shipping-method-load']//td[contains(., '{{var1}}')]/..//input" parameterized="true"/>

dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Checkout/Section/CheckoutSuccessMainSection.xml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,13 @@
99
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1010
xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/SectionObject.xsd">
1111
<section name="CheckoutSuccessMainSection">
12+
<element name="successTitle" type="text" selector=".page-title"/>
1213
<element name="success" type="text" selector="div.checkout-success"/>
1314
<element name="orderNumber" type="text" selector="div.checkout-success > p:nth-child(1) > span"/>
1415
<element name="orderNumber22" type="text" selector=".order-number>strong"/>
15-
<element name="orderLink" type="text" selector="a[href*=order_id].order-number"/>
16+
<element name="orderLink" type="text" selector="a[href*=order_id].order-number" timeout="30"/>
17+
<element name="orderNumberText" type="text" selector=".checkout-success > p:nth-child(1)"/>
18+
<element name="continueShoppingButton" type="button" selector=".action.primary.continue" timeout="30"/>
19+
<element name="printLink" type="button" selector=".print" timeout="30"/>
1620
</section>
1721
</sections>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
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+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/SectionObject.xsd">
11+
<section name="CheckoutSuccessRegisterSection">
12+
<element name="registerMessage" type="text" selector="#registration p:nth-child(1)"/>
13+
<element name="customerEmail" type="text" selector="#registration p:nth-child(2)"/>
14+
<element name="createAccountButton" type="button" selector="#registration form input[type='submit']" timeout="30"/>
15+
</section>
16+
</sections>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,210 @@
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="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/testSchema.xsd">
11+
<test name="CheckCheckoutSuccessPageAsRegisterCustomer">
12+
<annotations>
13+
<features value="Checkout"/>
14+
<stories value="Success page elements are presented for placed order as Customer"/>
15+
<title value="Customer Checkout"/>
16+
<description value="To be sure that other elements of Success page are shown for placed order as registered Customer."/>
17+
<severity value="CRITICAL"/>
18+
<testCaseId value="MAGETWO-60345"/>
19+
<group value="checkout"/>
20+
</annotations>
21+
22+
<before>
23+
<createData entity="SimpleTwo" stepKey="createSimpleProduct"/>
24+
<createData entity="Simple_US_Customer" stepKey="createSimpleUsCustomer">
25+
<field key="group_id">1</field>
26+
</createData>
27+
</before>
28+
29+
<after>
30+
<!--Logout from customer account-->
31+
<amOnPage url="customer/account/logout/" stepKey="logoutCustomerOne"/>
32+
<waitForPageLoad stepKey="waitLogoutCustomerOne"/>
33+
<amOnPage url="admin/admin/auth/logout/" stepKey="amOnLogoutPage"/>
34+
<deleteData createDataKey="createSimpleProduct" stepKey="deleteProduct"/>
35+
<deleteData createDataKey="createSimpleUsCustomer" stepKey="deleteCustomer"/>
36+
</after>
37+
38+
<!--Log in to Storefront as Customer-->
39+
<actionGroup ref="LoginToStorefrontActionGroup" stepKey="signUpNewUser">
40+
<argument name="Customer" value="$$createSimpleUsCustomer$$"/>
41+
</actionGroup>
42+
43+
<!--Go to product page-->
44+
<amOnPage url="$$createSimpleProduct.custom_attributes[url_key]$$.html" stepKey="navigateToSimpleProductPage"/>
45+
<waitForPageLoad stepKey="waitForCatalogPageLoad"/>
46+
47+
<!--Add Product to Shopping Cart-->
48+
<actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addToCartFromStorefrontProductPage">
49+
<argument name="productName" value="$$createSimpleProduct.name$$"/>
50+
</actionGroup>
51+
52+
<!--Go to Checkout-->
53+
<actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="goToCheckoutFromMinicart"/>
54+
<click selector="{{CheckoutShippingMethodsSection.firstShippingMethod}}" stepKey="selectFirstShippingMethod"/>
55+
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMask2"/>
56+
<waitForElement selector="{{CheckoutShippingMethodsSection.next}}" time="30" stepKey="waitForNextButton"/>
57+
<click selector="{{CheckoutShippingMethodsSection.next}}" stepKey="clickNext"/>
58+
<waitForElement selector="{{CheckoutPaymentSection.paymentSectionTitle}}" time="30" stepKey="waitForPaymentSectionLoadedTest3"/>
59+
60+
<!--Click Place Order button-->
61+
<click selector="{{CheckoutPaymentSection.placeOrder}}" stepKey="clickPlaceOrder"/>
62+
<see selector="{{CheckoutSuccessMainSection.successTitle}}" userInput="Thank you for your purchase!" stepKey="seeSuccessTitle"/>
63+
<see selector="{{CheckoutSuccessMainSection.orderNumberText}}" userInput="Your order number is: " stepKey="seeOrderNumber"/>
64+
<see selector="{{CheckoutSuccessMainSection.success}}" userInput="We'll email you an order confirmation with details and tracking info." stepKey="seeSuccessNotify"/>
65+
66+
<click selector="{{CheckoutSuccessMainSection.orderLink}}" stepKey="clickOrderLink"/>
67+
<seeInCurrentUrl url="{{StorefrontCustomerOrderPage.url}}" stepKey="seeMyOrderPage"/>
68+
69+
<!--Go to product page-->
70+
<amOnPage url="$$createSimpleProduct.custom_attributes[url_key]$$.html" stepKey="navigateToSimpleProductPage2"/>
71+
<waitForPageLoad stepKey="waitForCatalogPageLoad2"/>
72+
73+
<!--Add Product to Shopping Cart-->
74+
<actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addToCartFromStorefrontProductPage2">
75+
<argument name="productName" value="$$createSimpleProduct.name$$"/>
76+
</actionGroup>
77+
78+
<!--Go to Checkout-->
79+
<actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="goToCheckoutFromMinicart2"/>
80+
<click selector="{{CheckoutShippingMethodsSection.firstShippingMethod}}" stepKey="selectFirstShippingMethod2"/>
81+
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMask3"/>
82+
<waitForElement selector="{{CheckoutShippingMethodsSection.next}}" time="30" stepKey="waitForNextButton2"/>
83+
<click selector="{{CheckoutShippingMethodsSection.next}}" stepKey="clickNext2"/>
84+
<waitForElement selector="{{CheckoutPaymentSection.paymentSectionTitle}}" time="30" stepKey="waitForPaymentSectionLoadedTest4"/>
85+
86+
<!--Click Place Order button-->
87+
<click selector="{{CheckoutPaymentSection.placeOrder}}" stepKey="clickPlaceOrder2"/>
88+
<see selector="{{CheckoutSuccessMainSection.successTitle}}" userInput="Thank you for your purchase!" stepKey="waitForLoadSuccessPage2"/>
89+
<click selector="{{CheckoutSuccessMainSection.continueShoppingButton}}" stepKey="clickContinueShoppingButton"/>
90+
<see userInput="Home Page" selector="{{StorefrontCMSPageSection.mainTitle}}" stepKey="seeHomePageTitle"/>
91+
<seeCurrentUrlEquals url="{{_ENV.MAGENTO_BASE_URL}}" stepKey="seeHomePageUrl"/>
92+
93+
<!--Go to product page-->
94+
<amOnPage url="$$createSimpleProduct.custom_attributes[url_key]$$.html" stepKey="navigateToSimpleProductPage3"/>
95+
<waitForPageLoad stepKey="waitForCatalogPageLoad3"/>
96+
97+
<!--Add Product to Shopping Cart-->
98+
<actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addToCartFromStorefrontProductPage3">
99+
<argument name="productName" value="$$createSimpleProduct.name$$"/>
100+
</actionGroup>
101+
102+
<!--Go to Checkout-->
103+
<actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="goToCheckoutFromMinicart3"/>
104+
<click selector="{{CheckoutShippingMethodsSection.firstShippingMethod}}" stepKey="selectFirstShippingMethod3"/>
105+
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMask4"/>
106+
<waitForElement selector="{{CheckoutShippingMethodsSection.next}}" time="30" stepKey="waitForNextButton3"/>
107+
<click selector="{{CheckoutShippingMethodsSection.next}}" stepKey="clickNext3"/>
108+
<waitForElement selector="{{CheckoutPaymentSection.paymentSectionTitle}}" time="30" stepKey="waitForPaymentSectionLoadedTest5"/>
109+
110+
<!--Click Place Order button-->
111+
<click selector="{{CheckoutPaymentSection.placeOrder}}" stepKey="clickPlaceOrder3"/>
112+
<see selector="{{CheckoutSuccessMainSection.successTitle}}" userInput="Thank you for your purchase!" stepKey="waitForLoadSuccessPage3"/>
113+
114+
<!--Check "Print Receipt" button is presented (desktop only)-->
115+
<seeElement selector="{{CheckoutSuccessMainSection.printLink}}" stepKey="seeVisiblePrint"/>
116+
<resizeWindow width="600" height="800" stepKey="resizeWindow"/>
117+
<waitForElementNotVisible selector="{{CheckoutSuccessMainSection.printLink}}" stepKey="waitInvisiblePrint"/>
118+
<dontSeeElement selector="{{CheckoutSuccessMainSection.printLink}}" stepKey="seeInvisiblePrint"/>
119+
<resizeWindow width="1360" height="1020" stepKey="maximizeWindowKey1"/>
120+
<waitForElementVisible selector="{{CheckoutSuccessMainSection.printLink}}" stepKey="waitVisiblePrint"/>
121+
<seeElement selector="{{CheckoutSuccessMainSection.printLink}}" stepKey="seeVisiblePrint2" />
122+
123+
<!--See print page-->
124+
<click selector="{{CheckoutSuccessMainSection.printLink}}" stepKey="clickPrintLink"/>
125+
<switchToWindow stepKey="switchToWindow"/>
126+
<switchToNextTab stepKey="switchToTab"/>
127+
<seeInCurrentUrl url="sales/order/print/order_id" stepKey="seePrintPage"/>
128+
<seeElement selector="{{StorefrontCustomerOrderViewSection.orderTitle}}" stepKey="seeOrderTitleOnPrint"/>
129+
<switchToWindow stepKey="switchToWindow2"/>
130+
</test>
131+
<test name="CheckCheckoutSuccessPageAsGuest">
132+
<annotations>
133+
<features value="Checkout"/>
134+
<stories value="Success page elements are presented for placed order as Guest"/>
135+
<title value="Customer Checkout"/>
136+
<description value="To be sure that other elements of Success page are presented for placed order as Guest."/>
137+
<severity value="CRITICAL"/>
138+
<testCaseId value="MAGETWO-60346"/>
139+
<group value="checkout"/>
140+
</annotations>
141+
142+
<before>
143+
<createData entity="SimpleTwo" stepKey="createSimpleProduct"/>
144+
</before>
145+
146+
<after>
147+
<amOnPage url="admin/admin/auth/logout/" stepKey="amOnLogoutPage"/>
148+
<deleteData createDataKey="createSimpleProduct" stepKey="deleteProduct"/>
149+
</after>
150+
151+
<!--Go to product page-->
152+
<amOnPage url="$$createSimpleProduct.custom_attributes[url_key]$$.html" stepKey="navigateToSimpleProductPage"/>
153+
<waitForPageLoad stepKey="waitForCatalogPageLoad"/>
154+
155+
<!--Add Product to Shopping Cart-->
156+
<actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addToCartFromStorefrontProductPage">
157+
<argument name="productName" value="$$createSimpleProduct.name$$"/>
158+
</actionGroup>
159+
160+
<!--Go to Checkout-->
161+
<actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="goToCheckoutFromMinicart"/>
162+
163+
<actionGroup ref="GuestCheckoutFillingShippingSectionActionGroup" stepKey="guestCheckoutFillingShippingSection">
164+
<argument name="customerVar" value="CustomerEntityOne" />
165+
<argument name="customerAddressVar" value="CustomerAddressSimple" />
166+
</actionGroup>
167+
168+
<!--Click Place Order button-->
169+
<click selector="{{CheckoutPaymentSection.placeOrder}}" stepKey="clickPlaceOrder"/>
170+
<see selector="{{CheckoutSuccessMainSection.successTitle}}" userInput="Thank you for your purchase!" stepKey="waitForLoadSuccessPage"/>
171+
172+
<!--See success messages-->
173+
<see selector="{{CheckoutSuccessMainSection.successTitle}}" userInput="Thank you for your purchase!" stepKey="seeSuccessTitle"/>
174+
<see selector="{{CheckoutSuccessMainSection.orderNumberText}}" userInput="Your order # is: " stepKey="seeOrderNumber"/>
175+
176+
<!--Check register section-->
177+
<see selector="{{CheckoutSuccessMainSection.success}}" userInput="We'll email you an order confirmation with details and tracking info." stepKey="seeSuccessNotify"/>
178+
<see selector="{{CheckoutSuccessRegisterSection.registerMessage}}" userInput="You can track your order status by creating an account." stepKey="seeRegisterMessage"/>
179+
<see selector="{{CheckoutSuccessRegisterSection.customerEmail}}" userInput="Email Address: {{CustomerEntityOne.email}}" stepKey="seeCustomerEmail"/>
180+
<seeElement selector="{{CheckoutSuccessRegisterSection.createAccountButton}}" stepKey="seeVisibleCreateAccountButton"/>
181+
<click selector="{{CheckoutSuccessRegisterSection.createAccountButton}}" stepKey="clickCreateAccountButton"/>
182+
<seeInCurrentUrl url="{{StorefrontCustomerCreatePage.url}}" stepKey="seeCreateAccountPage"/>
183+
<see userInput="Create New Customer Account" selector="{{StorefrontCMSPageSection.mainTitle}}" stepKey="seeCreateAccountPageTitle"/>
184+
185+
<!--Go to product page-->
186+
<amOnPage url="$$createSimpleProduct.custom_attributes[url_key]$$.html" stepKey="navigateToSimpleProductPage2"/>
187+
<waitForPageLoad stepKey="waitForCatalogPageLoad2"/>
188+
189+
<!--Add Product to Shopping Cart-->
190+
<actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addToCartFromStorefrontProductPage2">
191+
<argument name="productName" value="$$createSimpleProduct.name$$"/>
192+
</actionGroup>
193+
194+
<!--Go to Checkout-->
195+
<actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="goToCheckoutFromMinicart2"/>
196+
<actionGroup ref="GuestCheckoutFillingShippingSectionActionGroup" stepKey="guestCheckoutFillingShippingSection2">
197+
<argument name="customerVar" value="CustomerEntityOne" />
198+
<argument name="customerAddressVar" value="CustomerAddressSimple" />
199+
</actionGroup>
200+
201+
<!--Click Place Order button-->
202+
<click selector="{{CheckoutPaymentSection.placeOrder}}" stepKey="clickPlaceOrder2"/>
203+
<see selector="{{CheckoutSuccessMainSection.successTitle}}" userInput="Thank you for your purchase!" stepKey="waitForLoadSuccessPage2"/>
204+
205+
<!--Continue shopping-->
206+
<click selector="{{CheckoutSuccessMainSection.continueShoppingButton}}" stepKey="clickContinueShoppingButton"/>
207+
<seeCurrentUrlEquals url="{{_ENV.MAGENTO_BASE_URL}}" stepKey="seeHomePageUrl"/>
208+
<see userInput="Home Page" selector="{{StorefrontCMSPageSection.mainTitle}}" stepKey="seeHomePageTitle"/>
209+
</test>
210+
</tests>

dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Cms/Section/StorefrontCMSPageSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,6 @@
1111
<section name="StorefrontCMSPageSection">
1212
<element name="mediaDescription" type="text" selector=".column.main>p>img"/>
1313
<element name="imageSource" type="text" selector="//img[contains(@src,'{{var1}}')]" parameterized="true"/>
14+
<element name="mainTitle" type="text" selector="#maincontent .page-title"/>
1415
</section>
1516
</sections>

0 commit comments

Comments
 (0)