Skip to content

Commit

Permalink
🔃 [Magento Community Engineering] Community Contributions - 2.4-develop
Browse files Browse the repository at this point in the history
Accepted Community Pull Requests:
 - #31022: ISSUE-30265 - Fix product add / remove in Safari when creating an order in admin (by @zaximus84)
 - #30868: Fixed "Email Copy of Invoice", "Email Copy of Shipment" and "Email Copy of Creditmemo" Issues (by @gwharton)
 - #30822: Fix iterate on null (by @thomas-kl1)
 - #30910: Ensure that url suffix resolvers return strings to match function declaration (by @aligent-lturner)
 - #28926: Fix for communication.xml Handlers merging processs (by @matiashidalgo)
 - #31013: [MFTF] Adding AdminSetStockStatusActionGroup (by @AnnaAPak)
 - #31079: [MFTF] Refactoring of AdminMassUpdateProductAttributesMissingRequiredFieldTest (by @AnnaAPak)
 - #31151: Use magento coding standard 6 (by @ihor-sviziev)
 - #30477: Fix issue  #30270 Product Reviews can not be sorted by Admin on the Product edit page (by @Chandresh22)
 - #30953: set correct remaining available discount amount when applying fixed p… (by @sky-hub)
 - #27845: Allow customer to specify associated product qtys when adding grouped product to cart via RESTful API (by @shawnabramson)
 - #30626: Handle exceptions thrown in child processes forked by ProcessManager (by @pawel-siejba)


Fixed GitHub Issues:
 - #30265: SAFARI: endless deploy when admin try to add product in order (reported by @magento-engcom-team) has been fixed in #31022 by @zaximus84 in 2.4-develop branch
   Related commits:
     1. d018988

 - #28511: New Invoice: Checkbox "Email Copy of Invoice" is useless (reported by @TerrapinSoftware) has been fixed in #30868 by @gwharton in 2.4-develop branch
   Related commits:
     1. e0d8149

 - #30830: [Issue] Fix iterate on null (reported by @m2-assistant[bot]) has been fixed in #30822 by @thomas-kl1 in 2.4-develop branch
   Related commits:
     1. f5d692f
     2. 73edcb1
     3. 8fcac9d
     4. 5029cb0
     5. e8294f8

 - #30909: ProductUrlSuffix and CategoryUrlSuffix GraphQL resolvers fail with null values (reported by @aligent-lturner) has been fixed in #30910 by @aligent-lturner in 2.4-develop branch
   Related commits:
     1. 5512626
     2. ffcc523
     3. 673edbe
     4. 53ed515

 - #29528: [Issue] Fix for communication.xml Handlers merging processs (reported by @m2-assistant[bot]) has been fixed in #28926 by @matiashidalgo in 2.4-develop branch
   Related commits:
     1. fb9f52d
     2. 2cbb726
     3. 11ccb29
     4. 623e87f
     5. d5680d2
     6. cf9de17
     7. 8e054c7
     8. e7cde72
     9. 90e457d
     10. 1bf790a
     11. c373f3e
     12. 0cfb88a
     13. be308fa

 - #31034: [Issue] [MFTF] Adding AdminSetStockStatusActionGroup (reported by @m2-assistant[bot]) has been fixed in #31013 by @AnnaAPak in 2.4-develop branch
   Related commits:
     1. 3adff7a
     2. fe4a58f
     3. b542bd8
     4. 0b882f3
     5. 8626a36
     6. f95ed51

 - #31160: [Issue] [MFTF] Refactoring of AdminMassUpdateProductAttributesMissingRequiredFieldTest (reported by @m2-assistant[bot]) has been fixed in #31079 by @AnnaAPak in 2.4-develop branch
   Related commits:
     1. a3aa42c
     2. 42a2d1f

 - #31152: Update Magento Coding Standard to version 6 (reported by @sivaschenko) has been fixed in #31151 by @ihor-sviziev in 2.4-develop branch
   Related commits:
     1. 55926f8

 - #30270: �Product Reviews� can not be sorted by Admin on the Product page (reported by @magento-engcom-team) has been fixed in #30477 by @Chandresh22 in 2.4-develop branch
   Related commits:
     1. 4c5a130
     2. 4e80ef9
     3. c1eb748
     4. 1c6672e
     5. 9bd848a
     6. f18ab23
     7. da7bb72
     8. 379027f
     9. be1d79a
     10. 3eb3553
     11. 9985552

 - #30952: [Cart Rule] Incorrect discount amount applied for bundle products containing more than one option (reported by @sky-hub) has been fixed in #30953 by @sky-hub in 2.4-develop branch
   Related commits:
     1. d56db5b
     2. 4d1e4ea
     3. 12806e0
     4. b4275c9
     5. aa7e7cd
     6. a24dc14
     7. 963b28f
     8. cfb8f02
     9. 6015ada
     10. eeda660
     11. 47149bf
     12. 15bc12c

 - #26909: Add grouped product with individual quantity to cart using rest api (reported by @manish-sirvi) has been fixed in #27845 by @shawnabramson in 2.4-develop branch
   Related commits:
     1. dcc6381
     2. de1f626
     3. 8d2c280
     4. e9fa0a8
     5. d5160db
     6. 8b141e1
     7. bb9c1e2
     8. 3bcdd48
     9. 7f49335
     10. 3626d9c
     11. cc0c942
     12. 74709d2
     13. fa4c7b8
     14. 24c27a4
     15. be84eb1
     16. c936161
     17. 7af13d7
     18. 4240a6b
     19. 768b305
     20. 4aa5527
     21. 0ace0c3
     22. bdfe7ec
     23. 769653a

 - #30622: Process Manager doesn't handle exceptions properly in forked processes (reported by @pawel-siejba) has been fixed in #30626 by @pawel-siejba in 2.4-develop branch
   Related commits:
     1. 5a5b6f7
  • Loading branch information
