Skip to content
This repository has been archived by the owner on May 20, 2019. It is now read-only.

Commit

Permalink
Merge pull request #6 from magento/2.3-develop
Browse files Browse the repository at this point in the history
2.3 develop
  • Loading branch information
ronak2ram authored Jul 17, 2018
2 parents 0c2fa6f + 3df1425 commit 46081df
Show file tree
Hide file tree
Showing 219 changed files with 3,169 additions and 374 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ class AdvancedPricing extends \Magento\CatalogImportExport\Model\Export\Product
* @param \Magento\CatalogImportExport\Model\Export\RowCustomizerInterface $rowCustomizer
* @param ImportProduct\StoreResolver $storeResolver
* @param \Magento\Customer\Api\GroupRepositoryInterface $groupRepository
* @throws \Magento\Framework\Exception\LocalizedException
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
*/
public function __construct(
Expand Down Expand Up @@ -193,6 +192,7 @@ protected function initTypeModels()
* Export process
*
* @return string
* @throws \Magento\Framework\Exception\LocalizedException
*/
public function export()
{
Expand Down Expand Up @@ -586,8 +586,8 @@ protected function getTierPrices(array $listSku, $table)
* Get Website code.
*
* @param int $websiteId
*
* @return string
* @throws \Magento\Framework\Exception\LocalizedException
*/
protected function _getWebsiteCode(int $websiteId): string
{
Expand Down Expand Up @@ -617,8 +617,9 @@ protected function _getWebsiteCode(int $websiteId): string
*
* @param int $groupId
* @param int $allGroups
*
* @return string
* @throws \Magento\Framework\Exception\LocalizedException
* @throws \Magento\Framework\Exception\NoSuchEntityException
*/
protected function _getCustomerGroupById(
int $groupId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
use Magento\CatalogImportExport\Model\Import\Product as ImportProduct;
use Magento\CatalogImportExport\Model\Import\Product\RowValidatorInterface as ValidatorInterface;
use Magento\ImportExport\Model\Import\ErrorProcessing\ProcessingErrorAggregatorInterface;
use Magento\Framework\App\ResourceConnection;

/**
* Class AdvancedPricing
Expand Down Expand Up @@ -618,6 +617,7 @@ protected function processCountNewPrices(array $tierPrices)
* Get product entity link field
*
* @return string
* @throws \Exception
*/
private function getProductEntityLinkField()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ public function __construct($validators = [])
*
* @param array $value
* @return bool
* @throws \Zend_Validate_Exception
*/
public function isValid($value)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,10 +151,13 @@ protected function setUp()
]
);
$this->exportConfig = $this->createMock(\Magento\ImportExport\Model\Export\Config::class);
$this->productFactory = $this->createPartialMock(\Magento\Catalog\Model\ResourceModel\ProductFactory::class, [
$this->productFactory = $this->createPartialMock(
\Magento\Catalog\Model\ResourceModel\ProductFactory::class,
[
'create',
'getTypeId',
]);
]
);
$this->attrSetColFactory = $this->createPartialMock(
\Magento\Eav\Model\ResourceModel\Entity\Attribute\Set\CollectionFactory::class,
[
Expand Down Expand Up @@ -185,11 +188,14 @@ protected function setUp()
\Magento\CatalogImportExport\Model\Import\Product\StoreResolver::class
);
$this->groupRepository = $this->createMock(\Magento\Customer\Api\GroupRepositoryInterface::class);
$this->writer = $this->createPartialMock(\Magento\ImportExport\Model\Export\Adapter\AbstractAdapter::class, [
'setHeaderCols',
'writeRow',
'getContents',
]);
$this->writer = $this->createPartialMock(
\Magento\ImportExport\Model\Export\Adapter\AbstractAdapter::class,
[
'setHeaderCols',
'writeRow',
'getContents',
]
);
$constructorMethods = [
'initTypeModels',
'initAttributes',
Expand Down Expand Up @@ -347,6 +353,7 @@ protected function tearDown()
* @param $object
* @param $property
* @return mixed
* @throws \ReflectionException
*/
protected function getPropertyValue($object, $property)
{
Expand All @@ -362,6 +369,8 @@ protected function getPropertyValue($object, $property)
* @param $object
* @param $property
* @param $value
* @return mixed
* @throws \ReflectionException
*/
protected function setPropertyValue(&$object, $property, $value)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,7 @@ public function isValidAddMessagesCallDataProvider()
* @param object $object
* @param string $property
* @return mixed
* @throws \ReflectionException
*/
protected function getPropertyValue($object, $property)
{
Expand All @@ -363,6 +364,7 @@ protected function getPropertyValue($object, $property)
* @param string $property
* @param mixed $value
* @return object
* @throws \ReflectionException
*/
protected function setPropertyValue(&$object, $property, $value)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,10 @@ public function testGetEntityTypeCode()
* Test method validateRow against its result.
*
* @dataProvider validateRowResultDataProvider
* @param array $rowData
* @param string|null $behavior
* @param bool $expectedResult
* @throws \ReflectionException
*/
public function testValidateRowResult($rowData, $behavior, $expectedResult)
{
Expand All @@ -234,6 +238,10 @@ public function testValidateRowResult($rowData, $behavior, $expectedResult)
* Test method validateRow whether AddRowError is called.
*
* @dataProvider validateRowAddRowErrorCallDataProvider
* @param array $rowData
* @param string|null $behavior
* @param string $error
* @throws \ReflectionException
*/
public function testValidateRowAddRowErrorCall($rowData, $behavior, $error)
{
Expand Down Expand Up @@ -324,6 +332,13 @@ public function testSaveAdvancedPricing()
* Take into consideration different data and check relative internal calls.
*
* @dataProvider saveAndReplaceAdvancedPricesAppendBehaviourDataProvider
* @param array $data
* @param string $tierCustomerGroupId
* @param string $groupCustomerGroupId
* @param string $tierWebsiteId
* @param string $groupWebsiteId
* @param array $expectedTierPrices
* @throws \ReflectionException
*/
public function testSaveAndReplaceAdvancedPricesAppendBehaviourDataAndCalls(
$data,
Expand Down Expand Up @@ -956,6 +971,7 @@ public function processCountExistingPricesDataProvider()
* @param $object
* @param $property
* @return mixed
* @throws \ReflectionException
*/
protected function getPropertyValue($object, $property)
{
Expand All @@ -972,6 +988,8 @@ protected function getPropertyValue($object, $property)
* @param $object
* @param $property
* @param $value
* @return mixed
* @throws \ReflectionException
*/
protected function setPropertyValue(&$object, $property, $value)
{
Expand All @@ -989,8 +1007,8 @@ protected function setPropertyValue(&$object, $property, $value)
* @param object $object
* @param string $method
* @param array $args
*
* @return mixed the method result.
* @return mixed
* @throws \ReflectionException
*/
private function invokeMethod($object, $method, $args = [])
{
Expand All @@ -1007,6 +1025,7 @@ private function invokeMethod($object, $method, $args = [])
* @param array $methods
*
* @return \PHPUnit_Framework_MockObject_MockObject
* @throws \ReflectionException
*/
private function getAdvancedPricingMock($methods = [])
{
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/AdvancedSearch/Block/SearchData.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ abstract class SearchData extends Template implements SearchDataInterface
/**
* @var string
*/
protected $_template = 'search_data.phtml';
protected $_template = 'Magento_AdvancedSearch::search_data.phtml';

/**
* @param Template\Context $context
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
</after>
<actionGroup ref="LoginActionGroup" stepKey="loginAsAdmin"/>
<amOnPage stepKey="amOnAdminConfig" url="{{AdminConfigPage.url}}"/>
<waitForPageLoad stepKey="waitForAdminConfig"/>
<click stepKey="clickAdvancedReportingConfigMenu" selector="{{AdminConfigSection.advancedReportingMenuItem}}"/>
<selectOption stepKey="selectAdvancedReportingIndustry" selector="{{AdminConfigSection.advancedReportingIndustry}}" userInput="Apps and Games"/>
<selectOption stepKey="selectAdvancedReportingHour" selector="{{AdminConfigSection.advancedReportingHour}}" userInput="11"/>
Expand Down
20 changes: 12 additions & 8 deletions app/code/Magento/Backend/Block/Widget/Form/Element/Dependence.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,14 +124,18 @@ protected function _toHtml()
if (!$this->_depends) {
return '';
}
return '<script>
require(["mage/adminhtml/form"], function(){
new FormElementDependenceController(' .
$this->_getDependsJson() .
($this->_configOptions ? ', ' .
$this->_jsonEncoder->encode(
$this->_configOptions
) : '') . '); });</script>';

$params = $this->_getDependsJson();

if ($this->_configOptions) {
$params .= ', ' . $this->_jsonEncoder->encode($this->_configOptions);
}

return "<script>
require(['mage/adminhtml/form'], function(){
new FormElementDependenceController({$params});
});
</script>";
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,7 @@
xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/SectionObject.xsd">
<section name="AdminMessagesSection">
<element name="success" type="text" selector="#messages div.message-success"/>
<element name="nthSuccess" type="text" selector=".message.message-success.success:nth-of-type({{n}})>div" parameterized="true"/>
<element name="error" type="text" selector="#messages div.message-error"/>
</section>
</sections>
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
<section name="AdminSecondaryGridSection">
<element name="resetFilters" type="button" selector="[title='Reset Filter']"/>
<element name="taxIdentifierSearch" type="input" selector=".col-code .admin__control-text"/>
<element name="catalogRuleIdentifierSearch" type="input" selector=".col-name .admin__control-text"/>
<element name="searchButton" type="input" selector=".admin__filter-actions [title='Search']"/>
<element name="firstRow" type="block" selector="tr[data-role='row']"/>
</section>
</sections>

2 changes: 1 addition & 1 deletion app/code/Magento/Braintree/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
},
"require": {
"php": "~7.1.3||~7.2.0",
"braintree/braintree_php": "3.28.0",
"braintree/braintree_php": "3.34.0",
"magento/framework": "*",
"magento/magento-composer-installer": "*",
"magento/module-catalog": "*",
Expand Down
8 changes: 4 additions & 4 deletions app/code/Magento/Bundle/Model/Product/Type.php
Original file line number Diff line number Diff line change
Expand Up @@ -534,12 +534,12 @@ public function updateQtyOption($options, \Magento\Framework\DataObject $option,

foreach ($selections as $selection) {
if ($selection->getProductId() == $optionProduct->getId()) {
foreach ($options as &$option) {
if ($option->getCode() == 'selection_qty_' . $selection->getSelectionId()) {
foreach ($options as $quoteItemOption) {
if ($quoteItemOption->getCode() == 'selection_qty_' . $selection->getSelectionId()) {
if ($optionUpdateFlag) {
$option->setValue(intval($option->getValue()));
$quoteItemOption->setValue(intval($quoteItemOption->getValue()));
} else {
$option->setValue($value);
$quoteItemOption->setValue($value);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,38 @@
<!--Fill URL input-->
<fillField userInput="{{BundleProduct.urlKey}}" selector="{{AdminProductFormBundleSection.urlKey}}" stepKey="FillsinSEOlinkExtension"/>
</actionGroup>

<actionGroup name="addBundleOptionWithTwoProducts">
<arguments>
<argument name="x" type="string"/>
<argument name="n" type="string"/>
<argument name="prodOneSku" type="string"/>
<argument name="prodTwoSku" type="string"/>
<argument name="optionTitle" type="string"/>
<argument name="inputType" type="string"/>
</arguments>
<conditionalClick selector="{{AdminProductFormBundleSection.bundleItemsToggle}}" dependentSelector="{{AdminProductFormBundleSection.bundleItemsToggle}}" visible="false" stepKey="conditionallyOpenSectionBundleItems"/>
<scrollTo selector="{{AdminProductFormBundleSection.bundleItemsToggle}}" stepKey="scrollUpABit"/>
<click selector="{{AdminProductFormBundleSection.addOption}}" stepKey="clickAddOption"/>
<waitForElementVisible selector="{{AdminProductFormBundleSection.bundleOptionXTitle(x)}}" stepKey="waitForOptions"/>
<fillField selector="{{AdminProductFormBundleSection.bundleOptionXTitle(x)}}" userInput="{{optionTitle}}" stepKey="fillTitle"/>
<selectOption selector="{{AdminProductFormBundleSection.bundleOptionXInputType(x)}}" userInput="{{inputType}}" stepKey="selectType"/>
<waitForElementVisible selector="{{AdminProductFormBundleSection.nthAddProductsToOption(n)}}" stepKey="waitForAddBtn"/>
<click selector="{{AdminProductFormBundleSection.nthAddProductsToOption(n)}}" stepKey="clickAdd"/>
<conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters1"/>
<click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters1"/>
<fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{prodOneSku}}" stepKey="fillProductSkuFilter1"/>
<click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters1"/>
<waitForElementNotVisible selector="{{AdminProductGridSection.loadingMask}}" stepKey="waitForFilteredGridLoad1" time="30"/>
<checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectProduct1"/>
<conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters2"/>
<click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters2"/>
<fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{prodTwoSku}}" stepKey="fillProductSkuFilter2"/>
<click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters2"/>
<waitForElementNotVisible selector="{{AdminProductGridSection.loadingMask}}" stepKey="waitForFilteredGridLoad2" time="30"/>
<checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectProduct2"/>
<click selector="{{AdminAddProductsToOptionPanel.addSelectedProducts}}" stepKey="clickAddButton1"/>
<fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '0')}}" userInput="50" stepKey="fillQuantity1"/>
<fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '1')}}" userInput="50" stepKey="fillQuantity2"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?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="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/actionGroupSchema.xsd">
<!-- Add Bundle Product to Cart from the category page with specified quantity to cart -->
<actionGroup name="StorefrontAddCategoryBundleProductToCartActionGroup">
<arguments>
<argument name="product"/>
<argument name="quantity" defaultValue="1" type="string"/>
</arguments>
<moveMouseOver selector="{{StorefrontCategoryProductSection.ProductInfoByName(product.name)}}" stepKey="moveMouseOverProduct" />
<click selector="{{StorefrontCategoryProductSection.ProductAddToCartByName(product.name)}}" stepKey="clickAddToCart" />
<waitForPageLoad time="30" stepKey="waitForPageLoad1"/>
<click selector="{{StorefrontBundleProductActionSection.customizeAndAddToCartButton}}" stepKey="clickCustomizeAndAddToCart"/>
<waitForPageLoad time="30" stepKey="waitForPageLoad2"/>
<fillField selector="{{StorefrontBundleProductActionSection.quantityField}}" userInput="{{quantity}}" stepKey="fillBundleProductQuantity"/>
<click selector="{{StorefrontBundleProductActionSection.addToCartButton}}" stepKey="clickAddBundleProductToCart"/>
<waitForPageLoad time="30" stepKey="waitForPageLoad3"/>
<waitForText userInput="{{quantity}}" selector="{{StorefrontMinicartSection.productCount}}" time="30" stepKey="assertProductCount"/>
</actionGroup>
</actionGroups>
1 change: 1 addition & 0 deletions app/code/Magento/Bundle/Test/Mftf/Data/ProductData.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
<data key="default_quantity2">20</data>
<data key="set">4</data>
<data key="type">bundle</data>
<data key="price">10</data>
<data key="fixedPrice">10</data>
<data key="fixedPriceFormatted">$10.00</data>
<data key="defaultAttribute">Default</data>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
<element name="bundleOptionXRequired" type="checkbox" selector="[name='bundle_options[bundle_options][{{x}}][required]']" parameterized="true"/>
<element name="bundleOptionXProductYQuantity" type="input" selector="[name='bundle_options[bundle_options][{{x}}][bundle_selections][{{y}}][selection_qty]']" parameterized="true"/>
<element name="addProductsToOption" type="button" selector="[data-index='modal_set']" timeout="30"/>
<element name="nthAddProductsToOption" type="button" selector="//tr[{{var}}]//button[@data-index='modal_set']" timeout="30" parameterized="true"/>
<!--Select"url Key"InputForm-->
<element name="urlKey" type="input" selector="//input[@name='product[url_key]']" timeout="30"/>
<!--AddSelectedProducts-->
Expand Down Expand Up @@ -60,5 +61,12 @@
<element name="listedBundleItem2" type="text" selector="//tr[@data-repeat-index='2']//div"/>
<!--FirstProductOption-->
<element name="firstProductOption" type="checkbox" selector="//div[@class='admin__data-grid-outer-wrap']//tr[@data-repeat-index='0']//input[@type='checkbox']"/>
<!--Category Selection-->
<element name="categoriesDropDown" type="multiselect" selector="//div[@data-index='category_ids']//div" timeout="30"/>
<element name="defaultCategory" type="multiselect" selector="//div[@data-index='category_ids']//span[contains(text(), 'Default Category')]"/>
<element name="categoryByName" type="multiselect" selector="//div[@data-index='category_ids']//span[contains(text(), '{{category}}')]" parameterized="true"/>
<element name="searchForCategory" type="input" selector="div.action-menu._active > div.admin__action-multiselect-search-wrap input" timeout="30"/>
<element name="selectCategory" type="multiselect" selector="//div[@class='action-menu _active']//label[@class='admin__action-multiselect-label']"/>
<element name="categoriesLabel" type="text" selector="//div[@class='action-menu _active']//button[@data-action='close-advanced-select']"/>
</section>
</sections>
Loading

0 comments on commit 46081df

Please sign in to comment.