Skip to content

Commit

Permalink
Merge pull request #55 from magento-tsg-csl3/MC-40303
Browse files Browse the repository at this point in the history
MC-40303: Store address overrides customer information when in-store delivery is enabled
  • Loading branch information
viktym authored Feb 1, 2021
2 parents 6919581 + 429b171 commit 22f110e
Show file tree
Hide file tree
Showing 2 changed files with 110 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
<?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="StorefrontBillingAddressClearFieldsAfterRefreshingPageTest">
<annotations>
<stories value="Simple Product Custom Stock."/>
<title value="Billing address fields should be cleared after refreshing checkout page with store pickup delivery method"/>
<description value="Verify billing address checkout fields will be cleared after refreshing page with store pickup and simple product on custom source"/>
<testCaseId value="MC-40489"/>
<useCaseId value="MC-40303"/>
<severity value="CRITICAL"/>
<group value="msi"/>
<group value="store_pickup"/>
</annotations>
<before>
<!--Set Distance Provider for Distance Based SSA to offline-->
<magentoCLI command="config:set {{OfflineDistanceProviderForDistanceBasedSSA.path}} {{OfflineDistanceProviderForDistanceBasedSSA.value}}" stepKey="setDistanceProviderToOffline"/>
<!--Enable 'In Store Pickup' shipping method-->
<magentoCLI command="config:set {{EnableInStorePickup.path}} {{EnableInStorePickup.value}}" stepKey="enableInStorePickupMethod"/>
<!--Download tables for 'US'-->
<magentoCLI command="{{ImportTables.path}} {{USTable.value}}" stepKey="downloadTables"/>
<magentoCLI command="indexer:reindex" stepKey="performReindex"/>
<magentoCLI command="cache:flush" stepKey="cleanCache"/>
<!--Create test data-->
<createData entity="CulverStorePickupEnabledSource" stepKey="culverSource"/>
<createData entity="AustinStorePickupEnabledSource" stepKey="austinSource"/>
<createData entity="BasicMsiStockWithMainWebsite1" stepKey="stock"/>
<createData entity="SourceStockLinked1" stepKey="sourceStockLink1">
<requiredEntity createDataKey="stock"/>
<requiredEntity createDataKey="culverSource"/>
</createData>
<createData entity="SourceStockLinked1" stepKey="sourceStockLink2">
<requiredEntity createDataKey="stock"/>
<requiredEntity createDataKey="austinSource"/>
</createData>
<createData entity="_defaultCategory" stepKey="category"/>
<createData entity="SimpleProduct" stepKey="product">
<requiredEntity createDataKey="category"/>
</createData>
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
<!--Assign product to sources-->
<actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="openProductEditPage">
<argument name="productId" value="$$product.id$$"/>
</actionGroup>
<actionGroup ref="UnassignSourceFromProductActionGroup" stepKey="unassignDefaultSourceFromProduct">
<argument name="sourceCode" value="{{_defaultSource.name}}"/>
</actionGroup>
<actionGroup ref="AdminAssignSourceToProductAndSetSourceQuantityActionGroup" stepKey="assignCulverSourceAndSetQty">
<argument name="sourceCode" value="$culverSource.source[source_code]$"/>
</actionGroup>
<actionGroup ref="AdminAssignSourceToProductAndSetSourceQuantityActionGroup" stepKey="assignAustinSourceAndSetQty">
<argument name="sourceCode" value="$austinSource.source[source_code]$"/>
</actionGroup>
<actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/>
</before>
<after>
<!--Revert Distance Provider for Distance Based SSA to online-->
<magentoCLI command="config:set {{OnlineDistanceProviderForDistanceBasedSSA.path}} {{OnlineDistanceProviderForDistanceBasedSSA.value}}" stepKey="setDistanceProviderToOffline"/>
<!--Disable 'In Store Pickup' shipping method-->
<magentoCLI command="config:set {{DisableInStorePickup.path}} {{DisableInStorePickup.value}}" stepKey="enableInStorePickupMethod"/>
<deleteData createDataKey="category" stepKey="deleteCategory"/>
<deleteData createDataKey="product" stepKey="deleteProduct"/>
<!--Assign Default Stock to Default Website-->
<actionGroup ref="AssignWebsiteToStockActionGroup" stepKey="assignMainWebsiteToDefaultStock">
<argument name="stockName" value="{{_defaultStock.name}}"/>
<argument name="websiteName" value="{{_defaultWebsite.name}}"/>
</actionGroup>
<deleteData createDataKey="stock" stepKey="deleteStock"/>
<actionGroup ref="DisableAllSourcesActionGroup" stepKey="disableAllSources"/>
<actionGroup ref="AdminLogoutActionGroup" stepKey="logoutOfAdmin"/>
</after>
<!--Add product to cart-->
<actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addProductToCart">
<argument name="product" value="$product$"/>
</actionGroup>
<!--Navigate to checkout from minicart-->
<actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="goToCheckoutFromMinicart"/>
<!--Filling shipping information and click next-->
<actionGroup ref="GuestCheckoutFillingShippingSectionActionGroup" stepKey="guestCheckoutFillingShipping">
<argument name="shippingMethod" value="Flat Rate"/>
</actionGroup>
<!--Go back to shipping step and choose Pick In Store and fill all info about pick in store and click next-->
<click selector="{{CheckoutHeaderSection.shippingMethodStep}}" stepKey="goToShipping"/>
<actionGroup ref="StorefrontPickInStoreActionGroup" stepKey="pickInStore"/>
<actionGroup ref="StorefrontPickInStoreNavigateToSelectStoreActionGroup" stepKey="navigateToSelectStores"/>
<actionGroup ref="StorefrontPickInStoreSelectSourceActionGroup" stepKey="selectSource">
<argument name="searchString" value="{{CulverStorePickupEnabledSource.city}}"/>
<argument name="sourceName" value="$culverSource.source[name]$"/>
</actionGroup>
<actionGroup ref="StorefrontPickInStoreNavigateToPaymentActionGroup" stepKey="navigateToPaymentStep"/>
<!--Refresh Page-->
<reloadPage stepKey="reloadCheckoutPage"/>
<waitForPageLoad stepKey="waitForCheckoutPage"/>
<!--Grab value from first name field and assert this field is empty-->
<dontSeeElement selector="{{CheckoutPaymentSection.billingAddressNotSameCheckbox}}" stepKey="shippingAndBillingAddressAreTheSameIsNotVisible"/>
<grabValueFrom selector="{{CheckoutPaymentSection.guestFirstName}}" stepKey="grabGuestFirstName"/>
<assertEmpty after="grabGuestFirstName" stepKey="verifyEmptyGuestFirstName">
<actualResult type="const">$grabGuestFirstName</actualResult>
</assertEmpty>
</test>
</tests>
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ define([

this.preselectLocation();
this.selectShippingMethod(pickupShippingMethod);
checkoutData.setSelectedShippingRate(this.rate['carrier_code'] + '_' + this.rate['method_code']);
},

/**
Expand Down Expand Up @@ -265,6 +266,7 @@ define([
}
});
}
this.convertAddressType(quote.shippingAddress());
},

/**
Expand Down

0 comments on commit 22f110e

Please sign in to comment.