Skip to content

Commit cc2c5b9

Browse files
authored
Merge branch '2.4-develop' into cache-config-builder
2 parents f2468b5 + 679cd33 commit cc2c5b9

File tree

303 files changed

+12558
-1683
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

303 files changed

+12558
-1683
lines changed

app/code/Magento/Backend/Test/Mftf/Section/AdminMenuSection.xml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@
1717
<element name="widgets" type="button" selector="#nav li[data-ui-id='menu-magento-widget-cms-widget-instance']"/>
1818
<element name="stores" type="button" selector="#menu-magento-backend-stores"/>
1919
<element name="configuration" type="button" selector="#nav li[data-ui-id='menu-magento-config-system-config']"/>
20-
<element name="dashboard" type="button" selector="//li[@id='menu-magento-backend-dashboard']"/>
21-
<element name="sales" type="button" selector="//li[@id='menu-magento-sales-sales']"/>
22-
<element name="marketing" type="button" selector="//li[@id='menu-magento-backend-marketing']"/>
23-
<element name="system" type="button" selector="//li[@id='menu-magento-backend-system']"/>
24-
<element name="findPartners" type="button" selector="//li[@id='menu-magento-marketplace-partners']"/>
20+
<element name="dashboard" type="button" selector="#menu-magento-backend-dashboard"/>
21+
<element name="sales" type="button" selector="#menu-magento-sales-sales"/>
22+
<element name="marketing" type="button" selector="#menu-magento-backend-marketing"/>
23+
<element name="system" type="button" selector="#menu-magento-backend-system"/>
24+
<element name="findPartners" type="button" selector="#menu-magento-marketplace-partners"/>
2525

2626
<!-- Navigate menu selectors -->
2727
<element name="menuItem" type="button" selector="li[data-ui-id='menu-{{dataUiId}}']" parameterized="true" timeout="30"/>
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="AssertStorefrontBundleValidationMessageActionGroup">
12+
<annotations>
13+
<description>Check error message in validation message box</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="message" type="string"/>
17+
</arguments>
18+
19+
<waitForPageLoad stepKey="waitForPageLoad"/>
20+
<see selector="{{StorefrontBundledSection.validationMessageBox}}" userInput="{{message}}" stepKey="seeErrorHoldMessage"/>
21+
</actionGroup>
22+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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="AssertStorefrontBundleValidationMessagesCountActionGroup">
12+
<annotations>
13+
<description>Check if there's a validation message box on page and asserts the validation messages number</description>
14+
</annotations>
15+
16+
<waitForPageLoad stepKey="waitForPageLoad"/>
17+
<seeElement selector="{{StorefrontBundledSection.validationMessageBox}}" stepKey="seeErrorBox"/>
18+
<seeNumberOfElements selector="{{StorefrontBundledSection.validationMessageBox}}" userInput="1" stepKey="seeOneErrorBox"/>
19+
</actionGroup>
20+
</actionGroups>
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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="StorefrontAddToTheCartButtonActionGroup">
12+
<annotations>
13+
<description>Clicks 'Add to Cart' on a Storefront Bundled Product page.</description>
14+
</annotations>
15+
16+
<waitForPageLoad stepKey="waitForPageLoad"/>
17+
<waitForElementVisible selector="{{StorefrontBundleProductActionSection.addToCartButton}}" stepKey="waitForAddToCartButton"/>
18+
<click selector="{{StorefrontBundleProductActionSection.addToCartButton}}" stepKey="clickOnAddToCartButton"/>
19+
</actionGroup>
20+
</actionGroups>

app/code/Magento/Bundle/Test/Mftf/Section/BundleStorefrontSection.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
<element name="bundleOptionSelection" type="checkbox" selector="//div[@class='nested options-list']/div[{{optionNumber}}]/label[@class='label']" parameterized="true"/>
1515
<!--Description-->
1616
<!--CE exclusively-->
17-
<element name="longDescriptionText" type="text" selector="//*[@id='description']/div/div" timeout="30"/>
18-
<element name="shortDescriptionText" type="text" selector="//div[@class='product attribute overview']" timeout="30"/>
17+
<element name="longDescriptionText" type="text" selector="#description>div>div" timeout="30"/>
18+
<element name="shortDescriptionText" type="text" selector="div.product.attribute.overview" timeout="30"/>
1919
<!--NameOfProductOnProductPage-->
2020
<element name="bundleProductName" type="text" selector="//*[@id='maincontent']//span[@itemprop='name']"/>
2121
<!--PageNotFoundErrorMessage-->

