Skip to content

Commit 078c387

Browse files
Merge pull request #9391 from adobe-commerce-tier-4/PR-VK-2024-11-27-CE
PR-VK-2024-11-27-CE
2 parents 7d5e390 + 47e1a8d commit 078c387

File tree

31 files changed

+1699
-376
lines changed

31 files changed

+1699
-376
lines changed

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

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!--
3-
/**
4-
* Copyright © Magento, Inc. All rights reserved.
5-
* See COPYING.txt for license details.
6-
*/
3+
/**
4+
* Copyright 2020 Adobe
5+
* All Rights Reserved.
6+
*/
77
-->
88

99
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
@@ -16,6 +16,7 @@
1616
<waitForElementVisible selector="{{CheckoutShippingSection.updateAddress}}" stepKey="waitForUpdateButton"/>
1717
<waitForElementClickable selector="{{CheckoutShippingSection.updateAddress}}" stepKey="waitForUpdateButtonClickable"/>
1818
<click selector="{{CheckoutShippingSection.updateAddress}}" stepKey="clickUpdateButton"/>
19+
<waitForElementVisible selector="{{CheckoutShippingSection.billingAddressDetails}}" stepKey="waitForBillingAddressUpdate"/>
1920
<waitForPageLoad stepKey="waitForAddressSaved"/>
2021
</actionGroup>
2122
</actionGroups>

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

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!--
3-
/**
4-
* Copyright © Magento, Inc. All rights reserved.
5-
* See COPYING.txt for license details.
6-
*/
3+
/**
4+
* Copyright 2019 Adobe
5+
* All Rights Reserved.
6+
*/
77
-->
88

99
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
@@ -19,6 +19,7 @@
1919
<argument name="orderSummaryTotal" type="string"/>
2020
</arguments>
2121

22+
<wait time="30" stepKey="waitForShippingSummary"/>
2223
<see selector="{{CheckoutPaymentSection.orderSummarySubtotal}}" userInput="{{orderSummarySubTotal}}" stepKey="seeCorrectSubtotal"/>
2324
<see selector="{{CheckoutPaymentSection.orderSummaryShippingTotal}}" userInput="{{orderSummaryShippingTotal}}" stepKey="seeCorrectShipping"/>
2425
<see selector="{{CheckoutPaymentSection.orderSummaryTotal}}" userInput="{{orderSummaryTotal}}" stepKey="seeCorrectOrderTotal"/>

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

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!--
3-
/**
4-
* Copyright © Magento, Inc. All rights reserved.
5-
* See COPYING.txt for license details.
6-
*/
3+
/**
4+
* Copyright 2017 Adobe
5+
* All Rights Reserved.
6+
*/
77
-->
88

99
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
@@ -37,6 +37,7 @@
3737
<element name="next" type="button" selector="button.button.action.continue.primary" timeout="30"/>
3838
<element name="firstShippingMethod" type="radio" selector="//*[@id='checkout-shipping-method-load']//input[@class='radio']"/>
3939
<element name="defaultShipping" type="button" selector=".billing-address-details"/>
40+
<element name="billingAddressDetails" type="text" selector=".billing-address-details"/>
4041
<element name="state" type="button" selector="//*[text()='Alabama']"/>
4142
<element name="stateInput" type="input" selector="input[name=region]"/>
4243
<element name="regionOptions" type="select" selector="select[name=region_id] option"/>

app/code/Magento/Checkout/view/frontend/web/js/checkout-data.js

+22-7
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
2-
* Copyright © Magento, Inc. All rights reserved.
3-
* See COPYING.txt for license details.
2+
* Copyright 2015 Adobe
3+
* All Rights Reserved.
44
*/
55

66
/**
@@ -17,6 +17,7 @@ define([
1717
'use strict';
1818

1919
var cacheKey = 'checkout-data',
20+
storeCode = window.checkoutConfig.storeCode,
2021

2122
/**
2223
* @param {Object} data
@@ -57,6 +58,20 @@ define([
5758
}
5859

5960
return data;
61+
},
62+
getShippingAddressByStore = function (shippingAddressObj) {
63+
if (!shippingAddressObj) {
64+
return null;
65+
}
66+
67+
return shippingAddressObj[storeCode];
68+
},
69+
setShippingAddressByStore = function (shippingAddressObj, data) {
70+
if (!shippingAddressObj) {
71+
shippingAddressObj = {};
72+
}
73+
shippingAddressObj[storeCode] = utils.filterFormData(data);
74+
return shippingAddressObj;
6075
};
6176

6277
return {
@@ -87,9 +102,9 @@ define([
87102
* @param {Object} data
88103
*/
89104
setShippingAddressFromData: function (data) {
90-
var obj = getData();
105+
let obj = getData();
91106

92-
obj.shippingAddressFromData = utils.filterFormData(data);
107+
obj.shippingAddressFromData = setShippingAddressByStore(obj.shippingAddressFromData, data);
93108
saveData(obj);
94109
},
95110

@@ -99,7 +114,7 @@ define([
99114
* @return {*}
100115
*/
101116
getShippingAddressFromData: function () {
102-
return getData().shippingAddressFromData;
117+
return getShippingAddressByStore(getData().shippingAddressFromData);
103118
},
104119

105120
/**
@@ -110,7 +125,7 @@ define([
110125
setNewCustomerShippingAddress: function (data) {
111126
var obj = getData();
112127

113-
obj.newCustomerShippingAddress = data;
128+
obj.newCustomerShippingAddress = setShippingAddressByStore(obj.newCustomerShippingAddress, data);
114129
saveData(obj);
115130
},
116131

@@ -120,7 +135,7 @@ define([
120135
* @return {*}
121136
*/
122137
getNewCustomerShippingAddress: function () {
123-
return getData().newCustomerShippingAddress;
138+
return getShippingAddressByStore(getData().newCustomerShippingAddress);
124139
},
125140

126141
/**

0 commit comments

Comments
 (0)