Skip to content

MFTF: Shipping To Multiple Addresses If Maximum QTY Limit Was Reached #33372

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="StorefrontUpdateProductQTYOnShoppingCartPageActionGroup">
<arguments>
<argument name="product" type="entity"/>
<argument name="qty" type="string"/>
</arguments>
<fillField selector="{{CheckoutCartProductSection.ProductQuantityByName(product)}}" userInput="{{qty}}" stepKey="changeCartQty"/>
<click selector="{{CheckoutCartProductSection.updateShoppingCartButton}}" stepKey="clickUpdateShoppingCart"/>
<waitForPageLoad stepKey="waitForCheckoutPageLoad"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,6 @@
<element name="shippingMethodElementId" type="radio" selector="#s_method_{{carrierCode}}_{{methodCode}}" parameterized="true" timeout="30"/>
<element name="estimateShippingAndTaxForm" type="block" selector="#shipping-zip-form"/>
<element name="proceedToCheckoutDisabled" type="button" selector=".action.primary.checkout.disabled" timeout="60"/>
<element name="checkoutWithMultipleAddresses" type="button" selector=".cart-summary .action.multicheckout"/>
</section>
</sections>
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="AssertStorefrontMultiShippingOptionIsNotPresentOnShoppingCartPageActionGroup">
<dontSeeElement selector="{{CheckoutCartSummarySection.checkoutWithMultipleAddresses}}" stepKey="seeMultiCheckoutBtn"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="AssertStorefrontMultiShippingOptionIsPresentOnShoppingCartPageActionGroup">
<seeElement selector="{{CheckoutCartSummarySection.checkoutWithMultipleAddresses}}" stepKey="dontSeeMultiCheckoutBtn"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd">
<entity name="MaximumQtyAllowed2ForShippingToMultipleAddressesConfigData">
<data key="path">multishipping/options/checkout_multiple_maximum_qty</data>
<data key="value">2</data>
</entity>
<!-- Magento Default Value -->
<entity name="MaximumQtyAllowed100ForShippingToMultipleAddressesConfigData">
<data key="path">multishipping/options/checkout_multiple_maximum_qty</data>
<data key="value">100</data>
</entity>
</entities>
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
<test name="StorefrontCheckoutShippingToMultipleAddressesIfMaximumQtyLimitWasReachedTest">
<annotations>
<features value="Sales"/>
<stories value="Order Placement With Maximum QTY Limit for Shipping To Multiple Addresses"/>
<title value="Maximum QTY Limit for Shipping To Multiple Addresses Was Reached"/>
<description value="Customer should not be able ship to multiple addresses if Maximum QTY limit was reached in shopping cart"/>
<severity value="MAJOR"/>
<group value="checkout"/>
</annotations>
<before>
<magentoCLI command="config:set {{MaximumQtyAllowed2ForShippingToMultipleAddressesConfigData.path}} {{MaximumQtyAllowed2ForShippingToMultipleAddressesConfigData.value}}" stepKey="setMaximumQty2"/>
<createData entity="Simple_US_Customer" stepKey="createCustomer"/>
<createData entity="SimpleSubCategory" stepKey="createCategory"/>
<createData entity="SimpleProduct" stepKey="createProduct">
<requiredEntity createDataKey="createCategory"/>
</createData>
<actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanInvalidatedCaches">
<argument name="tags" value="config full_page"/>
</actionGroup>
</before>
<after>
<magentoCLI command="config:set {{MaximumQtyAllowed100ForShippingToMultipleAddressesConfigData.path}} {{MaximumQtyAllowed100ForShippingToMultipleAddressesConfigData.value}}" stepKey="setDefaultMaximumQty"/>
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
<deleteData createDataKey="createProduct" stepKey="deleteProduct"/>
<actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="logoutCustomer"/>
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/>
<actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanInvalidatedCaches">
<argument name="tags" value="config full_page"/>
</actionGroup>
</after>

<actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginToStorefrontAccount">
<argument name="Customer" value="$createCustomer$"/>
</actionGroup>
<actionGroup ref="OpenProductFromCategoryPageActionGroup" stepKey="openProductFromCategory">
<argument name="category" value="$createCategory$"/>
<argument name="product" value="$createProduct$"/>
</actionGroup>
<actionGroup ref="StorefrontAddProductToCartWithQtyActionGroup" stepKey="addProductToTheCart">
<argument name="productQty" value="1"/>
</actionGroup>
<actionGroup ref="StorefrontCartPageOpenActionGroup" stepKey="navigateToCartPage"/>
<actionGroup ref="AssertStorefrontMultiShippingOptionIsPresentOnShoppingCartPageActionGroup" stepKey="assertMultiCheckoutAvailable"/>
<actionGroup ref="StorefrontUpdateProductQTYOnShoppingCartPageActionGroup" stepKey="updateProductQty">
<argument name="product" value="$createProduct.name$"/>
<argument name="qty" value="3"/>
</actionGroup>
<actionGroup ref="AssertStorefrontMultiShippingOptionIsNotPresentOnShoppingCartPageActionGroup" stepKey="assertMultiCheckoutIsNotAvailable"/>
</test>
</tests>