Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/2.4-develop' into storefront-2.4
Browse files Browse the repository at this point in the history
  • Loading branch information
mslabko committed Jun 17, 2020
2 parents f6ab582 + 5fca50e commit d946618
Show file tree
Hide file tree
Showing 113 changed files with 4,395 additions and 1,170 deletions.
10 changes: 5 additions & 5 deletions app/code/Magento/Backend/Test/Mftf/Section/AdminMenuSection.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
<element name="widgets" type="button" selector="#nav li[data-ui-id='menu-magento-widget-cms-widget-instance']"/>
<element name="stores" type="button" selector="#menu-magento-backend-stores"/>
<element name="configuration" type="button" selector="#nav li[data-ui-id='menu-magento-config-system-config']"/>
<element name="dashboard" type="button" selector="//li[@id='menu-magento-backend-dashboard']"/>
<element name="sales" type="button" selector="//li[@id='menu-magento-sales-sales']"/>
<element name="marketing" type="button" selector="//li[@id='menu-magento-backend-marketing']"/>
<element name="system" type="button" selector="//li[@id='menu-magento-backend-system']"/>
<element name="findPartners" type="button" selector="//li[@id='menu-magento-marketplace-partners']"/>
<element name="dashboard" type="button" selector="#menu-magento-backend-dashboard"/>
<element name="sales" type="button" selector="#menu-magento-sales-sales"/>
<element name="marketing" type="button" selector="#menu-magento-backend-marketing"/>
<element name="system" type="button" selector="#menu-magento-backend-system"/>
<element name="findPartners" type="button" selector="#menu-magento-marketplace-partners"/>

<!-- Navigate menu selectors -->
<element name="menuItem" type="button" selector="li[data-ui-id='menu-{{dataUiId}}']" parameterized="true" timeout="30"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="AssertStorefrontBundleValidationMessageActionGroup">
<annotations>
<description>Check error message in validation message box</description>
</annotations>
<arguments>
<argument name="message" type="string"/>
</arguments>

<waitForPageLoad stepKey="waitForPageLoad"/>
<see selector="{{StorefrontBundledSection.validationMessageBox}}" userInput="{{message}}" stepKey="seeErrorHoldMessage"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="AssertStorefrontBundleValidationMessagesCountActionGroup">
<annotations>
<description>Check if there's a validation message box on page and asserts the validation messages number</description>
</annotations>

<waitForPageLoad stepKey="waitForPageLoad"/>
<seeElement selector="{{StorefrontBundledSection.validationMessageBox}}" stepKey="seeErrorBox"/>
<seeNumberOfElements selector="{{StorefrontBundledSection.validationMessageBox}}" userInput="1" stepKey="seeOneErrorBox"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="StorefrontAddToTheCartButtonActionGroup">
<annotations>
<description>Clicks 'Add to Cart' on a Storefront Bundled Product page.</description>
</annotations>

