Skip to content

Commit 0411774

Browse files
committed
MAGETWO-90301: Extend MFTF tests to check Checkout Success page
1 parent 31260b3 commit 0411774

File tree

3 files changed

+14
-6
lines changed

3 files changed

+14
-6
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@
1616
<element name="orderLink" type="text" selector="a[href*=order_id].order-number"/>
1717
<element name="orderNumberText" type="text" selector=".checkout-success > p:nth-child(1)"/>
1818
<element name="continueShoppingButton" type="button" selector=".action.primary.continue"/>
19-
<element name="printLink" type="button" selector=".page-title-wrapper a"/>
19+
<element name="printLink" type="button" selector=".print"/>
2020
</section>
2121
</sections>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@
1111
<section name="CheckoutSuccessRegisterSection">
1212
<element name="registerMessage" type="text" selector="#registration p:nth-child(1)"/>
1313
<element name="customerEmail" type="text" selector="#registration p:nth-child(2)"/>
14-
<element name="createAccountButton" type="button" selector="form[data-bind = 'submit: createAccount'] input"/>
14+
<element name="createAccountButton" type="button" selector="#registration form input[type='submit']"/>
1515
</section>
1616
</sections>

dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Checkout/Test/CheckCheckoutSuccessPageTest.xml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@
2727
</before>
2828

2929
<after>
30+
<!--Logout from customer account-->
31+
<amOnPage url="customer/account/logout/" stepKey="logoutCustomerOne"/>
32+
<waitForPageLoad stepKey="waitLogoutCustomerOne"/>
3033
<amOnPage url="admin/admin/auth/logout/" stepKey="amOnLogoutPage"/>
3134
<deleteData createDataKey="createSimpleProduct" stepKey="deleteProduct"/>
3235
<deleteData createDataKey="createSimpleUsCustomer" stepKey="deleteCustomer"/>
@@ -60,7 +63,10 @@
6063
<see selector="{{CheckoutSuccessMainSection.successTitle}}" userInput="Thank you for your purchase!" stepKey="seeSuccessTitle"/>
6164
<see selector="{{CheckoutSuccessMainSection.orderNumberText}}" userInput="Your order number is: " stepKey="seeOrderNumber"/>
6265
<see selector="{{CheckoutSuccessMainSection.success}}" userInput="We'll email you an order confirmation with details and tracking info." stepKey="seeSuccessNotify"/>
66+
6367
<click selector="{{CheckoutSuccessMainSection.orderLink}}" stepKey="clickOrderLink"/>
68+
<waitForElement selector="{{StorefrontCustomerOrderViewSection.orderTitle}}" stepKey="waitOrderViewPage"/>
69+
<seeInCurrentUrl url="{{StorefrontCustomerOrderPage.url}}" stepKey="seeMyOrderPage"/>
6470

6571
<!--Go to product page-->
6672
<amOnPage url="$$createSimpleProduct.custom_attributes[url_key]$$.html" stepKey="navigateToSimpleProductPage2"/>
@@ -85,6 +91,7 @@
8591
<click selector="{{CheckoutSuccessMainSection.continueShoppingButton}}" stepKey="clickContinueShoppingButton"/>
8692
<waitForElement selector="{{StorefrontCMSPageSection.mainTitle}}" stepKey="waitHomePage"/>
8793
<see userInput="Home Page" selector="{{StorefrontCMSPageSection.mainTitle}}" stepKey="seeHomePageTitle"/>
94+
<seeCurrentUrlEquals url="{{_ENV.MAGENTO_BASE_URL}}" stepKey="seeHomePageUrl"/>
8895

8996
<!--Go to product page-->
9097
<amOnPage url="$$createSimpleProduct.custom_attributes[url_key]$$.html" stepKey="navigateToSimpleProductPage3"/>
@@ -118,8 +125,10 @@
118125
<click selector="{{CheckoutSuccessMainSection.printLink}}" stepKey="clickPrintLink"/>
119126
<waitForPageLoad stepKey="waitPrintPage"/>
120127
<switchToWindow stepKey="switchToWindow"/>
121-
<waitForElement selector="#navbar-container #print-header" stepKey="waitPrintBlock"/>
122-
<seeElement selector="#navbar-container #print-header" stepKey="seePrintPage"/>
128+
<switchToNextTab stepKey="switchToTab"/>
129+
<seeInCurrentUrl url="sales/order/print/order_id" stepKey="123"/>
130+
<seeElement selector="{{StorefrontCustomerOrderViewSection.orderTitle}}" stepKey="seeOrderTitleOnPrint"/>
131+
<switchToWindow stepKey="switchToWindow2"/>
123132
</test>
124133
<test name="CheckCheckoutSuccessPageAsGuest">
125134
<annotations>
@@ -158,8 +167,6 @@
158167
<argument name="customerAddressVar" value="CustomerAddressSimple" />
159168
</actionGroup>
160169

161-
<!--<waitForElement selector="{{CheckoutPaymentSection.paymentSectionTitle}}" time="30" stepKey="waitForPaymentSectionLoadedTest3"/>-->
162-
163170
<!--Click Place Order button-->
164171
<click selector="{{CheckoutPaymentSection.placeOrder}}" stepKey="clickPlaceOrder"/>
165172
<waitForElement selector="{{CheckoutSuccessMainSection.success}}" time="30" stepKey="waitForLoadSuccessPage"/>
@@ -178,6 +185,7 @@
178185
<dontSeeElement selector="{{CheckoutSuccessRegisterSection.createAccountButton}}" stepKey="seeInvisibleCreateAccountButton"/>
179186
<click selector="{{CheckoutSuccessMainSection.continueShoppingButton}}" stepKey="clickContinueShoppingButton"/>
180187
<waitForElement selector="{{StorefrontCMSPageSection.mainTitle}}" stepKey="waitHomePage"/>
188+
<seeCurrentUrlEquals url="{{_ENV.MAGENTO_BASE_URL}}" stepKey="seeHomePageUrl"/>
181189
<see userInput="Home Page" selector="{{StorefrontCMSPageSection.mainTitle}}" stepKey="seeHomePageTitle"/>
182190
</test>
183191
</tests>

0 commit comments

Comments
 (0)