Skip to content

Commit a9d79d5

Browse files
committed
Merge remote-tracking branch 'github-magento2ce/MAGETWO-71375' into EPAM-PR-12
2 parents 7e9dedf + 6a36742 commit a9d79d5

File tree

9 files changed

+277
-1
lines changed

9 files changed

+277
-1
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
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="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/actionGroupSchema.xsd">
11+
<!--Fill shipment form for free shipping-->
12+
<actionGroup name="ShipmentFormFreeShippingActionGroup">
13+
<fillField selector="{{CheckoutShippingSection.email}}" userInput="{{CustomerEntityOne.email}}" stepKey="setCustomerEmail"/>
14+
<fillField selector="{{CheckoutShippingSection.firstName}}" userInput="{{CustomerEntityOne.firstname}}" stepKey="SetCustomerFirstName"/>
15+
<fillField selector="{{CheckoutShippingSection.lastName}}" userInput="{{CustomerEntityOne.lastname}}" stepKey="SetCustomerLastName"/>
16+
<fillField selector="{{CheckoutShippingSection.street}}" userInput="{{CustomerAddressSimple.street}}" stepKey="SetCustomerStreetAddress"/>
17+
<fillField selector="{{CheckoutShippingSection.city}}" userInput="{{CustomerAddressSimple.city}}" stepKey="SetCustomerCity"/>
18+
<fillField selector="{{CheckoutShippingSection.postcode}}" userInput="{{CustomerAddressSimple.postcode}}" stepKey="SetCustomerZipCode"/>
19+
<fillField selector="{{CheckoutShippingSection.telephone}}" userInput="{{CustomerAddressSimple.telephone}}" stepKey="SetCustomerPhoneNumber"/>
20+
<click selector="{{CheckoutShippingSection.region}}" stepKey="clickToSetState"/>
21+
<click selector="{{CheckoutShippingSection.state}}" stepKey="clickToChooseState"/>
22+
<see userInput="$0.00 Free Free Shipping" selector="{{CheckoutShippingMethodsSection.shippingMethodRowByName('Free Shipping')}}" stepKey="seeShippingMethod" after="clickToChooseState"/>
23+
<click selector="{{CheckoutShippingMethodsSection.checkShippingMethodByName('Free Shipping')}}" stepKey="selectFlatShippingMethod" after="seeShippingMethod"/>
24+
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMask" after="selectFlatShippingMethod"/>
25+
<click selector="{{CheckoutShippingSection.next}}" stepKey="clickToSaveShippingInfo"/>
26+
<waitForPageLoad time="5" stepKey="waitForReviewAndPaymentsPageIsLoaded"/>
27+
<seeInCurrentUrl url="payment" stepKey="reviewAndPaymentIsShown"/>
28+
</actionGroup>
29+
</actionGroups>

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
<element name="next" type="button" selector="button.button.action.continue.primary" timeout="30"/>
3232
<element name="firstShippingMethod" type="radio" selector="//*[@id='checkout-shipping-method-load']//input[@class='radio']"/>
3333
<element name="defaultShipping" type="button" selector=".billing-address-details"/>
34+
<element name="state" type="button" selector="//*[text()='Alabama']"/>
3435
<element name="stateInput" type="input" selector="input[name=region]"/>
3536
</section>
3637
</sections>
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
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="ZeroSubtotalOrdersWithProcessingStatusTest">
12+
<annotations>
13+
<features value="Checkout"/>
14+
<stories value="MAGETWO-71375: Zero Subtotal Orders have incorrect status"/>
15+
<title value="Checking status of Zero Subtotal Orders with 'Processing' New Order Status"/>
16+
<description value="Created order should be in Processing status"/>
17+
<severity value="MAJOR"/>
18+
<testCaseId value="MAGETWO-94178"/>
19+
<group value="checkout"/>
20+
</annotations>
21+
<before>
22+
<createData entity="SimpleSubCategory" stepKey="simplecategory"/>
23+
<createData entity="SimpleProduct" stepKey="simpleproduct">
24+
<requiredEntity createDataKey="simplecategory"/>
25+
</createData>
26+
<createData entity="PaymentMethodsSettingConfig" stepKey="paymentMethodsSettingConfig"/>
27+
<createData entity="FreeShippingMethodsSettingConfig" stepKey="freeShippingMethodsSettingConfig"/>
28+
<!--Go to Admin page-->
29+
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
30+
</before>
31+
32+
<after>
33+
<actionGroup ref="DeleteCartPriceRuleByName" stepKey="deleteSalesRule">
34+
<argument name="ruleName" value="{{ApiSalesRule.name}}"/>
35+
</actionGroup>
36+
<createData entity="DefaultShippingMethodsConfig" stepKey="defaultShippingMethodsConfig"/>
37+
<createData entity="DisableFreeShippingConfig" stepKey="disableFreeShippingConfig"/>
38+
<createData entity="DisablePaymentMethodsSettingConfig" stepKey="disablePaymentMethodsSettingConfig"/>
39+
<actionGroup ref="logout" stepKey="logout"/>
40+
<deleteData createDataKey="simpleproduct" stepKey="deleteProduct"/>
41+
<deleteData createDataKey="simplecategory" stepKey="deleteCategory"/>
42+
</after>
43+
44+
<!--Open MARKETING > Cart Price Rules-->
45+
<amOnPage url="{{AdminCartPriceRulesPage.url}}" stepKey="amOnCartPriceList"/>
46+
<waitForPageLoad stepKey="waitForRulesPage"/>
47+
48+
<!--Add New Rule-->
49+
<click selector="{{AdminCartPriceRulesSection.addNewRuleButton}}" stepKey="clickAddNewRule"/>
50+
<fillField selector="{{AdminCartPriceRulesFormSection.ruleName}}" userInput="{{ApiSalesRule.name}}" stepKey="fillRuleName"/>
51+
<selectOption selector="{{AdminCartPriceRulesFormSection.websites}}" userInput="Main Website" stepKey="selectWebsite"/>
52+
<actionGroup ref="selectNotLoggedInCustomerGroup" stepKey="chooseNotLoggedInCustomerGroup"/>
53+
<selectOption selector="{{AdminCartPriceRulesFormSection.coupon}}" userInput="Specific Coupon" stepKey="selectCouponType"/>
54+
<fillField selector="{{AdminCartPriceRulesFormSection.couponCode}}" userInput="{{_defaultCoupon.code}}" stepKey="fillCouponCode"/>
55+
<fillField selector="{{AdminCartPriceRulesFormSection.userPerCoupon}}" userInput="99" stepKey="fillUserPerCoupon"/>
56+
<click selector="{{AdminCartPriceRulesFormSection.actionsHeader}}" stepKey="clickToExpandActions"/>
57+
<selectOption selector="{{AdminCartPriceRulesFormSection.apply}}" userInput="Percent of product price discount" stepKey="selectActionType"/>
58+
<fillField selector="{{AdminCartPriceRulesFormSection.discountAmount}}" userInput="100" stepKey="fillDiscountAmount"/>
59+
<click selector="{{AdminCartPriceRulesFormSection.save}}" stepKey="clickSaveButton"/>
60+
<see selector="{{AdminCartPriceRulesSection.messages}}" userInput="You saved the rule." stepKey="seeSuccessMessage"/>
61+
62+
<!--Proceed to store front and place an order with free shipping using created coupon-->
63+
<!--Add product to card-->
64+
<actionGroup ref="AddSimpleProductToCart" stepKey="AddProductToCard">
65+
<argument name="product" value="$$simpleproduct$$"/>
66+
</actionGroup>
67+
68+
<!--Proceed to shipment-->
69+
<click selector="{{StorefrontMinicartSection.showCart}}" stepKey="clickToOpenCard"/>
70+
<click selector="{{StorefrontMinicartSection.goToCheckout}}" stepKey="clickToProceedToCheckout"/>
71+
<waitForPageLoad stepKey="waitForTheFormIsOpened"/>
72+
73+
<!--Fill shipping form-->
74+
<actionGroup ref="ShipmentFormFreeShippingActionGroup" stepKey="shipmentFormFreeShippingActionGroup"/>
75+
76+
<click selector="{{DiscountSection.DiscountTab}}" stepKey="clickToAddDiscount"/>
77+
<fillField selector="{{DiscountSection.DiscountInput}}" userInput="{{_defaultCoupon.code}}" stepKey="TypeDiscountCode"/>
78+
<click selector="{{DiscountSection.ApplyCodeBtn}}" stepKey="clickToApplyDiscount"/>
79+
<waitForPageLoad stepKey="WaitForDiscountToBeAdded"/>
80+
<see userInput="Your coupon was successfully applied." stepKey="verifyText"/>
81+
82+
<waitForElement selector="{{CheckoutPaymentSection.placeOrder}}" time="30" stepKey="waitForPlaceOrderButton"/>
83+
<click selector="{{CheckoutPaymentSection.placeOrder}}" stepKey="clickPlaceOrder"/>
84+
<grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber}}" stepKey="grabOrderNumber"/>
85+
86+
<!--Proceed to Admin panel > SALES > Orders. Created order should be in Processing status-->
87+
<amOnPage url="/admin/sales/order/" stepKey="navigateToSalesOrderPage"/>
88+
<waitForPageLoad stepKey="waitForSalesOrderPageLoaded"/>
89+
90+
<!-- Open Order -->
91+
<actionGroup ref="filterOrderGridById" stepKey="filterOrderGridById">
92+
<argument name="orderId" value="$grabOrderNumber"/>
93+
</actionGroup>
94+
<click selector="{{AdminOrdersGridSection.firstRow}}" stepKey="clickOrderRow"/>
95+
<waitForPageLoad stepKey="waitForCreatedOrderPageOpened"/>
96+
97+
<!--Verify that Created order is in Processing status-->
98+
<see selector="{{AdminShipmentOrderInformationSection.orderStatus}}" userInput="Processing" stepKey="seeShipmentOrderStatus"/>
99+
</test>
100+
</tests>

