Skip to content

Commit f264863

Browse files
Merge remote-tracking branch '36463/fix-for-issue-33725' into comm_voted_v3
2 parents 3ebec1e + e7455f3 commit f264863

9 files changed

+65
-5
lines changed

app/code/Magento/Checkout/Test/Mftf/ActionGroup/CheckoutSelectFlatRateShippingMethodActionGroup.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,10 @@
1111
<!-- Checkout select Flat Rate shipping method -->
1212
<actionGroup name="CheckoutSelectFlatRateShippingMethodActionGroup">
1313
<annotations>
14-
<description>Clicks on the 'Flat Rate' Shipping Method on the Storefront Checkout page.</description>
14+
<description>Waits for Shipping Section load. Clicks on the 'Flat Rate' Shipping Method on the Storefront Checkout page.</description>
1515
</annotations>
1616

17+
<waitForElementClickable selector="{{CheckoutShippingMethodsSection.shippingMethodFlatRate}}" stepKey="waitForFlatRateShippingMethod"/>
1718
<conditionalClick selector="{{CheckoutShippingMethodsSection.checkShippingMethodByName('Flat Rate')}}" dependentSelector="{{CheckoutShippingMethodsSection.checkShippingMethodByName('Flat Rate')}}" visible="true" stepKey="selectFlatRateShippingMethod"/>
1819
<waitForPageLoad stepKey="waitForLoadingMaskForNextButton"/>
1920
</actionGroup>

app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontGuestCheckoutProceedToPaymentStepActionGroup.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,10 @@
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
1111
<actionGroup name="StorefrontGuestCheckoutProceedToPaymentStepActionGroup">
1212
<annotations>
13-
<description>Clicks next on Checkout Shipping step. Waits for Payment step</description>
13+
<description>Waits for Shipping Section load. Clicks next on Checkout Shipping step. Waits for Payment step</description>
1414
</annotations>
1515

16+
<waitForElementClickable selector="{{CheckoutShippingGuestInfoSection.next}}" stepKey="waitForNextButtonClickable"/>
1617
<click selector="{{CheckoutShippingGuestInfoSection.next}}" stepKey="clickNext"/>
1718
<waitForElement selector="{{CheckoutPaymentSection.paymentSectionTitle}}" stepKey="waitForPaymentSectionLoaded" after="clickNext"/>
1819
<seeCurrentUrlMatches regex="~/checkout/?#payment~" stepKey="assertCheckoutPaymentUrl"/>

app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontSelectFirstShippingMethodActionGroup.xml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,10 @@
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
1111
<actionGroup name="StorefrontSelectFirstShippingMethodActionGroup">
1212
<annotations>
13-
<description>Select first shipping method.</description>
13+
<description>Waits for Shipping Section load. Select first shipping method.</description>
1414
</annotations>
15-
15+
16+
<waitForElementClickable selector="{{CheckoutShippingMethodsSection.next}}" stepKey="waitForShippingMethod"/>
1617
<click selector="{{CheckoutShippingMethodsSection.firstShippingMethod}}" stepKey="selectFirstShippingMethod"/>
1718
<waitForLoadingMaskToDisappear stepKey="waitForMaskDisappear"/>
1819
</actionGroup>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
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="StorefrontGuestCheckoutWithSameShippingAndBillingAddressEnabledCheckboxTest">
12+
<annotations>
13+
<features value="Checkout"/>
14+
<stories value="My billing and shipping address are same checkbox should be checked by default"/>
15+
<title value="My billing and shipping address are same checkbox should be checked by default"/>
16+
<description value="Check that My billing and shipping address are same checkbox should be checked by default"/>
17+
<severity value="AVERAGE"/>
18+
<testCaseId value="AC-8596"/>
19+
<group value="checkout"/>
20+
</annotations>
21+
22+
<before>
23+
<magentoCLI command="config:set {{EnableFlatRateConfigData.path}} {{EnableFlatRateConfigData.value}}" stepKey="enableFlatRate"/>
24+
<createData entity="SimpleProduct2" stepKey="createProduct"/>
25+
</before>
26+
27+
<after>
28+
<deleteData createDataKey="createProduct" stepKey="deleteProduct"/>
29+
</after>
30+
31+
<actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openProductPage">
32+
<argument name="productUrl" value="$createProduct.custom_attributes[url_key]$"/>
33+
</actionGroup>
34+
<actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addToCartFromStorefrontProductPage">
35+
<argument name="productName" value="$createProduct.name$"/>
36+
</actionGroup>
37+
<actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="goToCheckoutFromMinicart"/>
38+
<actionGroup ref="GuestCheckoutFillNewShippingAddressActionGroup" stepKey="fillShippingSectionAsGuest">
39+
<argument name="customer" value="CustomerEntityOne"/>
40+
<argument name="address" value="CustomerAddressSimple"/>
41+
</actionGroup>
42+
<waitForElementVisible selector="{{CheckoutShippingSection.next}}" time="30" stepKey="waitForNextButton"/>
43+
<click selector="{{CheckoutShippingSection.next}}" stepKey="clickNext"/>
44+
<waitForPageLoad stepKey="waitForPaymentLoading"/>
45+
<waitForElementVisible selector="{{CheckoutPaymentSection.paymentSectionTitle}}" time="30" stepKey="waitForPaymentSectionLoaded"/>
46+
<seeCheckboxIsChecked selector="{{CheckoutPaymentSection.billingAddressNotSameCheckbox}}" stepKey="shippingAndBillingAddressIsSameChecked"/>
47+
</test>
48+
</tests>

