Skip to content

Commit 27043e9

Browse files
committed
MAGETWO-94889: Automate with MFTF Free Shipping is not available in Admin if "Minimum Order Amount" does not match Order total
1 parent 9b951ba commit 27043e9

File tree

8 files changed

+41
-120
lines changed

8 files changed

+41
-120
lines changed

app/code/Magento/Config/Test/Mftf/ActionGroup/ConfigFlatRateMethodActionGroup.xml

Lines changed: 0 additions & 33 deletions
This file was deleted.

app/code/Magento/Config/Test/Mftf/ActionGroup/ConfigFreeShippingMethodActionGroup.xml

Lines changed: 0 additions & 38 deletions
This file was deleted.

app/code/Magento/Config/Test/Mftf/Page/AdminConfigPage.xml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,4 @@
2121
<page name="AdminConfigGeneralPage" url="admin/system_config/edit/section/general/" area="admin" module="Magento_Config">
2222
<section name="GeneralSection"/>
2323
</page>
24-
<page name="AdminShippingMethodsPage" url="admin/system_config/edit/section/carriers/" area="admin" module="Magento_Config">
25-
<section name="ShippingMethodsSection"/>
26-
</page>
2724
</pages>

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

Lines changed: 0 additions & 24 deletions
This file was deleted.

app/code/Magento/Sales/Test/Mftf/Section/AdminOrderDetailsMessagesSection.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,5 @@
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
1111
<section name="AdminOrderDetailsMessagesSection">
1212
<element name="successMessage" type="text" selector="div.message-success"/>
13-
<element name="errorMessage" type="text" selector="div.message-error"/>
1413
</section>
1514
</sections>

app/code/Magento/Sales/Test/Mftf/Test/AdminFreeShippingNotAvailableIfMinimumOrderAmountNotMatchOrderTotalTest.xml

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -23,42 +23,41 @@
2323
<requiredEntity createDataKey="createCategory"/>
2424
<field key="price">100</field>
2525
</createData>
26-
<createData entity="Simple_US_Customer" stepKey="customer"/>
26+
<createData entity="Simple_US_Customer" stepKey="createCustomer"/>
27+
<createData entity="DisableFlatRateShippingMethodConfig" stepKey="disableFlatRate"/>
28+
<createData entity="FreeShippinMethodConfig" stepKey="enableFreeShippingMethod"/>
29+
<createData entity="setFreeShippingSubtotal" stepKey="setFreeShippingSubtotal"/>
2730
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
28-
<actionGroup ref="DisableFlatRate" stepKey="disableFlatRate"/>
29-
<actionGroup ref="EnableFreeShipping" stepKey="enableFreeShipping">
30-
<argument name="orderAmount" value="101"/>
31-
</actionGroup>
32-
<actionGroup ref="ClearCacheActionGroup" stepKey="clearCacheBefore"/>
31+
<magentoCLI command="cache:flush" stepKey="flushCache"/>
3332
</before>
3433
<after>
3534
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
3635
<deleteData createDataKey="createProduct" stepKey="deleteProduct"/>
37-
<deleteData createDataKey="customer" stepKey="deleteCustomer"/>
38-
<actionGroup ref="EnableFlatRate" stepKey="enableFlatRate"/>
39-
<actionGroup ref="DisableFreeShipping" stepKey="disableFreeShipping"/>
40-
<actionGroup ref="ClearCacheActionGroup" stepKey="clearCacheAfter"/>
41-
<amOnPage url="{{AdminLogoutPage.url}}" stepKey="amOnLogoutPage"/>
36+
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/>
37+
<createData entity="FlatRateShippingMethodConfig" stepKey="enableFlatRate"/>
38+
<createData entity="FreeShippinMethodDefault" stepKey="disableFreeShippingMethod"/>
39+
<createData entity="setFreeShippingSubtotalToDefault" stepKey="setFreeShippingSubtotalToDefault"/>
40+
<actionGroup ref="logout" stepKey="logout"/>
41+
<magentoCLI command="cache:flush" stepKey="flushCache2"/>
4242
</after>
43-
43+
<!--Create new order with existing customer-->
4444
<actionGroup ref="navigateToNewOrderPageExistingCustomer" stepKey="goToCreateOrderPage">
45-
<argument name="customer" value="Simple_US_Customer"/>
45+
<argument name="customer" value="$$createCustomer$$"/>
4646
</actionGroup>
47-
48-
<!--Admin creates order-->
47+
<!--Add product to order-->
4948
<actionGroup ref="addSimpleProductToOrder" stepKey="addProductToOrder">
50-
<argument name="product" value="SimpleProduct"/>
49+
<argument name="product" value="$$createProduct$$"/>
5150
</actionGroup>
5251

