Skip to content

Commit 1c9c696

Browse files
author
Volodymyr Klymenko
authored
Merge pull request #905 from magento-east/pr-2.1.6
[East] Stabilizing Jenkins and bugfixes for 2.1.6
2 parents f97c312 + 1631c41 commit 1c9c696

File tree

102 files changed

+371
-40
lines changed

Some content is hidden

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

102 files changed

+371
-40
lines changed

app/code/Magento/Eav/Model/Entity/Attribute/Frontend/AbstractFrontend.php

Lines changed: 51 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,29 @@
1111
*/
1212
namespace Magento\Eav\Model\Entity\Attribute\Frontend;
1313

14+
use Magento\Framework\App\CacheInterface;
15+
use Magento\Store\Api\StoreResolverInterface;
16+
use Magento\Framework\App\ObjectManager;
17+
use Magento\Eav\Model\Cache\Type as CacheType;
18+
use Magento\Eav\Model\Entity\Attribute;
19+
1420
abstract class AbstractFrontend implements \Magento\Eav\Model\Entity\Attribute\Frontend\FrontendInterface
1521
{
22+
/**
23+
* @var CacheInterface
24+
*/
25+
private $cache;
26+
27+
/**
28+
* @var StoreResolverInterface
29+
*/
30+
private $storeResolver;
31+
32+
/**
33+
* @var array
34+
*/
35+
private $cacheTags;
36+
1637
/**
1738
* Reference to the attribute instance
1839
*
@@ -27,11 +48,24 @@ abstract class AbstractFrontend implements \Magento\Eav\Model\Entity\Attribute\F
2748

2849
/**
2950
* @param \Magento\Eav\Model\Entity\Attribute\Source\BooleanFactory $attrBooleanFactory
51+
* @param CacheInterface $cache
52+
* @param StoreResolverInterface $storeResolver
53+
* @param array $cacheTags
3054
* @codeCoverageIgnore
3155
*/
32-
public function __construct(\Magento\Eav\Model\Entity\Attribute\Source\BooleanFactory $attrBooleanFactory)
33-
{
56+
public function __construct(
57+
\Magento\Eav\Model\Entity\Attribute\Source\BooleanFactory $attrBooleanFactory,
58+
CacheInterface $cache = null,
59+
StoreResolverInterface $storeResolver = null,
60+
array $cacheTags = [
61+
CacheType::CACHE_TAG,
62+
Attribute::CACHE_TAG,
63+
]
64+
) {
3465
$this->_attrBooleanFactory = $attrBooleanFactory;
66+
$this->cache = $cache ?: ObjectManager::getInstance()->get(CacheInterface::class);
67+
$this->storeResolver = $storeResolver ?: ObjectManager::getInstance()->get(StoreResolverInterface::class);
68+
$this->cacheTags = $cacheTags;
3569
}
3670

3771
/**
@@ -216,7 +250,21 @@ public function getConfigField($fieldName)
216250
*/
217251
public function getSelectOptions()
218252
{
219-
return $this->getAttribute()->getSource()->getAllOptions();
253+
$cacheKey = 'attribute-navigation-option-' .
254+
$this->getAttribute()->getAttributeCode() . '-' .
255+
$this->storeResolver->getCurrentStoreId();
256+
$optionString = $this->cache->load($cacheKey);
257+
if (false === $optionString) {
258+
$options = $this->getAttribute()->getSource()->getAllOptions();
259+
$this->cache->save(
260+
json_encode($options),
261+
$cacheKey,
262+
$this->cacheTags
263+
);
264+
} else {
265+
$options = json_decode($optionString, true);
266+
}
267+
return $options;
220268
}
221269

222270
/**
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
<?php
2+
/**
3+
* Copyright © 2013-2017 Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
7+
namespace Magento\Mtf\Client\Element;
8+
9+
use Magento\Mtf\Client\Locator;
10+
11+
/**
12+
* Class provides ability to work with page element radio button.
13+
*/
14+
class RadiobuttonElement extends SimpleElement
15+
{
16+
/**
17+
* Label for radio button selector.
18+
*
19+
* @var string
20+
*/
21+
protected $labelSelector = './..//label[contains(., "%s")]';
22+
23+
/**
24+
* Selector for selected label.
25+
*
26+
* @var string
27+
*/
28+
protected $selectedLabelSelector = 'input[type=radio]:checked + label';
29+
30+
/**
31+
* Get value of the required element.
32+
*
33+
* @return string
34+
*/
35+
public function getValue()
36+
{
37+
$this->eventManager->dispatchEvent(['get_value'], [$this->getAbsoluteSelector()]);
38+
return $this->find($this->selectedLabelSelector)->getText();
39+
}
40+
41+
/**
42+
* Select radio button based on label value.
43+
*
44+
* @param string $value
45+
* @return void
46+
*/
47+
public function setValue($value)
48+
{
49+
$this->eventManager->dispatchEvent(['set_value'], [__METHOD__, $this->getAbsoluteSelector()]);
50+
$radioButtonLabel = $this->find(sprintf($this->labelSelector, $value), Locator::SELECTOR_XPATH);
51+
if (!$this->isSelected()) {
52+
$radioButtonLabel->click();
53+
}
54+
}
55+
}

dev/tests/functional/tests/app/Magento/Authorizenet/Test/TestCase/OnePageCheckoutTest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
<item name="isClosed" xsi:type="string">No</item>
2727
<item name="transactionType" xsi:type="string">Authorization</item>
2828
</data>
29-
<data name="tag" xsi:type="string">test_type:3rd_party_test severity:S0</data>
29+
<data name="tag" xsi:type="string">test_type:3rd_party_test, severity:S0</data>
3030
<constraint name="Magento\Checkout\Test\Constraint\AssertOrderSuccessPlacedMessage" />
3131
<constraint name="Magento\Checkout\Test\Constraint\AssertMinicartEmpty" />
3232
<constraint name="Magento\Sales\Test\Constraint\AssertOrderGrandTotal" />

dev/tests/functional/tests/app/Magento/Backend/Test/TestCase/GlobalSearchEntityTest.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,26 +8,31 @@
88
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd">
99
<testCase name="Magento\Backend\Test\TestCase\GlobalSearchEntityTest" summary="Global Search Backend " ticketId="MAGETWO-28457">
1010
<variation name="GlobalSearchEntityTestVariation1">
11+
<data name="tag" xsi:type="string">stable:no</data>
1112
<data name="description" xsi:type="string">search shows admin preview</data>
1213
<data name="search/data/query" xsi:type="string">Some search term</data>
1314
<constraint name="Magento\Backend\Test\Constraint\AssertGlobalSearchPreview" />
1415
</variation>
1516
<variation name="GlobalSearchEntityTestVariation2">
17+
<data name="tag" xsi:type="string">stable:no</data>
1618
<data name="description" xsi:type="string">search with 2 sign return no results</data>
1719
<data name="search/data/query" xsi:type="string">:)</data>
1820
<constraint name="Magento\Backend\Test\Constraint\AssertGlobalSearchNoRecordsFound" />
1921
</variation>
2022
<variation name="GlobalSearchEntityTestVariation3">
23+
<data name="tag" xsi:type="string">to_maintain:yes</data>
2124
<data name="description" xsi:type="string">search product by sku</data>
2225
<data name="search/data/query" xsi:type="string">orderInjectable::default::product::sku</data>
2326
<constraint name="Magento\Backend\Test\Constraint\AssertGlobalSearchProductName" />
2427
</variation>
2528
<variation name="GlobalSearchEntityTestVariation4">
29+
<data name="tag" xsi:type="string">stable:no</data>
2630
<data name="description" xsi:type="string">search existed customer</data>
2731
<data name="search/data/query" xsi:type="string">customer::johndoe_unique::lastname</data>
2832
<constraint name="Magento\Backend\Test\Constraint\AssertGlobalSearchCustomerName" />
2933
</variation>
3034
<variation name="GlobalSearchEntityTestVariation5">
35+
<data name="tag" xsi:type="string">stable:no</data>
3136
<data name="description" xsi:type="string">search order (by order id)</data>
3237
<data name="search/data/query" xsi:type="string">orderInjectable::default::id</data>
3338
<constraint name="Magento\Backend\Test\Constraint\AssertGlobalSearchOrderId" />

dev/tests/functional/tests/app/Magento/Bundle/Test/TestCase/CreateBundleProductEntityTest.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@
9797
<constraint name="Magento\Bundle\Test\Constraint\AssertBundleItemsOnProductPage" />
9898
</variation>
9999
<variation name="CreateBundleProductEntityTestVariation5">
100+
<data name="tag" xsi:type="string">stable:no</data>
100101
<data name="description" xsi:type="string">Create fixed bundle with all types options</data>
101102
<data name="product/data/url_key" xsi:type="string">bundle-product-%isolation%</data>
102103
<data name="product/data/name" xsi:type="string">BundleProduct %isolation%</data>
@@ -187,6 +188,7 @@
187188
<constraint name="Magento\Bundle\Test\Constraint\AssertTierPriceOnBundleProductPage" />
188189
</variation>
189190
<variation name="CreateBundleProductEntityTestVariation8">
191+
<data name="tag" xsi:type="string">to_maintain:yes</data>
190192
<data name="description" xsi:type="string">Create dynamic bundle with special price</data>
191193
<data name="product/data/url_key" xsi:type="string">bundle-product-%isolation%</data>
192194
<data name="product/data/name" xsi:type="string">Bundle Dynamic %isolation%</data>
@@ -236,6 +238,7 @@
236238
<constraint name="Magento\Bundle\Test\Constraint\AssertBundlePriceType" />
237239
</variation>
238240
<variation name="CreateBundleProductEntityTestVariation11">
241+
<data name="issue" xsi:type="string">MAGETWO-60789: API wrong custom attributes order</data>
239242
<data name="description" xsi:type="string">Create fixed product with checkout first option</data>
240243
<data name="product/data/url_key" xsi:type="string">bundle-product-%isolation%</data>
241244
<data name="product/data/name" xsi:type="string">Bundle Fixed %isolation%</data>

dev/tests/functional/tests/app/Magento/Bundle/Test/TestCase/DeleteProductEntityTest.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,15 @@
88
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../vendor/magento/mtf/etc/variations.xsd">
99
<testCase name="Magento\Catalog\Test\TestCase\Product\DeleteProductEntityTest">
1010
<variation name="DeleteProductEntityTestVariation4">
11+
<data name="tag" xsi:type="string">to_maintain:yes</data>
1112
<data name="products" xsi:type="string">bundleProduct::bundle_dynamic_product</data>
1213
<data name="isRequired" xsi:type="string">Yes</data>
1314
<constraint name="Magento\Catalog\Test\Constraint\AssertProductSuccessDeleteMessage" />
1415
<constraint name="Magento\Catalog\Test\Constraint\AssertProductNotInGrid" />
1516
<constraint name="Magento\Catalog\Test\Constraint\AssertProductIsNotDisplayingOnFrontend" />
1617
</variation>
1718
<variation name="DeleteProductEntityTestVariation5">
19+
<data name="tag" xsi:type="string">to_maintain:yes</data>
1820
<data name="products" xsi:type="string">bundleProduct::bundle_fixed_product</data>
1921
<data name="isRequired" xsi:type="string">No</data>
2022
<constraint name="Magento\Catalog\Test\Constraint\AssertProductSuccessDeleteMessage" />

dev/tests/functional/tests/app/Magento/Bundle/Test/TestCase/DeleteProductFromMiniShoppingCartTest.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd">
99
<testCase name="Magento\Checkout\Test\TestCase\DeleteProductFromMiniShoppingCartTest" summary="Delete Bundle Product from Mini Shopping Cart" ticketId="MAGETWO-29104">
1010
<variation name="DeleteBundleProductFromMiniShoppingCartTestVariation">
11+
<data name="tag" xsi:type="string">to_maintain:yes</data>
1112
<data name="products" xsi:type="string">bundleProduct::default</data>
1213
<data name="deletedProductIndex" xsi:type="string">0</data>
1314
<constraint name="Magento\Checkout\Test\Constraint\AssertCartIsEmpty" />

dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Category/Edit/Section/ProductGrid.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,5 +36,5 @@ class ProductGrid extends Grid
3636
*
3737
* @var string
3838
*/
39-
protected $selectItem = 'tbody tr .col-in_category';
39+
protected $selectItem = 'tbody tr .col-in_category input';
4040
}

dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Category/CreateCategoryEntityTest.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
<constraint name="Magento\Catalog\Test\Constraint\AssertCategoryForm" />
1717
</variation>
1818
<variation name="CreateCategoryEntityTestVariation2_RootCategory_AllFields">
19+
<data name="tag" xsi:type="string">to_maintain:yes</data>
1920
<data name="description" xsi:type="string">Create root category with all fields</data>
2021
<data name="addCategory" xsi:type="string">addRootCategory</data>
2122
<data name="category/data/is_active" xsi:type="string">Yes</data>
@@ -56,6 +57,7 @@
5657
<constraint name="Magento\Catalog\Test\Constraint\AssertCategoryPage" />
5758
</variation>
5859
<variation name="CreateCategoryEntityTestVariation4_Subcategory_AllFields">
60+
<data name="tag" xsi:type="string">to_maintain:yes</data>
5961
<data name="description" xsi:type="string">Create not anchor subcategory specifying all fields</data>
6062
<data name="addCategory" xsi:type="string">addSubcategory</data>
6163
<data name="category/data/parent_id/dataset" xsi:type="string">default_category</data>
@@ -90,6 +92,7 @@
9092
<constraint name="Magento\Catalog\Test\Constraint\AssertCategoryForAssignedProducts" />
9193
</variation>
9294
<variation name="CreateCategoryEntityTestVariation5_Anchor_MostOfFields">
95+
<data name="tag" xsi:type="string">to_maintain:yes</data>
9396
<data name="description" xsi:type="string">Create anchor subcategory with all fields</data>
9497
<data name="addCategory" xsi:type="string">addSubcategory</data>
9598
<data name="category/data/parent_id/dataset" xsi:type="string">default_category</data>

dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Category/UpdateCategoryEntityTest.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
<constraint name="Magento\Catalog\Test\Constraint\AssertCategoryPage" />
2222
</variation>
2323
<variation name="UpdateCategoryEntityTestVariation2_SortProductsBy_DefaultProductSorting_AddProduct">
24+
<data name="tag" xsi:type="string">to_maintain:yes</data>
2425
<data name="category/data/parent_id/dataset" xsi:type="string">default_category</data>
2526
<data name="category/data/available_product_listing_config" xsi:type="string">Yes</data>
2627
<data name="category/data/default_product_listing_config" xsi:type="string">No</data>

0 commit comments

Comments
 (0)