app/code/Magento/Checkout/Test/Mftf/Test/StorefrontPersistentDataForGuestCustomerWithPhysicalQuoteTest.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@
6767
<fillField selector="{{CheckoutShippingGuestInfoSection.regionInput}}" userInput="" stepKey="changeStateProvinceField"/>
6868
<fillField selector="{{CheckoutShippingGuestInfoSection.postcode}}" userInput="KW1 7NQ" stepKey="changeZipPostalCodeField"/>
6969
<!-- 8. Change shipping rate, select Free Shipping -->
70+
<waitForElementClickable selector="{{CheckoutShippingMethodsSection.shippingMethodFreeShipping}}" stepKey="waitForFreeShippingShippingMethod"/>
7071
<checkOption selector="{{CheckoutShippingMethodsSection.checkShippingMethodByName('Free Shipping')}}" stepKey="checkFreeShippingAsShippingMethod"/>
7172
<!-- 9. Fill other fields -->
7273
<actionGroup ref="StorefrontFillGuestShippingInfoActionGroup" stepKey="fillOtherFieldsInCheckoutShippingSection"/>

app/code/Magento/Checkout/view/frontend/web/js/model/cart/estimate-service.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@ define([
7272
cartCache.set('totals', quote.getTotals());
7373
}
7474
}
75+
// unset loader on shipping rates list
76+
shippingService.isLoading(false);
7577
},
7678

7779
/**

app/code/Magento/Checkout/view/frontend/web/js/model/shipping-rates-validator.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ define([
1717
'mage/translate',
1818
'uiRegistry',
1919
'Magento_Checkout/js/model/shipping-address/form-popup-state',
20+
'Magento_Checkout/js/model/shipping-service',
2021
'Magento_Checkout/js/model/quote'
2122
], function (
2223
$,
@@ -28,7 +29,8 @@ define([
2829
defaultValidator,
2930
$t,
3031
uiRegistry,
31-
formPopUpState
32+
formPopUpState,
33+
shippingService
3234
) {
3335
'use strict';
3436

@@ -146,6 +148,8 @@ define([
146148
}, delay);
147149

148150
if (!formPopUpState.isVisible()) {
151+
// Prevent shipping methods showing none available whilst we resolve
152+
shippingService.isLoading(true);
149153
clearTimeout(self.validateAddressTimeout);
150154
self.validateAddressTimeout = setTimeout(function () {
151155
self.validateFields();

app/code/Magento/Shipping/Test/Mftf/Test/StorefrontAssertShippingPricesPresentAfterApplyingCartRuleTest.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@
8282
</actionGroup>
8383
<see selector="{{CheckoutShippingMethodsSection.shippingRatePriceByName('Fixed')}}" userInput="$5.00" stepKey="assertFlatRatedMethodPrice"/>
8484
<see selector="{{CheckoutShippingMethodsSection.shippingRatePriceByName('Table Rate')}}" userInput="$7.99" stepKey="assertTableRatedMethodPrice"/>
85+
<waitForElementClickable selector="{{CheckoutShippingMethodsSection.shippingMethodFlatRate}}" stepKey="waitForFlatRateShippingMethod"/>
8586
<click selector="{{CheckoutShippingMethodsSection.checkShippingMethodByName('Flat Rate')}}" stepKey="selectFlatRateShippingMethod"/>
8687
<actionGroup ref="StorefrontCheckoutClickNextButtonActionGroup" stepKey="goToPaymentStep"/>
8788
<actionGroup ref="StorefrontApplyDiscountCodeActionGroup" stepKey="applyCoupon">

dev/tests/js/jasmine/tests/app/code/Magento/Checkout/frontend/js/model/cart/estimate-service.test.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ define([
4141
},
4242
'Magento_Checkout/js/model/shipping-service': {
4343
setShippingRates: function () {},
44+
isLoading: ko.observable(),
4445
getShippingRates: function () {
4546
return ko.observable(rates);
4647
}

0 commit comments

Comments
 (0)