Skip to content

Commit e3de216

Browse files
Merge branch '2.4-develop' into spartans_pr_11072024_AC-12119
2 parents 64c831d + 90e25b6 commit e3de216

26 files changed

+711
-30
lines changed

app/code/Magento/Catalog/Model/Product.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1877,8 +1877,10 @@ public function toArray(array $arrAttributes = [])
18771877
{
18781878
$data = parent::toArray($arrAttributes);
18791879
$stock = $this->getStockItem();
1880-
if ($stock) {
1880+
if (is_object($stock) && method_exists($stock, 'toArray')) {
18811881
$data['stock_item'] = $stock->toArray();
1882+
} elseif (is_array($stock)) {
1883+
$data['stock_item'] = $stock;
18821884
}
18831885
unset($data['stock_item']['product']);
18841886
return $data;
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AdminChangeProductNameAsPerStoreViewScopeActionGroup">
12+
<annotations>
13+
<description>Admin change product name having store view scope</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="productName" type="string"/>
17+
</arguments>
18+
<waitForElementClickable selector="{{AdminProductFormSection.productNameUseDefault}}" stepKey="waitForDefaultNameCheckBox"/>
19+
<uncheckOption selector="{{AdminProductFormSection.productNameUseDefault}}" stepKey="unCheckDefaultNameCheckbox"/>
20+
<fillField selector="{{AdminProductFormSection.productName}}" userInput="{{productName}}" stepKey="changeProductName"/>
21+
</actionGroup>
22+
</actionGroups>

app/code/Magento/Catalog/Test/Mftf/Data/CatalogAttributeSetData.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,9 @@
1313
<data key="attributeGroupId">7</data>
1414
<data key="skeletonId">4</data>
1515
</entity>
16+
<entity name="CatalogAdditionalAttributeSet" type="CatalogAttributeSet">
17+
<data key="attribute_set_name" unique="suffix">additional_set_</data>
18+
<data key="attributeGroupId">7</data>
19+
<data key="skeletonId">4</data>
20+
</entity>
1621
</entities>

app/code/Magento/Catalog/Test/Mftf/Section/AdminProductRelatedUpSellCrossSellSection/AdminProductFormRelatedUpSellCrossSellSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,6 @@
2323
<element name="removeCrossSellProduct" type="button" selector="//span[text()='Cross-Sell Products']//..//..//..//span[text()='{{productName}}']//..//..//..//..//..//button[@class='action-delete']" parameterized="true"/>
2424
<element name="removeUpsellProduct" type="button" selector="//span[text()='Up-Sell Products']//..//..//..//span[text()='{{productName}}']//..//..//..//..//..//button[@class='action-delete']" parameterized="true"/>
2525
<element name="relatedUpSellCrossSellProductStagingSectionText" type="text" selector=".fieldset-wrapper.admin__fieldset-section[data-index='{{catalogStagingSection}}']" parameterized="true"/>
26+
<element name="relatedProductStatus" type="text" selector="//div[@class='admin__field-control']//div[@class='control-table-text']//span[@data-index='status']"/>
2627
</section>
2728
</sections>
Lines changed: 145 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
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+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
10+
<test name="AdminChangeRelatedProductPropertiesOnStoreViewLevelTest">
11+
<annotations>
12+
<features value="Catalog"/>
13+
<stories value="Product properties as per store view"/>
14+
<title value="Change related product properties on store view level"/>
15+
<description value="Change name and status of product properties on diferrent store view levels"/>
16+
<severity value="MAJOR"/>
17+
<testCaseId value="AC-4491"/>
18+
</annotations>
19+
<before>
20+
<!-- Login as admin -->
21+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
22+
<!--Create product A-->
23+
<createData entity="SimpleProduct" stepKey="createSimpleProductA"/>
24+
<!--Create product B-->
25+
<createData entity="SimpleProduct" stepKey="createSimpleProductB"/>
26+
<!--Create website 1-->
27+
<actionGroup ref="AdminCreateWebsiteActionGroup" stepKey="createWebsite1">
28+
<argument name="newWebsiteName" value="{{NewWebSiteData.name}}"/>
29+
<argument name="websiteCode" value="{{NewWebSiteData.code}}"/>
30+
</actionGroup>
31+
<!-- Create store 1-->
32+
<actionGroup ref="AdminCreateNewStoreGroupActionGroup" stepKey="createStore1">
33+
<argument name="website" value="{{NewWebSiteData.name}}"/>
34+
<argument name="storeGroupName" value="{{NewWebSiteData.name}}"/>
35+
<argument name="storeGroupCode" value="{{NewWebSiteData.code}}"/>
36+
</actionGroup>
37+
<!-- Create store view 1-->
38+
<actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createStoreView1">
39+
<argument name="StoreGroup" value="NewWebSiteData"/>
40+
<argument name="customStore" value="NewWebSiteData"/>
41+
</actionGroup>
42+
<!--Create website 2-->
43+
<actionGroup ref="AdminCreateWebsiteActionGroup" stepKey="createWebsite2">
44+
<argument name="newWebsiteName" value="{{secondCustomWebsite.name}}"/>
45+
<argument name="websiteCode" value="{{secondCustomWebsite.code}}"/>
46+
</actionGroup>
47+
<!-- Create store 2-->
48+
<actionGroup ref="AdminCreateNewStoreGroupActionGroup" stepKey="createStore2">
49+
<argument name="website" value="{{secondCustomWebsite.name}}"/>
50+
<argument name="storeGroupName" value="{{secondCustomWebsite.name}}"/>
51+
<argument name="storeGroupCode" value="{{secondCustomWebsite.code}}"/>
52+
</actionGroup>
53+
<!-- Create store view 2-->
54+
<actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createStoreView2">
55+
<argument name="StoreGroup" value="secondCustomWebsite"/>
56+
<argument name="customStore" value="secondCustomWebsite"/>
57+
</actionGroup>
58+
</before>
59+
<after>
60+
<!--Delete product-->
61+
<deleteData createDataKey="createSimpleProductA" stepKey="deleteSimpleProductA"/>
62+
<!--Delete product-->
63+
<deleteData createDataKey="createSimpleProductB" stepKey="deleteSimpleProductB"/>
64+
<!--Delete website 1-->
65+
<actionGroup ref="AdminDeleteWebsiteActionGroup" stepKey="DeleteWebsite1">
66+
<argument name="websiteName" value="{{NewWebSiteData.name}}"/>
67+
</actionGroup>
68+
<!--Delete website 2-->
69+
<actionGroup ref="AdminDeleteWebsiteActionGroup" stepKey="DeleteWebsite2">
70+
<argument name="websiteName" value="{{secondCustomWebsite.name}}"/>
71+
</actionGroup>
72+
<!--Logout as Admin-->
73+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logoutAsAdmin"/>
74+
</after>
75+
<!--Open simple product A-->
76+
<actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="openSimpleProductA">
77+
<argument name="productId" value="$$createSimpleProductA.id$$"/>
78+
</actionGroup>
79+
<!--Assign product A to website 1-->
80+
<actionGroup ref="AdminAssignProductInWebsiteActionGroup" stepKey="assignProductAtoWebsite1">
81+
<argument name="website" value="{{NewWebSiteData.name}}"/>
82+
</actionGroup>
83+
<!--Assign product A to website 2-->
84+
<actionGroup ref="AdminAssignProductInWebsiteActionGroup" stepKey="assignProductAtoWebsit2">
85+
<argument name="website" value="{{secondCustomWebsite.name}}"/>
86+
</actionGroup>
87+
<!--Add simple product B as related product-->
88+
<actionGroup ref="AddRelatedProductBySkuActionGroup" stepKey="addProductBasRelatedProduct">
89+
<argument name="sku" value="$$createSimpleProductB.sku$$"/>
90+
</actionGroup>
91+
<!--Save product A-->
92+
<actionGroup ref="SaveProductFormActionGroup" stepKey="saveProductA"/>
93+
<!--Open simple product B-->
94+
<actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="openSimpleProductB">
95+
<argument name="productId" value="$$createSimpleProductB.id$$"/>
96+
</actionGroup>
97+
<!--Assign product B to website 1-->
98+
<actionGroup ref="AdminAssignProductInWebsiteActionGroup" stepKey="assignProductBtoWebsite1">
99+
<argument name="website" value="{{NewWebSiteData.name}}"/>
100+
</actionGroup>
101+
<!--Assign product B to website 2-->
102+
<actionGroup ref="AdminAssignProductInWebsiteActionGroup" stepKey="assignProductBtoWebsite2">
103+
<argument name="website" value="{{secondCustomWebsite.name}}"/>
104+
</actionGroup>
105+
<!--Save product B-->
106+
<actionGroup ref="SaveProductFormActionGroup" stepKey="saveProductB"/>
107+
<!--Change Scope to store view 2-->
108+
<actionGroup ref="SwitchToTheNewStoreViewActionGroup" stepKey="changeScopeToStoreView2">
109+
<argument name="storeViewName" value="{{secondCustomWebsite.name}}"/>
110+
</actionGroup>
111+
<!--Uncheck default product status-->
112+
<waitForElementVisible selector="{{AdminProductFormSection.productStatusUseDefault}}" stepKey="waitForDefaultValueCheckBox"/>
113+
<uncheckOption selector="{{AdminProductFormSection.productStatusUseDefault}}" stepKey="uncheckDefaultProductStatus"/>
114+
<!-- Change status of product to "Disable" and save it having scope as Website-->
115+
<actionGroup ref="AdminSetProductDisabledActionGroup" stepKey="disableProductStatusHavingScopeWebsite"/>
116+
<!--Change product name having scope as store view-->
117+
<actionGroup ref="AdminChangeProductNameAsPerStoreViewScopeActionGroup" stepKey="changeProductNameHavingScopeStoreView">
118+
<argument name="productName" value="B2"/>
119+
</actionGroup>
120+
<!--Save product B-->
121+
<actionGroup ref="SaveProductFormActionGroup" stepKey="againSaveProductB"/>
122+
<!--Open simple product A again-->
123+
<actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="openSimpleProductAagain">
124+
<argument name="productId" value="$$createSimpleProductA.id$$"/>
125+
</actionGroup>
126+
<!--Switch scope to store view 1-->
127+
<actionGroup ref="SwitchToTheNewStoreViewActionGroup" stepKey="switchScopeToStoreView1">
128+
<argument name="storeViewName" value="{{NewWebSiteData.name}}"/>
129+
</actionGroup>
130+
<!--Expand "Related Products" tab-->
131+
<conditionalClick selector="{{AdminProductFormSection.productFormTab('Related Products')}}" dependentSelector="{{AdminProductFormSection.productFormTabState('Related Products', 'closed')}}" visible="true" stepKey="openRelatedProductTab"/>
132+
<!--Assert product name and status as per store view 1-->
133+
<waitForText selector="{{AdminProductFormRelatedUpSellCrossSellSection.selectedRelatedProduct}}" userInput="$$createSimpleProductB.name$$" stepKey="assertView1ProductName"/>
134+
<waitForText selector="{{AdminProductFormRelatedUpSellCrossSellSection.relatedProductStatus}}" userInput="Enabled" stepKey="assertView1ProductStatus"/>
135+
<!--Switch scope to store view 2-->
136+
<actionGroup ref="SwitchToTheNewStoreViewActionGroup" stepKey="switchScopeToStoreView2">
137+
<argument name="storeViewName" value="{{secondCustomWebsite.name}}"/>
138+
</actionGroup>
139+
<!--Expand "Related Products" tab-->
140+
<conditionalClick selector="{{AdminProductFormSection.productFormTab('Related Products')}}" dependentSelector="{{AdminProductFormSection.productFormTabState('Related Products', 'closed')}}" visible="true" stepKey="expandRelatedProductTab"/>
141+
<!--Assert product name and status as per store view 2-->
142+
<waitForText selector="{{AdminProductFormRelatedUpSellCrossSellSection.selectedRelatedProduct}}" userInput="B2" stepKey="assertView2ProductName"/>
143+
<waitForText selector="{{AdminProductFormRelatedUpSellCrossSellSection.relatedProductStatus}}" userInput="Disabled" stepKey="assertView2ProductStatus"/>
144+
</test>
145+
</tests>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AdminOpenPasswordOptionsSectionActionGroup">
12+
<annotations>
13+
<description>Goes to the Customer Configuration page and open password options section.</description>
14+
</annotations>
15+
<conditionalClick selector="{{AdminCustomerConfigSection.passwordOptions}}" dependentSelector="{{AdminCustomerConfigSection.passwordOptions}}" visible="true" stepKey="expandTab"/>
16+
</actionGroup>
17+
</actionGroups>

app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerConfigSection.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,10 @@
1717
<element name="showTelephoneInherit" type="checkbox" selector="#customer_address_telephone_show_inherit"/>
1818
<element name="showCompany" type="select" selector="#customer_address_company_show"/>
1919
<element name="showCompanyInherit" type="select" selector="#customer_address_company_show_inherit"/>
20+
<element name="passwordOptions" type="select" selector="#customer_password-head"/>
21+
<element name="passwordResetProtectionType" type="select" selector="#customer_password_password_reset_protection_type"/>
22+
<element name="passwordResetProtectionTypeOptions" type="select" selector="#customer_password_password_reset_protection_type option:nth-child({{option}})" parameterized="true"/>
23+
<element name="maxReqsOfPasswordReset" type="select" selector="#customer_password_max_number_password_reset_requests"/>
24+
<element name="minTimeBtwnPasswordResetRequest" type="select" selector="#customer_password_min_time_between_password_reset_requests"/>
2025
</section>
2126
</sections>
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
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="AdminAssertPasswordResetSettingsTest">
12+
<annotations>
13+
<features value="Customer"/>
14+
<stories value="Password rest settings"/>
15+
<title value="Admin assert password reset setting"/>
16+
<description value="Admin assert password reset settings section in customer configuration page."/>
17+
<severity value="MAJOR"/>
18+
<testCaseId value="AC-4449"/>
19+
</annotations>
20+
<before>
21+
<!-- Login to admin -->
22+
<actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/>
23+
</before>
24+
<after>
25+
<!-- Logout from admin -->
26+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
27+
</after>
28+
<!--Navigate to Customer Configuration Page-->
29+
<actionGroup ref="AdminNavigateToCustomerConfigurationActionGroup" stepKey="gotoCustomerConfiguration"/>
30+
<!--Expand to Password Options Page-->
31+
<actionGroup ref="AdminOpenPasswordOptionsSectionActionGroup" stepKey="gotoPasswordOptions"/>
32+
<!--See values for password reset protection type-->
33+
<seeOptionIsSelected selector="{{AdminCustomerConfigSection.passwordResetProtectionType}}" userInput="By IP and Email" stepKey="seeOneColumnSelected"/>
34+
<waitForElement selector="{{AdminCustomerConfigSection.passwordResetProtectionTypeOptions('2')}}" stepKey="waitToGrabTextFromOption2"/>
35+
<grabTextFrom selector="{{AdminCustomerConfigSection.passwordResetProtectionTypeOptions('2')}}" stepKey="grabTextFromOption2"/>
36+
<assertEquals stepKey="assertByIPIsPresent">
37+
<expectedResult type="string">By IP</expectedResult>
38+
<actualResult type="string">{$grabTextFromOption2}</actualResult>
39+
</assertEquals>
40+
<waitForElement selector="{{AdminCustomerConfigSection.passwordResetProtectionTypeOptions('3')}}" stepKey="waitToGrabTextFromOption3"/>
41+
<grabTextFrom selector="{{AdminCustomerConfigSection.passwordResetProtectionTypeOptions('3')}}" stepKey="grabTextFromOption3"/>
42+
<assertEquals stepKey="assertByEmailIsPresent">
43+
<expectedResult type="string">By Email</expectedResult>
44+
<actualResult type="string">{$grabTextFromOption3}</actualResult>
45+
</assertEquals>
46+
<waitForElement selector="{{AdminCustomerConfigSection.passwordResetProtectionTypeOptions('4')}}" stepKey="waitToGrabTextFromOption4"/>
47+
<grabTextFrom selector="{{AdminCustomerConfigSection.passwordResetProtectionTypeOptions('4')}}" stepKey="grabTextFromOption4"/>
48+
<assertEquals stepKey="assertNoneIsPresent">
49+
<expectedResult type="string">None</expectedResult>
50+
<actualResult type="string">{$grabTextFromOption4}</actualResult>
51+
</assertEquals>
52+
<!--See Max Number of Password Reset Requests field is present and has numeric value-->
53+
<seeInField selector="{{AdminCustomerConfigSection.maxReqsOfPasswordReset}}" userInput="5" stepKey="seeValueForPasswordResetRequests"/>
54+
<!--See Min Time Between Password Reset Requests field is present and has numeric value-->
55+
<seeInField selector="{{AdminCustomerConfigSection.minTimeBtwnPasswordResetRequest}}" userInput="10" stepKey="seeValueForMinTimeBtwnPasswordResetRequest"/>
56+
</test>
57+
</tests>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="StorefrontUpdateMultishippingItemsQuantityAndAddressesActionGroup">
12+
<annotations>
13+
<description>Update multishipping item's quantity and addresses on Ship to Multiple Addresses page.</description>
14+
</annotations>
15+
<waitForElementClickable selector="{{MultishippingSection.updateQtyAndAddress}}" stepKey="waitForUpdateQtyAndAddressButton"/>
16+
<click selector="{{MultishippingSection.updateQtyAndAddress}}" stepKey="clickOnUpdateQtyAndAddressButton"/>
17+
</actionGroup>
18+
</actionGroups>

app/code/Magento/Multishipping/Test/Mftf/Data/MultishippingConfigData.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@
1212
<data key="path">multishipping/options/checkout_multiple_maximum_qty</data>
1313
<data key="value">2</data>
1414
</entity>
15+
<entity name="MaximumQtyAllowed10ForShippingToMultipleAddressesConfigData">
16+
<data key="path">multishipping/options/checkout_multiple_maximum_qty</data>
17+
<data key="value">10</data>
18+
</entity>
1519
<!-- Magento Default Value -->
1620
<entity name="MaximumQtyAllowed100ForShippingToMultipleAddressesConfigData">
1721
<data key="path">multishipping/options/checkout_multiple_maximum_qty</data>

app/code/Magento/Multishipping/Test/Mftf/Section/MultishippingSection/MultishippingSection.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,8 @@
2121
<element name="addressSection" type="text" selector="//div[@class='block-title']/strong[text()='Address {{var}} ']" parameterized="true"/>
2222
<element name="flatRateCharge" type="text" selector="//span[@class='price' and text()='${{price}}']/../../label[contains(text(),'Fixed')]" parameterized="true"/>
2323
<element name="enterNewAddress" type="button" selector=".action.add"/>
24+
<element name="updateQtyAndAddress" type="button" selector="//button[@type='submit' and @class='action update']"/>
25+
<element name="attentionMessage" type="text" selector="//div[@class='modal-inner-wrap']//div[contains(text(),'Maximum qty allowed for Shipping to multiple addresses is 10')]"/>
26+
<element name="acceptAttention" type="button" selector="//button[@class='action-primary action-accept']//span[contains(text(),'OK')]"/>
2427
</section>
2528
</sections>

0 commit comments

Comments
 (0)