app/code/Magento/Payment/etc/config.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
<model>Magento\Payment\Model\Method\Free</model>
1414
<order_status>pending</order_status>
1515
<title>No Payment Information Required</title>
16+
<payment_action>authorize</payment_action>
1617
<allowspecific>0</allowspecific>
1718
<sort_order>1</sort_order>
1819
</free>

app/code/Magento/SalesRule/Test/Mftf/Section/DiscountSection.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@
88
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
99
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
1010
<section name="DiscountSection">
11-
<element name="DiscountTab" type="button" selector="//strong[text()='Apply Discount Code']"/>
11+
<element name="DiscountTab" type="button" selector="//*[text()='Apply Discount Code']"/>
1212
<element name="CouponInput" type="input" selector="#coupon_code"/>
13+
<element name="DiscountInput" type="input" selector="#discount-code"/>
1314
<element name="ApplyCodeBtn" type="button" selector="//span[text()='Apply Discount']"/>
1415
</section>
1516
</sections>
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
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+
<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/DataGenerator/etc/dataProfileSchema.xsd">
9+
<entity name="PaymentMethodsSettingConfig" type="zero_subtotal_checkout_config_state">
10+
<requiredEntity type="active">active</requiredEntity>
11+
<requiredEntity type="order_status">orderStatus</requiredEntity>
12+
</entity>
13+
<entity name="active" type="active">
14+
<data key="value">1</data>
15+
</entity>
16+
<entity name="orderStatus" type="order_status">
17+
<data key="value">processing</data>
18+
</entity>
19+
20+
<entity name="DisablePaymentMethodsSettingConfig" type="use_system_value_config_state">
21+
<requiredEntity type="zeroSubEnable">zeroSubEnable</requiredEntity>
22+
<requiredEntity type="zeroSubOrderStatus">zeroSubOrderStatus</requiredEntity>
23+
</entity>
24+
<entity name="zeroSubEnable" type="zeroSubEnable">
25+
<data key="value">1</data>
26+
</entity>
27+
<entity name="zeroSubOrderStatus" type="zeroSubOrderStatus">
28+
<data key="value">1</data>
29+
</entity>
30+
</entities>
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
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+
<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/DataGenerator/etc/dataProfileSchema.xsd">
9+
<entity name="FreeShippingMethodsSettingConfig" type="free_shipping_config_state">
10+
<requiredEntity type="active">active</requiredEntity>
11+
</entity>
12+
<entity name="active" type="active">
13+
<data key="value">1</data>
14+
</entity>
15+
16+
<!-- default configuration used to restore Magento config -->
17+
<entity name="DefaultShippingMethodsConfig" type="free_shipping_config_state">
18+
<requiredEntity type="active">DefaultFreeShipping</requiredEntity>
19+
</entity>
20+
<entity name="DefaultFreeShipping" type="active">
21+
<data key="value">0</data>
22+
</entity>
23+
24+
<entity name="DisableFreeShippingConfig" type="disable_free_shipping_config_state">
25+
<requiredEntity type="disableFreeShipping">disableFreeShipping</requiredEntity>
26+
</entity>
27+
<entity name="disableFreeShipping" type="disableFreeShipping">
28+
<data key="value">1</data>
29+
</entity>
30+
</entities>
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
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+
<operations xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="../../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/DataGenerator/etc/dataOperation.xsd">
11+
<operation name="EnableZeroSubtotalCheckoutConfigState" dataType="zero_subtotal_checkout_config_state" type="create" auth="adminFormKey" url="/admin/system_config/save/section/payment/" method="POST">
12+
<object key="groups" dataType="zero_subtotal_checkout_config_state">
13+
<object key="free" dataType="zero_subtotal_checkout_config_state">
14+
<object key="fields" dataType="zero_subtotal_checkout_config_state">
15+
<object key="active" dataType="active">
16+
<field key="value">string</field>
17+
</object>
18+
<object key="order_status" dataType="order_status">
19+
<field key="value">string</field>
20+
</object>
21+
</object>
22+
</object>
23+
</object>
24+
</operation>
25+
26+
<operation name="DisablePaymentMethodsSettingConfig" dataType="use_system_value_config_state" type="create" auth="adminFormKey" url="/admin/system_config/save/section/payment/" method="POST">
27+
<object key="groups" dataType="use_system_value_config_state">
28+
<object key="free" dataType="use_system_value_config_state">
29+
<object key="fields" dataType="use_system_value_config_state">
30+
<object key="active" dataType="use_system_value_config_state">
31+
<object key="inherit" dataType="zeroSubEnable">
32+
<field key="value">integer</field>
33+
</object>
34+
</object>
35+
<object key="order_status" dataType="use_system_value_config_state">
36+
<object key="inherit" dataType="zeroSubOrderStatus">
37+
<field key="value">integer</field>
38+
</object>
39+
</object>
40+
</object>
41+
</object>
42+
</object>
43+
</operation>
44+
45+
</operations>
46+
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
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+
<operations xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="../../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/DataGenerator/etc/dataOperation.xsd">
11+
<operation name="EnableFreeShippingConfigState" dataType="free_shipping_config_state" type="create" auth="adminFormKey" url="/admin/system_config/save/section/carriers/" method="POST">
12+
<object key="groups" dataType="free_shipping_config_state">
13+
<object key="freeshipping" dataType="free_shipping_config_state">
14+
<object key="fields" dataType="free_shipping_config_state">
15+
<object key="active" dataType="active">
16+
<field key="value">string</field>
17+
</object>
18+
</object>
19+
</object>
20+
</object>
21+
</operation>
22+
23+
<operation name="DisableFreeShippingConfigState" dataType="disable_free_shipping_config_state" type="create" auth="adminFormKey" url="/admin/system_config/save/section/carriers/" method="POST">
24+
<object key="groups" dataType="disable_free_shipping_config_state">
25+
<object key="freeshipping" dataType="disable_free_shipping_config_state">
26+
<object key="fields" dataType="disable_free_shipping_config_state">
27+
<object key="active" dataType="disable_free_shipping_config_state">
28+
<object key="inherit" dataType="disableFreeShipping">
29+
<field key="value">integer</field>
30+
</object>
31+
</object>
32+
</object>
33+
</object>
34+
</object>
35+
</operation>
36+
37+
</operations>
38+

0 commit comments

Comments
 (0)