magento-engcom-team authored Dec 10, 2020
2 parents 5e225d6 + 784c3aa commit b941603
Show file tree
Hide file tree
Showing 47 changed files with 1,896 additions and 210 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?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="AdminCheckNameToggleOnProductsMassAttributesUpdateActionGroup">
<annotations>
<description>Click the "Change" checkbox for the "Name" field on the Products Masss Attributes Update page.</description>
</annotations>

<click selector="{{AdminEditProductAttributesSection.ChangeAttributeNameToggle}}" stepKey="toggleToChangeName"/>

</actionGroup>
</actionGroups>
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="AdminCheckProductOnProductGridActionGroup">
<annotations>
<description>Check the checkbox for the product on the Product Grid</description>
</annotations>
<arguments>
<argument name="product" type="entity"/>
</arguments>

<checkOption selector="{{AdminProductGridSection.productRowCheckboxBySku(product.sku)}}" stepKey="selectProduct"/>

</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="AdminClickSaveOnProductsMassAttributesUpdateActionGroup">
<annotations>
<description>Clicks on 'Save' button on products mass attributes update page.</description>
</annotations>

<click selector="{{AdminEditProductAttributesSection.Save}}" stepKey="save"/>
<waitForPageLoad stepKey="waitForUpdateAttributesPage"/>
<see selector="{{AdminHeaderSection.pageTitle}}" userInput="Update Attributes" stepKey="seeUpdateAttributesTitle"/>
</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="AdminSetStockStatusActionGroup">
<annotations>
<description>Set Stock Status of product.</description>
</annotations>

<arguments>
<argument name="stockStatus" type="string" defaultValue="In Stock"/>
</arguments>

<selectOption selector="{{AdminProductFormSection.productStockStatus}}" userInput="{{stockStatus}}" stepKey="setStockStatus"/>

</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@

<scrollTo selector="{{AdminProductFormSection.productQuantity}}" stepKey="scrollToProductQuantity" after="waitForProductPageToLoad"/>
<remove keyForRemoval="disableProduct"/>
<selectOption selector="{{AdminProductFormSection.productStockStatus}}" userInput="Out of Stock" stepKey="selectOutOfStock" after="scrollToProductQuantity"/>
<actionGroup ref="AdminSetStockStatusActionGroup" stepKey="selectOutOfStock" after="scrollToProductQuantity">
<argument name="stockStatus" value="Out of Stock"/>
</actionGroup>

</test>
</tests>
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@
<waitForPageLoad stepKey="waitForProductToLoad"/>

<fillField selector="{{AdminProductFormSection.productQuantity}}" userInput="100" stepKey="fillProductQty"/>
<selectOption selector="{{AdminProductFormSection.productStockStatus}}" userInput="In Stock" stepKey="selectStockStatus"/>
<actionGroup ref="AdminSetStockStatusActionGroup" stepKey="selectStockStatus">
<argument name="stockStatus" value="In Stock"/>
</actionGroup>

