Skip to content

Commit 9173df7

Browse files
committed
#28172: MFTF tests
1 parent cf5d73b commit 9173df7

File tree

2 files changed

+135
-0
lines changed

2 files changed

+135
-0
lines changed
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
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+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
10+
11+
<test name="StorefrontCheckoutWithPurchaseOrderNumberPressKeyEnterTest">
12+
<annotations>
13+
<features value="Checkout"/>
14+
<stories value="Checkout with Purchase Order Payment. Create Order with Press Key Enter."/>
15+
<title value="Create Checkout with purchase order payment method test. Press key Enter on field Purchase Order Number for create Order."/>
16+
<description value="Create Checkout with purchase order payment method. Press key Enter on field Purchase Order Number for create Order."/>
17+
<severity value="MAJOR"/>
18+
<group value="checkout"/>
19+
</annotations>
20+
21+
<before>
22+
<createData entity="SimpleTwo" stepKey="createSimpleProduct"/>
23+
24+
<!-- Enable payment method -->
25+
<magentoCLI command="config:set {{PurchaseOrderEnableConfigData.path}} {{PurchaseOrderEnableConfigData.value}}" stepKey="enablePaymentMethod"/>
26+
</before>
27+
28+
<after>
29+
<actionGroup ref="AdminLogoutActionGroup" stepKey="adminLogout"/>
30+
<deleteData createDataKey="createSimpleProduct" stepKey="deleteProduct"/>
31+
32+
<!-- Disable payment method -->
33+
<magentoCLI command="config:set {{PurchaseOrderDisabledConfigData.path}} {{PurchaseOrderDisabledConfigData.value}}" stepKey="disablePaymentMethod"/>
34+
</after>
35+
36+
<!--Go to product page-->
37+
<amOnPage url="$$createSimpleProduct.custom_attributes[url_key]$$.html" stepKey="navigateToSimpleProductPage"/>
38+
<waitForPageLoad stepKey="waitForCatalogPageLoad"/>
39+
40+
<!--Add Product to Shopping Cart-->
41+
<actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addToCartFromStorefrontProductPage">
42+
<argument name="productName" value="$$createSimpleProduct.name$$"/>
43+
</actionGroup>
44+
45+
<!--Go to Checkout-->
46+
<actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="goToCheckoutFromMinicart"/>
47+
48+
<actionGroup ref="GuestCheckoutFillingShippingSectionActionGroup" stepKey="guestCheckoutFillingShippingSection">
49+
<argument name="customerVar" value="CustomerEntityOne"/>
50+
<argument name="customerAddressVar" value="CustomerAddressSimple"/>
51+
</actionGroup>
52+
53+
<!-- Checkout select Purchase Order payment -->
54+
<actionGroup ref="CheckoutSelectPurchaseOrderPaymentActionGroup" stepKey="selectPurchaseOrderPayment">
55+
<argument name="purchaseOrderNumber" value="12345"/>
56+
</actionGroup>
57+
58+
<!--Press Key ENTER-->
59+
<pressKey selector="{{StorefrontCheckoutPaymentMethodSection.purchaseOrderNumber}}" parameterArray="[\Facebook\WebDriver\WebDriverKeys::ENTER]" stepKey="pressKeyEnter"/>
60+
<waitForPageLoad stepKey="waitForPageLoad"/>
61+
62+
<!--See success messages-->
63+
<see selector="{{CheckoutSuccessMainSection.successTitle}}" userInput="Thank you for your purchase!" stepKey="seeSuccessTitle"/>
64+
<see selector="{{CheckoutSuccessMainSection.orderNumberText}}" userInput="Your order # is: " stepKey="seeOrderNumber"/>
65+
66+
</test>
67+
68+
</tests>
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
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+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
10+
<test name="StorefrontCheckoutWithPurchaseOrderNumberTest">
11+
<annotations>
12+
<features value="Checkout"/>
13+
<stories value="Checkout with Purchase Order Payment"/>
14+
<title value="Create Checkout with purchase order payment method test"/>
15+
<description value="Create Checkout with purchase order payment method"/>
16+
<severity value="MAJOR"/>
17+
<group value="checkout"/>
18+
</annotations>
19+
20+
<before>
21+
<createData entity="SimpleTwo" stepKey="createSimpleProduct"/>
22+
23+
<!-- Enable payment method -->
24+
<magentoCLI command="config:set {{PurchaseOrderEnableConfigData.path}} {{PurchaseOrderEnableConfigData.value}}" stepKey="enablePaymentMethod"/>
25+
</before>
26+
27+
<after>
28+
<actionGroup ref="AdminLogoutActionGroup" stepKey="adminLogout"/>
29+
<deleteData createDataKey="createSimpleProduct" stepKey="deleteProduct"/>
30+
31+
<!-- Disable payment method -->
32+
<magentoCLI command="config:set {{PurchaseOrderDisabledConfigData.path}} {{PurchaseOrderDisabledConfigData.value}}" stepKey="disablePaymentMethod"/>
33+
</after>
34+
35+
<!--Go to product page-->
36+
<amOnPage url="$$createSimpleProduct.custom_attributes[url_key]$$.html" stepKey="navigateToSimpleProductPage"/>
37+
<waitForPageLoad stepKey="waitForCatalogPageLoad"/>
38+
39+
<!--Add Product to Shopping Cart-->
40+
<actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addToCartFromStorefrontProductPage">
41+
<argument name="productName" value="$$createSimpleProduct.name$$"/>
42+
</actionGroup>
43+
44+
<!--Go to Checkout-->
45+
<actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="goToCheckoutFromMinicart"/>
46+
47+
<actionGroup ref="GuestCheckoutFillingShippingSectionActionGroup" stepKey="guestCheckoutFillingShippingSection">
48+
<argument name="customerVar" value="CustomerEntityOne"/>
49+
<argument name="customerAddressVar" value="CustomerAddressSimple"/>
50+
</actionGroup>
51+
52+
<!-- Checkout select Purchase Order payment -->
53+
<actionGroup ref="CheckoutSelectPurchaseOrderPaymentActionGroup" stepKey="selectPurchaseOrderPayment">
54+
<argument name="purchaseOrderNumber" value="12345"/>
55+
</actionGroup>
56+
57+
<!--Click Place Order button-->
58+
<click selector="{{CheckoutPaymentSection.placeOrder}}" stepKey="clickPlaceOrder"/>
59+
<waitForPageLoad stepKey="waitForPageLoad"/>
60+
61+
<!--See success messages-->
62+
<see selector="{{CheckoutSuccessMainSection.successTitle}}" userInput="Thank you for your purchase!" stepKey="seeSuccessTitle"/>
63+
<see selector="{{CheckoutSuccessMainSection.orderNumberText}}" userInput="Your order # is: " stepKey="seeOrderNumber"/>
64+
65+
</test>
66+
67+
</tests>

0 commit comments

Comments
 (0)