<waitForPageLoad stepKey="waitForPageLoad"/>
<waitForElementVisible selector="{{StorefrontBundleProductActionSection.addToCartButton}}" stepKey="waitForAddToCartButton"/>
<click selector="{{StorefrontBundleProductActionSection.addToCartButton}}" stepKey="clickOnAddToCartButton"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
<element name="bundleOptionSelection" type="checkbox" selector="//div[@class='nested options-list']/div[{{optionNumber}}]/label[@class='label']" parameterized="true"/>
<!--Description-->
<!--CE exclusively-->
<element name="longDescriptionText" type="text" selector="//*[@id='description']/div/div" timeout="30"/>
<element name="shortDescriptionText" type="text" selector="//div[@class='product attribute overview']" timeout="30"/>
<element name="longDescriptionText" type="text" selector="#description>div>div" timeout="30"/>
<element name="shortDescriptionText" type="text" selector="div.product.attribute.overview" timeout="30"/>
<!--NameOfProductOnProductPage-->
<element name="bundleProductName" type="text" selector="//*[@id='maincontent']//span[@itemprop='name']"/>
<!--PageNotFoundErrorMessage-->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<element name="updateCart" type="button" selector="#product-updatecart-button" timeout="30"/>
<element name="configuredPrice" type="block" selector=".price-configured_price .price"/>
<element name="fixedPricing" type="text" selector="//div[@class='price-box price-final_price']//span[@id]//..//span[contains(text(),'{{var1}}')]" parameterized="true"/>
<element name="customizeProduct" type="button" selector="//*[@id='bundle-slide']"/>
<element name="customizeProduct" type="button" selector="#bundle-slide"/>
<element name="customizableBundleItemOption" type="text" selector="//div[@class='field choice'][1]//input[@type='checkbox']"/>
<element name="customizableBundleItemOption2" type="text" selector="//div[@class='field choice'][2]//input[@type='checkbox']"/>
<element name="nthOptionDiv" type="block" selector="#product-options-wrapper div.field.option:nth-of-type({{var}})" parameterized="true"/>
Expand All @@ -38,5 +38,6 @@
<element name="currencyTrigger" type="select" selector="#switcher-currency-trigger" timeout="30"/>
<element name="currency" type="select" selector="//a[text()='{{arg}}']" parameterized="true"/>
<element name="multiSelectOption" type="select" selector="//div[@class='field option required']//select"/>
<element name="validationMessageBox" type="block" selector="#validation-message-box"/>
</section>
</sections>
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<?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="StorefrontBundleCheckBoxOptionValidationTest">
<annotations>
<features value="Bundle"/>
<stories value="Bundle product validation before add to cart"/>
<title value="Customer should be able to see only one validation message for checkbox option group"/>
<description value="Customer should be able to see only one validation message for checkbox option group"/>
<testCaseId value="MC-35133"/>
<severity value="MINOR"/>
<group value="Bundle"/>
</annotations>
<before>
<createData entity="ApiProductWithDescription" stepKey="simpleProduct1" before="bundleProduct"/>
<createData entity="ApiProductWithDescription" stepKey="simpleProduct2" after="simpleProduct1"/>
<createData entity="ApiBundleProduct" stepKey="bundleProduct"/>
<createData entity="CheckboxOption" stepKey="checkboxBundleOption">
<requiredEntity createDataKey="bundleProduct"/>
</createData>
<createData entity="ApiBundleLink" stepKey="createBundleLink1">
<requiredEntity createDataKey="bundleProduct"/>
<requiredEntity createDataKey="checkboxBundleOption"/>
<requiredEntity createDataKey="simpleProduct1"/>
<field key="qty">2</field>
</createData>
<createData entity="ApiBundleLink" stepKey="createBundleLink2">
<requiredEntity createDataKey="bundleProduct"/>
<requiredEntity createDataKey="checkboxBundleOption"/>
<requiredEntity createDataKey="simpleProduct2"/>
<field key="qty">4</field>
</createData>
<magentoCron stepKey="runCronIndex" groups="index"/>
</before>
<after>
<deleteData createDataKey="bundleProduct" stepKey="deleteBundleProduct"/>
<deleteData createDataKey="simpleProduct1" stepKey="deleteSimpleProduct1"/>
<deleteData createDataKey="simpleProduct2" stepKey="deleteSimpleProduct2"/>
</after>
<actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openProductStorefront">
<argument name="productUrl" value="$$bundleProduct.custom_attributes[url_key]$$"/>
</actionGroup>
<actionGroup ref="StorefrontSelectCustomizeAndAddToTheCartButtonActionGroup" stepKey="customizeBundleProduct"/>
<actionGroup ref="StorefrontAddToTheCartButtonActionGroup" stepKey="addToCartBundleProduct"/>
<actionGroup ref="AssertStorefrontBundleValidationMessagesCountActionGroup" stepKey="assertBundleValidationCount"/>
<actionGroup ref="AssertStorefrontBundleValidationMessageActionGroup" stepKey="assertBundleValidationMessage">
<argument name="message" value="Please select one of the options."/>
</actionGroup>
</test>
</tests>
Original file line number Diff line number Diff line change
Expand Up @@ -8,40 +8,55 @@
<?php /* @var $block \Magento\Bundle\Block\Catalog\Product\View\Type\Bundle\Option\Checkbox */ ?>
<?php $_option = $block->getOption() ?>
<?php $_selections = $_option->getSelections() ?>
<?php $inputClass = 'checkbox product bundle option bundle-option-' . $block->escapeHtmlAttr($_option->getId()) ?>
<?php $inputId = 'bundle-option-' . $block->escapeHtmlAttr($_option->getId()) ?>
<?php $inputName = 'bundle_option[' . $block->escapeHtmlAttr($_option->getId()) . ']' ?>
<?php $dataValidation = 'data-validate="{\'validate-one-required-by-name\':\'input[name^=&quot;bundle_option[' .
$block->escapeHtmlAttr($_option->getId()) . ']&quot;]:checked\'}"' ?>