<!-- Create New Product Attribute -->
<click selector="{{AdminProductFormSection.addAttributeBtn}}" stepKey="clickOnAddAttribute"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@
<waitForPageLoad stepKey="waitForProductToLoad"/>

<fillField selector="{{AdminProductFormSection.productQuantity}}" userInput="100" stepKey="fillProductQty"/>
<selectOption selector="{{AdminProductFormSection.productStockStatus}}" userInput="In Stock" stepKey="selectStockStatus"/>
<actionGroup ref="AdminSetStockStatusActionGroup" stepKey="selectStockStatus">
<argument name="stockStatus" value="In Stock"/>
</actionGroup>

<!-- Create Product Attribute -->
<click selector="{{AdminProductFormSection.addAttributeBtn}}" stepKey="clickOnAddAttribute"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,20 +36,27 @@
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
</after>

<!-- Search and select products -->
<actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="navigateToProductIndex"/>
<actionGroup ref="SearchProductGridByKeyword2ActionGroup" stepKey="searchByKeyword">
<argument name="keyword" value="api-simple-product"/>
</actionGroup>
<click selector="{{AdminProductGridSection.productGridCheckboxOnRow('1')}}" stepKey="clickCheckbox1"/>
<click selector="{{AdminProductGridSection.productGridCheckboxOnRow('2')}}" stepKey="clickCheckbox2"/>
<!-- Mass update attributes -->
<click selector="{{AdminProductGridSection.bulkActionDropdown}}" stepKey="clickDropdown"/>
<click selector="{{AdminProductGridSection.bulkActionOption('Update attributes')}}" stepKey="clickOption"/>
<waitForPageLoad stepKey="waitForBulkUpdatePage"/>
<seeInCurrentUrl stepKey="seeInUrl" url="catalog/product_action_attribute/edit/"/>
<click selector="{{AdminEditProductAttributesSection.ChangeAttributeNameToggle}}" stepKey="toggleToChangeName"/>
<click selector="{{AdminEditProductAttributesSection.Save}}" stepKey="save"/>

<actionGroup ref="AdminCheckProductOnProductGridActionGroup" stepKey="clickCheckbox1">
<argument name="product" value="$$createProductOne$$"/>
</actionGroup>

<actionGroup ref="AdminCheckProductOnProductGridActionGroup" stepKey="clickCheckbox2">
<argument name="product" value="$$createProductTwo$$"/>
</actionGroup>

<actionGroup ref="AdminClickMassUpdateProductAttributesActionGroup" stepKey="clickDropdown"/>
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickOption"/>
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForBulkUpdatePage"/>
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="seeInUrl"/>

<actionGroup ref="AdminCheckNameToggleOnProductsMassAttributesUpdateActionGroup" stepKey="toggleToChangeName"/>

<actionGroup ref="AdminClickSaveOnProductsMassAttributesUpdateActionGroup" stepKey="save"/>
<see stepKey="seeError" selector="{{AdminEditProductAttributesSection.NameError}}" userInput="This is a required field"/>
</test>
</tests>
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,6 @@ $blockId = $block->getId();
<div id="product_composite_configure"
class="product-configure-popup product-configure-popup-<?= $block->escapeHtmlAttr($blockId) ?>">
<iframe name="product_composite_configure_iframe" id="product_composite_configure_iframe"></iframe>
<?= /* @noEscape */ $secureRenderer->renderEventListenerAsTag(
'onload',
"window.productConfigure && productConfigure.onLoadIFrame()",
'iframe[name=\'product_composite_configure_iframe\']:last-of-type'
) ?>

<form action="" method="post" id="product_composite_configure_form" enctype="multipart/form-data"
target="product_composite_configure_iframe" class="product_composite_configure_form">
Expand Down Expand Up @@ -85,3 +80,8 @@ script;
?>
<?= /* @noEscape */ $secureRenderer->renderTag('script', [], $scriptString, false); ?>
</div>
<?= /* @noEscape */ $secureRenderer->renderEventListenerAsTag(
'onload',
"window.productConfigure && productConfigure.onLoadIFrame()",
'iframe[name=\'product_composite_configure_iframe\']:last-of-type'
) ?>
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ private function getCategoryUrlSuffix(int $storeId): ?string
self::$xml_path_category_url_suffix,
ScopeInterface::SCOPE_STORE,
$storeId
);
) ?? '';
}
return $this->categoryUrlSuffix[$storeId];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ private function getProductUrlSuffix(int $storeId): ?string
self::$xml_path_product_url_suffix,
ScopeInterface::SCOPE_STORE,
$storeId
);
) ?? '';
}
return $this->productUrlSuffix[$storeId];
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,173 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/

