Skip to content

Commit

Permalink
🔃 [EngCom] Public Pull Requests - 2.3-develop Minor Fixes
Browse files Browse the repository at this point in the history
Accepted Public Pull Requests:
 - #21785: [Forwardport] [Checkout] Fix clearing admin quote address when removing all items (by @eduard13)
 - #21469: Update price-bundle.js so that correct tier price is calculated while displaying in bundle product (by @adarshkhatri)
 - #21751: fix #21750 remove translation of product attribute label (by @Karlasa)
 - #21774: MSI: Add deprecation message to CatalogInventory SPIs (by @lbajsarowicz)
 - #21575: Fix for issue #21510: Can't access backend indexers page after creating a custom index (by @ccasciotti)
 - #21288: #12396: Total Amount cart rule without tax (by @AleksLi)
 - magento-commerce/magento-functional-tests-migration#679: #417 Removed unnecessary default values in action groups (by @hws47a)
 - magento-commerce/magento-functional-tests-migration#678: Convert FlushStaticFilesCacheButtonVisibilityTest to MFTF (by @Leandry)
 - magento-commerce/magento-functional-tests-migration#676: Convert VerifyDisabledCustomerGroupFieldTest to MFTF #664 (by @Michalk39)


Fixed GitHub Issues:
 - #21467: Tier price of simple item not working in Bundle product (reported by @adarshkhatri) has been fixed in #21469 by @adarshkhatri in 2.3-develop branch
   Related commits:
     1. caabef2
     2. 4c1c653
     3. d4dd2e6
     4. e7589ad
     5. 6f49b07
     6. 0332391

 - #21750: Product attribute labels are translated (reported by @Karlasa) has been fixed in #21751 by @Karlasa in 2.3-develop branch
   Related commits:
     1. a07eda3

 - #21510: Can't access backend indexers page after creating a custom index (reported by @ccasciotti) has been fixed in #21575 by @ccasciotti in 2.3-develop branch
   Related commits:
     1. 318425f
     2. 486e21c
     3. 409e00e
     4. 0acd6b6

 - #12396: "Total Amount" cart rule without tax (reported by @Chei20) has been fixed in #21288 by @AleksLi in 2.3-develop branch
   Related commits:
     1. 6ae859a
     2. c25656b
     3. 23ed015
     4. e9389ee
     5. 571f055
  • Loading branch information