<div class="field option <?= ($_option->getRequired()) ? ' required': '' ?>">
<label class="label">
<span><?= $block->escapeHtml($_option->getTitle()) ?></span>
</label>
<div class="control">
<div class="nested options-list">
<?php if ($block->showSingle()) : ?>
<?php if ($block->showSingle()): ?>
<?= /* @noEscape */ $block->getSelectionQtyTitlePrice($_selections[0]) ?>
<?= /* @noEscape */ $block->getTierPriceRenderer()->renderTierPrice($_selections[0]) ?>
<input type="hidden"
class="bundle-option-<?= $block->escapeHtmlAttr($_option->getId()) ?> product bundle option"
name="bundle_option[<?= $block->escapeHtml($_option->getId()) ?>]"
value="<?= $block->escapeHtmlAttr($_selections[0]->getSelectionId()) ?>"/>
<?php else :?>
<?php foreach ($_selections as $_selection) : ?>
<?php else: ?>
<?php foreach ($_selections as $selection): ?>
<?php $sectionId = $selection->getSelectionId() ?>
<div class="field choice">
<input class="bundle-option-<?= $block->escapeHtmlAttr($_option->getId()) ?> checkbox product bundle option change-container-classname"
id="bundle-option-<?= $block->escapeHtmlAttr($_option->getId()) ?>-<?= $block->escapeHtmlAttr($_selection->getSelectionId()) ?>"
<input class="<?=/* @noEscape */ $inputClass ?> change-container-classname"
id="<?=/* @noEscape */ $inputId . '-' . $block->escapeHtmlAttr($sectionId)?>"
type="checkbox"
<?php if ($_option->getRequired()) { echo 'data-validate="{\'validate-one-required-by-name\':\'input[name^=&quot;bundle_option[' . $block->escapeHtmlAttr($_option->getId()) . ']&quot;]:checked\'}"'; } ?>
name="bundle_option[<?= $block->escapeHtmlAttr($_option->getId()) ?>][<?= $block->escapeHtmlAttr($_selection->getId()) ?>]"
data-selector="bundle_option[<?= $block->escapeHtmlAttr($_option->getId()) ?>][<?= $block->escapeHtmlAttr($_selection->getId()) ?>]"
<?php if ($block->isSelected($_selection)) { echo ' checked="checked"'; } ?>
<?php if (!$_selection->isSaleable()) { echo ' disabled="disabled"'; } ?>
value="<?= $block->escapeHtmlAttr($_selection->getSelectionId()) ?>"/>
<?php if ($_option->getRequired()): ?>
<?= /* @noEscape */ $dataValidation ?>
<?php endif;?>
name="<?=/* @noEscape */ $inputName .'['. $block->escapeHtmlAttr($sectionId)?>]"
data-selector="<?= /* @noEscape */ $inputName.'['.$block->escapeHtmlAttr($sectionId)?>]"
<?php if ($block->isSelected($selection)): ?>
<?= ' checked="checked"' ?>
<?php endif; ?>
<?php if (!$selection->isSaleable()): ?>
<?= ' disabled="disabled"' ?>
<?php endif; ?>
value="<?= $block->escapeHtmlAttr($sectionId) ?>"
data-errors-message-box="#validation-message-box"/>
<label class="label"
for="bundle-option-<?= $block->escapeHtmlAttr($_option->getId()) ?>-<?= $block->escapeHtmlAttr($_selection->getSelectionId()) ?>">
<span><?= /* @noEscape */ $block->getSelectionQtyTitlePrice($_selection) ?></span>
for="<?= /* @noEscape */ $inputId . '-' . $block->escapeHtmlAttr($sectionId) ?>">
<span><?= /* @noEscape */ $block->getSelectionQtyTitlePrice($selection) ?></span>
<br/>
<?= /* @noEscape */ $block->getTierPriceRenderer()->renderTierPrice($_selection) ?>
<?= /* @noEscape */ $block->getTierPriceRenderer()->renderTierPrice($selection) ?>
</label>
</div>
<?php endforeach; ?>
<div id="bundle-option-<?= $block->escapeHtmlAttr($_option->getId()) ?>-container"></div>
<div id="validation-message-box"></div>
<?php endif; ?>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<element name="customer" type="button" selector="//div[@class='admin__page-nav-title title _collapsible']//strong[text()='Customers']"/>
<element name="customerConfig" type="text" selector="//span[text()='Customer Configuration']"/>
<element name="captcha" type="button" selector="#customer_captcha-head"/>
<element name="dependent" type="button" selector="//a[@id='customer_captcha-head' and @class='open']"/>
<element name="dependent" type="button" selector="a#customer_captcha-head.open"/>
<element name="forms" type="multiselect" selector="#customer_captcha_forms"/>
<element name="createUser" type="multiselect" selector="//select[@id='customer_captcha_forms']/option[@value='user_create']"/>
<element name="forgotpassword" type="multiselect" selector="//select[@id='customer_captcha_forms']/option[@value='user_forgotpassword']"/>
Expand Down
57 changes: 0 additions & 57 deletions app/code/Magento/Catalog/Model/Product/SalabilityChecker.php

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ private function processCategoryLinks($newCategoryPositions, &$oldCategoryPositi
* @param bool $insert
* @return array
*/
private function updateCategoryLinks(ProductInterface $product, array $insertLinks, $insert = false)
public function updateCategoryLinks(ProductInterface $product, array $insertLinks, $insert = false)
{
if (empty($insertLinks)) {
return [];
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="AdminChangeCategoryNameActionGroup">
<annotations>
<description>Switch the Storefront to the provided Store.</description>
</annotations>
<arguments>
<argument name="categoryName" type="string" defaultValue="{{_defaultCategory.name}}"/>
</arguments>
<fillField selector="{{AdminCategoryBasicFieldSection.CategoryNameInput}}" userInput="{{categoryName}}" stepKey="updateCategoryName"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="AdminChangeCategoryNameOnStoreViewLevelActionGroup">
<annotations>
<description>Updates the Category Name for proper Store View.</description>
</annotations>
<arguments>
<argument name="categoryName" type="string"/>
</arguments>

<uncheckOption selector="{{AdminCategoryBasicFieldSection.categoryNameUseDefault}}" stepKey="uncheckUseDefaultValueENStoreView"/>
<fillField selector="{{AdminCategoryBasicFieldSection.CategoryNameInput}}" userInput="{{categoryName}}" stepKey="changeNameField"/>
<click selector="{{AdminCategorySEOSection.SectionHeader}}" stepKey="clickOnSectionHeader"/>
</actionGroup>
</actionGroups>
Loading

0 comments on commit d946618

Please sign in to comment.