namespace Magento\CatalogUrlRewriteGraphQl\Test\Unit\Model\Resolver;

use Magento\CatalogUrlRewriteGraphQl\Model\Resolver\CategoryUrlSuffix;
use Magento\Framework\GraphQl\Config\Element\Field;
use Magento\Framework\GraphQl\Schema\Type\ResolveInfo;
use Magento\GraphQl\Model\Query\ContextExtensionInterface;
use Magento\GraphQl\Model\Query\ContextInterface;
use Magento\Store\Api\Data\StoreInterface;
use PHPUnit\Framework\MockObject\MockObject;
use PHPUnit\Framework\TestCase;
use Magento\Framework\App\Config\ScopeConfigInterface;

/**
* Test for \Magento\CatalogUrlRewriteGraphQl\Model\Resolver\CategoryUrlSuffix.
*/
class CategoryUrlSuffixTest extends TestCase
{
/**
* @var ScopeConfigInterface|MockObject
*/
private $scopeConfigMock;

/**
* @var ContextInterface|MockObject
*/
private $contextMock;

/**
* @var ContextExtensionInterface|MockObject
*/
private $contextExtensionMock;

/**
* @var StoreInterface|MockObject
*/
private $storeMock;

/**
* @var Field|MockObject
*/
private $fieldMock;

/**
* @var ResolveInfo|MockObject
*/
private $resolveInfoMock;

/**
* @var CategoryUrlSuffix
*/
private $resolver;

/**
* @inheritDoc
*/
protected function setUp(): void
{
$this->contextMock = $this->getMockBuilder(ContextInterface::class)
->disableOriginalConstructor()
->setMethods(
[
'getExtensionAttributes'
]
)
->getMockForAbstractClass();

$this->contextExtensionMock = $this->getMockBuilder(ContextExtensionInterface::class)
->setMethods(
[
'getStore'
]
)
->getMockForAbstractClass();

$this->storeMock = $this->getMockBuilder(StoreInterface::class)
->setMethods(
[
'getId'
]
)
->getMockForAbstractClass();

$this->fieldMock = $this->getMockBuilder(Field::class)
->disableOriginalConstructor()
->getMock();

$this->resolveInfoMock = $this->getMockBuilder(ResolveInfo::class)
->disableOriginalConstructor()
->getMock();

$this->scopeConfigMock = $this->getMockBuilder(ScopeConfigInterface::class)
->getMockForAbstractClass();

$this->resolver = new CategoryUrlSuffix(
$this->scopeConfigMock
);
}

/**
* Verify that empty string is returned when config value is null
*/
public function testNullValue()
{
$this->scopeConfigMock->expects($this->once())
->method('getValue')
->willReturn(null);

$this->contextMock
->expects($this->once())
->method('getExtensionAttributes')
->willReturn($this->contextExtensionMock);

$this->contextExtensionMock
->expects($this->once())
->method('getStore')
->willReturn($this->storeMock);

$this->storeMock
->expects($this->once())
->method('getId')
->willReturn(1);

$this->assertEquals(
'',
$this->resolver->resolve(
$this->fieldMock,
$this->contextMock,
$this->resolveInfoMock
)
);
}

/**
* Verify that the configured value is returned
*/
public function testNonNullValue()
{
$value = 'html';
$this->scopeConfigMock->expects($this->once())
->method('getValue')
->willReturn($value);

$this->contextMock
->expects($this->once())
->method('getExtensionAttributes')
->willReturn($this->contextExtensionMock);

$this->contextExtensionMock
->expects($this->once())
->method('getStore')
->willReturn($this->storeMock);

$this->storeMock
->expects($this->once())
->method('getId')
->willReturn(1);

$this->assertEquals(
$value,
$this->resolver->resolve(
$this->fieldMock,
$this->contextMock,
$this->resolveInfoMock
)
);
}
}
Loading

0 comments on commit b941603

Please sign in to comment.