app/code/Magento/Bundle/Test/Mftf/Section/StorefrontBundledSection.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<element name="updateCart" type="button" selector="#product-updatecart-button" timeout="30"/>
1818
<element name="configuredPrice" type="block" selector=".price-configured_price .price"/>
1919
<element name="fixedPricing" type="text" selector="//div[@class='price-box price-final_price']//span[@id]//..//span[contains(text(),'{{var1}}')]" parameterized="true"/>
20-
<element name="customizeProduct" type="button" selector="//*[@id='bundle-slide']"/>
20+
<element name="customizeProduct" type="button" selector="#bundle-slide"/>
2121
<element name="customizableBundleItemOption" type="text" selector="//div[@class='field choice'][1]//input[@type='checkbox']"/>
2222
<element name="customizableBundleItemOption2" type="text" selector="//div[@class='field choice'][2]//input[@type='checkbox']"/>
2323
<element name="nthOptionDiv" type="block" selector="#product-options-wrapper div.field.option:nth-of-type({{var}})" parameterized="true"/>
@@ -38,5 +38,6 @@
3838
<element name="currencyTrigger" type="select" selector="#switcher-currency-trigger" timeout="30"/>
3939
<element name="currency" type="select" selector="//a[text()='{{arg}}']" parameterized="true"/>
4040
<element name="multiSelectOption" type="select" selector="//div[@class='field option required']//select"/>
41+
<element name="validationMessageBox" type="block" selector="#validation-message-box"/>
4142
</section>
4243
</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="StorefrontBundleCheckBoxOptionValidationTest">
12+
<annotations>
13+
<features value="Bundle"/>
14+
<stories value="Bundle product validation before add to cart"/>
15+
<title value="Customer should be able to see only one validation message for checkbox option group"/>
16+
<description value="Customer should be able to see only one validation message for checkbox option group"/>
17+
<testCaseId value="MC-35133"/>
18+
<severity value="MINOR"/>
19+
<group value="Bundle"/>
20+
</annotations>
21+
<before>
22+
<createData entity="ApiProductWithDescription" stepKey="simpleProduct1" before="bundleProduct"/>
23+
<createData entity="ApiProductWithDescription" stepKey="simpleProduct2" after="simpleProduct1"/>
24+
<createData entity="ApiBundleProduct" stepKey="bundleProduct"/>
25+
<createData entity="CheckboxOption" stepKey="checkboxBundleOption">
26+
<requiredEntity createDataKey="bundleProduct"/>
27+
</createData>
28+
<createData entity="ApiBundleLink" stepKey="createBundleLink1">
29+
<requiredEntity createDataKey="bundleProduct"/>
30+
<requiredEntity createDataKey="checkboxBundleOption"/>
31+
<requiredEntity createDataKey="simpleProduct1"/>
32+
<field key="qty">2</field>
33+
</createData>
34+
<createData entity="ApiBundleLink" stepKey="createBundleLink2">
35+
<requiredEntity createDataKey="bundleProduct"/>
36+
<requiredEntity createDataKey="checkboxBundleOption"/>
37+
<requiredEntity createDataKey="simpleProduct2"/>
38+
<field key="qty">4</field>
39+
</createData>
40+
<magentoCron stepKey="runCronIndex" groups="index"/>
41+
</before>
42+
<after>
43+
<deleteData createDataKey="bundleProduct" stepKey="deleteBundleProduct"/>
44+
<deleteData createDataKey="simpleProduct1" stepKey="deleteSimpleProduct1"/>
45+
<deleteData createDataKey="simpleProduct2" stepKey="deleteSimpleProduct2"/>
46+
</after>
47+
<actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openProductStorefront">
48+
<argument name="productUrl" value="$$bundleProduct.custom_attributes[url_key]$$"/>
49+
</actionGroup>
50+
<actionGroup ref="StorefrontSelectCustomizeAndAddToTheCartButtonActionGroup" stepKey="customizeBundleProduct"/>
51+
<actionGroup ref="StorefrontAddToTheCartButtonActionGroup" stepKey="addToCartBundleProduct"/>
52+
<actionGroup ref="AssertStorefrontBundleValidationMessagesCountActionGroup" stepKey="assertBundleValidationCount"/>
53+
<actionGroup ref="AssertStorefrontBundleValidationMessageActionGroup" stepKey="assertBundleValidationMessage">
54+
<argument name="message" value="Please select one of the options."/>
55+
</actionGroup>
56+
</test>
57+
</tests>