magento-engcom-team authored Mar 20, 2019
2 parents 2e863d6 + 940163e commit 0e8428c
Show file tree
Hide file tree
Showing 22 changed files with 178 additions and 18 deletions.
9 changes: 9 additions & 0 deletions app/code/Magento/Bundle/view/base/web/js/price-bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -374,8 +374,17 @@ define([
function applyTierPrice(oneItemPrice, qty, optionConfig) {
var tiers = optionConfig.tierPrice,
magicKey = _.keys(oneItemPrice)[0],
tiersFirstKey = _.keys(optionConfig)[0],
lowest = false;

if (!tiers) {//tiers is undefined when options has only one option
tiers = optionConfig[tiersFirstKey].tierPrice;
}

tiers.sort(function (a, b) {//sorting based on "price_qty"
return a['price_qty'] - b['price_qty'];
});

_.each(tiers, function (tier, index) {
if (tier['price_qty'] > qty) {
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
<tbody>
<?php foreach ($_additional as $_data): ?>
<tr>
<th class="col label" scope="row"><?= $block->escapeHtml(__($_data['label'])) ?></th>
<td class="col data" data-th="<?= $block->escapeHtml(__($_data['label'])) ?>"><?= /* @escapeNotVerified */ $_helper->productAttribute($_product, $_data['value'], $_data['code']) ?></td>
<th class="col label" scope="row"><?= $block->escapeHtml($_data['label']) ?></th>
<td class="col data" data-th="<?= $block->escapeHtml($_data['label']) ?>"><?= /* @escapeNotVerified */ $_helper->productAttribute($_product, $_data['value'], $_data['code']) ?></td>
</tr>
<?php endforeach; ?>
</tbody>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,33 @@

/**
* Interface StockRegistryProviderInterface
*
* @deprecated 2.3.0 Replaced with Multi Source Inventory
* @link https://devdocs.magento.com/guides/v2.3/inventory/index.html
* @link https://devdocs.magento.com/guides/v2.3/inventory/catalog-inventory-replacements.html
*/
interface StockRegistryProviderInterface
{
/**
* Get stock.
*
* @param int $scopeId
* @return \Magento\CatalogInventory\Api\Data\StockInterface
*/
public function getStock($scopeId);

/**
* Get stock item.
*
* @param int $productId
* @param int $scopeId
* @return \Magento\CatalogInventory\Api\Data\StockItemInterface
*/
public function getStockItem($productId, $scopeId);

/**
* Get stock status.
*
* @param int $productId
* @param int $scopeId
* @return \Magento\CatalogInventory\Api\Data\StockStatusInterface
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,32 @@

/**
* Interface StockStateProviderInterface
*
* @deprecated 2.3.0 Replaced with Multi Source Inventory
* @link https://devdocs.magento.com/guides/v2.3/inventory/index.html
* @link https://devdocs.magento.com/guides/v2.3/inventory/catalog-inventory-replacements.html
*/
interface StockStateProviderInterface
{
/**
* Verify stock.
*
* @param StockItemInterface $stockItem
* @return bool
*/
public function verifyStock(StockItemInterface $stockItem);

/**
* Verify notification.
*
* @param StockItemInterface $stockItem
* @return bool
*/
public function verifyNotification(StockItemInterface $stockItem);

/**
* Validate quote qty.
*
* @param StockItemInterface $stockItem
* @param int|float $itemQty
* @param int|float $qtyToCheck
Expand All @@ -44,8 +54,9 @@ public function checkQuoteItemQty(StockItemInterface $stockItem, $itemQty, $qtyT
public function checkQty(StockItemInterface $stockItem, $qty);

/**
* Returns suggested qty that satisfies qty increments and minQty/maxQty/minSaleQty/maxSaleQty conditions
* or original qty if such value does not exist
* Returns suggested qty or original qty if such value does not exist.
*
* Suggested qty satisfies qty increments and minQty/maxQty/minSaleQty/maxSaleQty conditions.
*
* @param StockItemInterface $stockItem
* @param int|float $qty
Expand All @@ -54,6 +65,8 @@ public function checkQty(StockItemInterface $stockItem, $qty);
public function suggestQty(StockItemInterface $stockItem, $qty);

/**
* Check qty increments.
*
* @param StockItemInterface $stockItem
* @param int|float $qty
* @return \Magento\Framework\DataObject
Expand Down
3 changes: 0 additions & 3 deletions app/code/Magento/Checkout/etc/di.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,4 @@
</argument>
</arguments>
</type>
<type name="Magento\Quote\Model\Quote">
<plugin name="clear_addresses_after_product_delete" type="Magento\Checkout\Plugin\Model\Quote\ResetQuoteAddresses"/>
</type>
</config>
3 changes: 3 additions & 0 deletions app/code/Magento/Checkout/etc/frontend/di.xml
Original file line number Diff line number Diff line change
Expand Up @@ -96,4 +96,7 @@
</argument>
</arguments>
</type>
<type name="Magento\Quote\Model\Quote">
<plugin name="clear_addresses_after_product_delete" type="Magento\Checkout\Plugin\Model\Quote\ResetQuoteAddresses"/>
</type>
</config>
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@

<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd">
<entity name="NotLoggedInCustomerGroup" type="customerGroup">
<data key="id">0</data>
<data key="code">NOT LOGGED IN</data>
<data key="tax_class_id">3</data>
<data key="tax_class_name">Retail Customer</data>
</entity>
<entity name="GeneralCustomerGroup" type="customerGroup">
<data key="code">General</data>
<data key="tax_class_id">3</data>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,6 @@
<element name="selectFirstRow" type="button" selector="//button[@class='action-select']"/>
<element name="deleteBtn" type="button" selector="//*[text()='Delete']"/>
<element name="clearAllBtn" type="button" selector="//button[text()='Clear all']"/>
<element name="editButtonByCustomerGroupCode" type="button" selector="//tr[.//td[count(//th[./*[.='Group']]/preceding-sibling::th) + 1][./*[.='{{code}}']]]//a[contains(@href, '/edit/')]" parameterized="true" />
</section>
</sections>
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?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="VerifyDisabledCustomerGroupFieldTest">
<annotations>
<stories value="Check that field is disabled in system Customer Group"/>
<title value="Check that field is disabled in system Customer Group"/>
<description value="Checks that customer_group_code field is disabled in NOT LOGGED IN Customer Group"/>
<testCaseId value="MC-14206"/>
<severity value="CRITICAL"/>
<group value="customers"/>
<group value="mtf_migrated"/>
</annotations>

<!-- Steps -->
<!-- 1. Login to backend as admin user -->
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
<waitForPageLoad stepKey="waitForAdminPageLoad" />

<!-- 2. Navigate to Customers > Customer Groups -->
<amOnPage url="{{AdminCustomerGroupPage.url}}" stepKey="amOnCustomerGroupPage" />
<waitForPageLoad stepKey="waitForCustomerGroupsPageLoad" />

<!-- 3. Select system Customer Group specified in data set from grid -->
<click selector="{{AdminCustomerGroupMainSection.editButtonByCustomerGroupCode(NotLoggedInCustomerGroup.code)}}" stepKey="clickOnEditCustomerGroup" />

<!-- 4. Perform all assertions -->
<seeInField selector="{{AdminNewCustomerGroupSection.groupName}}" userInput="{{NotLoggedInCustomerGroup.code}}" stepKey="seeNotLoggedInTextInGroupName" />
<assertElementContainsAttribute selector="{{AdminNewCustomerGroupSection.groupName}}" attribute="disabled" expectedValue="true" stepKey="checkIfGroupNameIsDisabled" />
</test>
</tests>
5 changes: 4 additions & 1 deletion app/code/Magento/Indexer/Model/Indexer.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/

namespace Magento\Indexer\Model;

use Magento\Framework\Indexer\ActionFactory;
Expand All @@ -14,6 +15,8 @@
use Magento\Framework\Indexer\StructureFactory;

/**
* Indexer model.
*
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
*/
class Indexer extends \Magento\Framework\DataObject implements IndexerInterface
Expand Down Expand Up @@ -361,7 +364,7 @@ public function getLatestUpdated()
return $this->getView()->getUpdated();
}
}
return $this->getState()->getUpdated();
return $this->getState()->getUpdated() ?: '';
}

/**
Expand Down
10 changes: 8 additions & 2 deletions app/code/Magento/Indexer/Test/Unit/Model/IndexerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,12 @@ public function testGetLatestUpdated($getViewIsEnabled, $getViewGetUpdated, $get
}
}
} else {
$this->assertEquals($getStateGetUpdated, $this->model->getLatestUpdated());
$getLatestUpdated = $this->model->getLatestUpdated();
$this->assertEquals($getStateGetUpdated, $getLatestUpdated);

if ($getStateGetUpdated === null) {
$this->assertNotNull($getLatestUpdated);
}
}
}

Expand All @@ -182,7 +187,8 @@ public function getLatestUpdatedDataProvider()
[true, '', '06-Jan-1944'],
[true, '06-Jan-1944', ''],
[true, '', ''],
[true, '06-Jan-1944', '05-Jan-1944']
[true, '06-Jan-1944', '05-Jan-1944'],
[false, null, null],
];
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,6 @@
<element name="pageCacheCheckbox" type="checkbox" selector="input[value='full_page']"/>
<element name="webServicesConfigCheckbox" type="checkbox" selector="input[value='config_webservice']"/>
<element name="translationsCheckbox" type="checkbox" selector="input[value='translate']"/>
<element name="additionalCacheButton" type="button" selector="//*[@id='container']//button[contains(., '{{cacheType}}')]" parameterized="true" />
</section>
</sections>
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?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="FlushStaticFilesCacheButtonVisibilityTest">
<annotations>
<features value="PageCache"/>
<stories value="Page Cache"/>
<title value="Check visibility of flush static files cache button"/>
<description value="Flush Static Files Cache button visibility"/>
<severity value="MAJOR"/>
<testCaseId value="MC-15454"/>
<group value="production_mode_only"/>
<group value="pagecache"/>
<group value="mtf_migrated"/>
</annotations>
<before>
<!-- Log in to Admin Panel -->
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
</before>

<!-- Open Cache Management page -->
<amOnPage url="{{AdminCacheManagementPage.url}}" stepKey="amOnPageCacheManagement"/>
<waitForPageLoad stepKey="waitForPageCacheManagementLoad"/>

<!-- Check 'Flush Static Files Cache' not visible in production mode. -->
<dontSee selector="{{AdminCacheManagementSection.additionalCacheButton('Flush Static Files Cache')}}" stepKey="dontSeeFlushStaticFilesButton" />
</test>
</tests>
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
<!-- Fill Order status form and click save -->
<actionGroup name="AdminOrderStatusFormFillAndSave">
<arguments>
<argument name="status" type="string" defaultValue=""/>
<argument name="label" type="string" defaultValue=""/>
<argument name="status" type="string" />
<argument name="label" type="string" />
</arguments>

<fillField stepKey="fillStatusCode" selector="{{AdminOrderStatusFormSection.statusCodeField}}" userInput="{{status}}"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
<!-- Search order status grid for item with a specific code and validate data -->
<actionGroup name="AssertOrderStatusExistsInGrid">
<arguments>
<argument name="status" type="string" defaultValue=""/>
<argument name="label" type="string" defaultValue=""/>
<argument name="status" type="string" />
<argument name="label" type="string" />
</arguments>

<click selector="{{AdminDataGridHeaderSection.clearFilters}}" stepKey="clickClearFilters"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ public function __construct(
public function loadAttributeOptions()
{
$attributes = [
'base_subtotal_with_discount' => __('Subtotal (Excl. Tax)'),
'base_subtotal' => __('Subtotal'),
'total_qty' => __('Total Items Quantity'),
'weight' => __('Total Weight'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,13 @@ class ConditionsElement extends SimpleElement
*/
protected $exception;

/**
* Condition option text selector.
*
* @var string
*/
private $conditionOptionTextSelector = '//option[normalize-space(text())="%s"]';

/**
* @inheritdoc
*/
Expand Down Expand Up @@ -282,10 +289,16 @@ protected function addCondition($type, ElementInterface $context)
$count = 0;

do {
$newCondition->find($this->addNew, Locator::SELECTOR_XPATH)->click();

try {
$newCondition->find($this->typeNew, Locator::SELECTOR_XPATH, 'select')->setValue($type);
$specificType = $newCondition->find(
sprintf($this->conditionOptionTextSelector, $type),
Locator::SELECTOR_XPATH
)->isPresent();
$newCondition->find($this->addNew, Locator::SELECTOR_XPATH)->click();
$condition = $specificType
? $newCondition->find($this->typeNew, Locator::SELECTOR_XPATH, 'selectcondition')
: $newCondition->find($this->typeNew, Locator::SELECTOR_XPATH, 'select');
$condition->setValue($type);
$isSetType = true;
} catch (\PHPUnit_Extensions_Selenium2TestCase_WebDriverException $e) {
$isSetType = false;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/

declare(strict_types=1);

namespace Magento\Mtf\Client\Element;

/**
* @inheritdoc
*/
class SelectconditionElement extends SelectElement
{
/**
* @inheritdoc
*/
protected $optionByValue = './/option[normalize-space(.)=%s]';
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd">
<testCase name="Magento\Customer\Test\TestCase\VerifyDisabledCustomerGroupFieldTest" summary="Check that field is disabled in system Customer Group" ticketId="MAGETWO-52481">
<variation name="VerifyDisabledCustomerGroupField1" summary="Checks that customer_group_code field is disabled in NOT LOGGED IN Customer Group">
<data name="tag" xsi:type="string">mftf_migrated:yes</data>
<data name="customerGroup/dataset" xsi:type="string">NOT_LOGGED_IN</data>
<data name="disabledFields" xsi:type="array">
<item name="0" xsi:type="string">customer_group_code</item>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd">
<testCase name="Magento\PageCache\Test\TestCase\FlushStaticFilesCacheButtonVisibilityTest" summary="Flush Static Files Cache button visibility" ticketId="MAGETWO-39934">
<variation name="FlushStaticFilesCacheButtonVisibilityTest">
<data name="tag" xsi:type="string">severity:S3</data>
<data name="tag" xsi:type="string">severity:S3, mftf_migrated:yes</data>
<constraint name="Magento\PageCache\Test\Constraint\AssertFlushStaticFilesCacheButtonVisibility" />
</variation>
</testCase>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ public function testAjaxBlockAction()

public function testTunnelAction()
{
$this->markTestSkipped('MAGETWO-98800: TunnelAction fails when Google Chart API is not available');

$testUrl = \Magento\Backend\Block\Dashboard\Graph::API_URL . '?cht=p3&chd=t:60,40&chs=250x100&chl=Hello|World';
$handle = curl_init();
curl_setopt($handle, CURLOPT_URL, $testUrl);
Expand Down
Loading

0 comments on commit 0e8428c

Please sign in to comment.