5352
<click selector="{{AdminOrderFormPaymentSection.header}}" stepKey="unfocus"/>
5453
<waitForPageLoad stepKey="waitForJavascriptToFinish"/>
55-
<click selector="{{AdminOrderFormPaymentSection.getShippingMethods}}" stepKey="clickShippingMethods"/>
54+
<!--Click *Get shipping methods and rates* and see that Free Shipping is absent-->
55+
<click selector="{{AdminOrderFormPaymentSection.getShippingMethods}}" stepKey="clickGetShippingMehods"/>
5656
<dontSeeElement selector="{{AdminOrderFormPaymentSection.freeShippingOption}}" stepKey="seeAbsentFreeShipping"/>
57-
58-
<!--Submit Order and verify information-->
57+
<!--Submit Order and verify that Order isn't placed-->
5958
<click selector="{{AdminOrderFormActionSection.SubmitOrder}}" stepKey="clickSubmitOrder"/>
6059

61-
<dontSeeElement selector="{{AdminOrderDetailsMessagesSection.successMessage}}" stepKey="seeSuccessMessage"/>
62-
<seeElement selector="{{AdminOrderDetailsMessagesSection.errorMessage}}" stepKey="seeErrorMessage"/>
60+
<dontSeeElement selector="{{AdminMessagesSection.successMessage}}" stepKey="seeSuccessMessage"/>
61+
<seeElement selector="{{AdminMessagesSection.errorMessage}}" stepKey="seeErrorMessage"/>
6362
</test>
6463
</tests>

app/code/Magento/Shipping/Test/Mftf/Data/FlatRateShippingMethodData.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,13 @@
1313
<entity name="flatRateActiveEnable" type="active">
1414
<data key="value">1</data>
1515
</entity>
16+
<!-- Disable Flat Rate Shipping method config -->
17+
<entity name="DisableFlatRateShippingMethodConfig" type="flat_rate_shipping_method">
18+
<requiredEntity type="active">flatRateActiveDisable</requiredEntity>
19+
</entity>
20+
<entity name="flatRateActiveDisable" type="active">
21+
<data key="value">0</data>
22+
</entity>
1623
<!-- Flat Rate Shipping method default setup -->
1724
<entity name="FlatRateShippingMethodDefault" type="flat_rate_shipping_method">
1825
<requiredEntity type="active">flatRateActiveDefault</requiredEntity>

app/code/Magento/Shipping/Test/Mftf/Data/FreeShippingMethodData.xml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,4 +52,18 @@
5252
<entity name="freeSortOrderDefault" type="sort_order">
5353
<data key="value" />
5454
</entity>
55+
<!--Set Free Shipping Subtotal to 101-->
56+
<entity name="setFreeShippingSubtotal" type="free_shipping_method">
57+
<requiredEntity type="free_shipping_subtotal">freeShippingSubtotal</requiredEntity>
58+
</entity>
59+
<entity name="freeShippingSubtotal" type="free_shipping_subtotal">
60+
<data key="value">101</data>
61+
</entity>
62+
<!--Set to default Free Shipping Subtotal-->
63+
<entity name="setFreeShippingSubtotalToDefault" type="free_shipping_method">
64+
<requiredEntity type="free_shipping_subtotal">freeShippingSubtotalDefault</requiredEntity>
65+
</entity>
66+
<entity name="freeShippingSubtotalDefault" type="free_shipping_subtotal">
67+
<data key="value">0</data>
68+
</entity>
5569
</entities>

0 commit comments

Comments
 (0)