app/code/Magento/Bundle/view/frontend/templates/catalog/product/view/type/bundle/option/checkbox.phtml

Lines changed: 29 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,40 +8,55 @@
88
<?php /* @var $block \Magento\Bundle\Block\Catalog\Product\View\Type\Bundle\Option\Checkbox */ ?>
99
<?php $_option = $block->getOption() ?>
1010
<?php $_selections = $_option->getSelections() ?>
11+
<?php $inputClass = 'checkbox product bundle option bundle-option-' . $block->escapeHtmlAttr($_option->getId()) ?>
12+
<?php $inputId = 'bundle-option-' . $block->escapeHtmlAttr($_option->getId()) ?>
13+
<?php $inputName = 'bundle_option[' . $block->escapeHtmlAttr($_option->getId()) . ']' ?>
14+
<?php $dataValidation = 'data-validate="{\'validate-one-required-by-name\':\'input[name^=&quot;bundle_option[' .
15+
$block->escapeHtmlAttr($_option->getId()) . ']&quot;]:checked\'}"' ?>
16+
1117
<div class="field option <?= ($_option->getRequired()) ? ' required': '' ?>">
1218
<label class="label">
1319
<span><?= $block->escapeHtml($_option->getTitle()) ?></span>
1420
</label>
1521
<div class="control">
1622
<div class="nested options-list">
17-
<?php if ($block->showSingle()) : ?>
23+
<?php if ($block->showSingle()): ?>
1824
<?= /* @noEscape */ $block->getSelectionQtyTitlePrice($_selections[0]) ?>
1925
<?= /* @noEscape */ $block->getTierPriceRenderer()->renderTierPrice($_selections[0]) ?>
2026
<input type="hidden"
2127
class="bundle-option-<?= $block->escapeHtmlAttr($_option->getId()) ?> product bundle option"
2228
name="bundle_option[<?= $block->escapeHtml($_option->getId()) ?>]"
2329
value="<?= $block->escapeHtmlAttr($_selections[0]->getSelectionId()) ?>"/>
24-
<?php else :?>
25-
<?php foreach ($_selections as $_selection) : ?>
30+
<?php else: ?>
31+
<?php foreach ($_selections as $selection): ?>
32+
<?php $sectionId = $selection->getSelectionId() ?>
2633
<div class="field choice">
27-
<input class="bundle-option-<?= $block->escapeHtmlAttr($_option->getId()) ?> checkbox product bundle option change-container-classname"
28-
id="bundle-option-<?= $block->escapeHtmlAttr($_option->getId()) ?>-<?= $block->escapeHtmlAttr($_selection->getSelectionId()) ?>"
34+
<input class="<?=/* @noEscape */ $inputClass ?> change-container-classname"
35+
id="<?=/* @noEscape */ $inputId . '-' . $block->escapeHtmlAttr($sectionId)?>"
2936
type="checkbox"
30-
<?php if ($_option->getRequired()) { echo 'data-validate="{\'validate-one-required-by-name\':\'input[name^=&quot;bundle_option[' . $block->escapeHtmlAttr($_option->getId()) . ']&quot;]:checked\'}"'; } ?>
31-
name="bundle_option[<?= $block->escapeHtmlAttr($_option->getId()) ?>][<?= $block->escapeHtmlAttr($_selection->getId()) ?>]"
32-
data-selector="bundle_option[<?= $block->escapeHtmlAttr($_option->getId()) ?>][<?= $block->escapeHtmlAttr($_selection->getId()) ?>]"
33-
<?php if ($block->isSelected($_selection)) { echo ' checked="checked"'; } ?>
34-
<?php if (!$_selection->isSaleable()) { echo ' disabled="disabled"'; } ?>
35-
value="<?= $block->escapeHtmlAttr($_selection->getSelectionId()) ?>"/>
37+
<?php if ($_option->getRequired()): ?>
38+
<?= /* @noEscape */ $dataValidation ?>
39+
<?php endif;?>
40+
name="<?=/* @noEscape */ $inputName .'['. $block->escapeHtmlAttr($sectionId)?>]"
41+
data-selector="<?= /* @noEscape */ $inputName.'['.$block->escapeHtmlAttr($sectionId)?>]"
42+
<?php if ($block->isSelected($selection)): ?>
43+
<?= ' checked="checked"' ?>
44+
<?php endif; ?>
45+
<?php if (!$selection->isSaleable()): ?>
46+
<?= ' disabled="disabled"' ?>
47+
<?php endif; ?>
48+
value="<?= $block->escapeHtmlAttr($sectionId) ?>"
49+
data-errors-message-box="#validation-message-box"/>
3650
<label class="label"
37-
for="bundle-option-<?= $block->escapeHtmlAttr($_option->getId()) ?>-<?= $block->escapeHtmlAttr($_selection->getSelectionId()) ?>">
38-
<span><?= /* @noEscape */ $block->getSelectionQtyTitlePrice($_selection) ?></span>
51+
for="<?= /* @noEscape */ $inputId . '-' . $block->escapeHtmlAttr($sectionId) ?>">
52+
<span><?= /* @noEscape */ $block->getSelectionQtyTitlePrice($selection) ?></span>
3953
<br/>
40-
<?= /* @noEscape */ $block->getTierPriceRenderer()->renderTierPrice($_selection) ?>
54+
<?= /* @noEscape */ $block->getTierPriceRenderer()->renderTierPrice($selection) ?>
4155
</label>
4256
</div>
4357
<?php endforeach; ?>
4458
<div id="bundle-option-<?= $block->escapeHtmlAttr($_option->getId()) ?>-container"></div>
59+
<div id="validation-message-box"></div>
4560
<?php endif; ?>
4661
</div>
4762
</div>

app/code/Magento/Captcha/Test/Mftf/Section/CaptchaFormsDisplayingSection.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<element name="customer" type="button" selector="//div[@class='admin__page-nav-title title _collapsible']//strong[text()='Customers']"/>
1515
<element name="customerConfig" type="text" selector="//span[text()='Customer Configuration']"/>
1616
<element name="captcha" type="button" selector="#customer_captcha-head"/>
17-
<element name="dependent" type="button" selector="//a[@id='customer_captcha-head' and @class='open']"/>
17+
<element name="dependent" type="button" selector="a#customer_captcha-head.open"/>
1818
<element name="forms" type="multiselect" selector="#customer_captcha_forms"/>
1919
<element name="createUser" type="multiselect" selector="//select[@id='customer_captcha_forms']/option[@value='user_create']"/>
2020
<element name="forgotpassword" type="multiselect" selector="//select[@id='customer_captcha_forms']/option[@value='user_forgotpassword']"/>

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,21 @@
88
namespace Magento\Catalog\Model;
99

1010
/**
11-
* Filter custom attributes for product using the blacklist
11+
* Filter custom attributes for product using the excluded list
1212
*/
1313
class FilterProductCustomAttribute
1414
{
1515
/**
1616
* @var array
1717
*/
18-
private $blackList;
18+
private $excludedList;
1919

2020
/**
21-
* @param array $blackList
21+
* @param array $excludedList
2222
*/
23-
public function __construct(array $blackList = [])
23+
public function __construct(array $excludedList = [])
2424
{
25-
$this->blackList = $blackList;
25+
$this->excludedList = $excludedList;
2626
}
2727

2828
/**
@@ -33,6 +33,6 @@ public function __construct(array $blackList = [])
3333
*/
3434
public function execute(array $attributes): array
3535
{
36-
return array_diff_key($attributes, array_flip($this->blackList));
36+
return array_diff_key($attributes, array_flip($this->excludedList));
3737
}
3838
}

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

Lines changed: 0 additions & 57 deletions
This file was deleted.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ private function processCategoryLinks($newCategoryPositions, &$oldCategoryPositi
147147
* @param bool $insert
148148
* @return array
149149
*/
150-
private function updateCategoryLinks(ProductInterface $product, array $insertLinks, $insert = false)
150+
public function updateCategoryLinks(ProductInterface $product, array $insertLinks, $insert = false)
151151
{
152152
if (empty($insertLinks)) {
153153
return [];
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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="AdminChangeCategoryNameActionGroup">
12+
<annotations>
13+
<description>Switch the Storefront to the provided Store.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="categoryName" type="string" defaultValue="{{_defaultCategory.name}}"/>
17+
</arguments>
18+
<fillField selector="{{AdminCategoryBasicFieldSection.CategoryNameInput}}" userInput="{{categoryName}}" stepKey="updateCategoryName"/>
19+
</actionGroup>
20+
</actionGroups>

0 commit comments

Comments
 (0)