Skip to content

Commit d977dc3

Browse files
committed
MAGETWO-69474: [FT] CreateProductAttributeEntityFromProductPageTest (CreateProductAttributeEntityFromProductPageTestVariation1_Searchable_Global_Visible_Comparable_HtmlAllowed_UsedForSorting) unstable for 2.1.7 (CE)
1 parent ff253a7 commit d977dc3

File tree

3 files changed

+17
-3
lines changed

3 files changed

+17
-3
lines changed

app/code/Magento/Catalog/Block/Product/View/Attributes.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,12 @@
1212
namespace Magento\Catalog\Block\Product\View;
1313

1414
use Magento\Catalog\Model\Product;
15+
use Magento\Framework\Phrase;
1516
use Magento\Framework\Pricing\PriceCurrencyInterface;
1617

18+
/**
19+
* Product attributes block.
20+
*/
1721
class Attributes extends \Magento\Framework\View\Element\Template
1822
{
1923
/**
@@ -58,6 +62,7 @@ public function getProduct()
5862
if (!$this->_product) {
5963
$this->_product = $this->_coreRegistry->registry('product');
6064
}
65+
6166
return $this->_product;
6267
}
6368

@@ -86,7 +91,7 @@ public function getAdditionalData(array $excludeAttr = [])
8691
$value = $this->priceCurrency->convertAndFormat($value);
8792
}
8893

89-
if (is_string($value) && strlen($value)) {
94+
if (($value instanceof Phrase || is_string($value)) && strlen($value)) {
9095
$data[$attribute->getAttributeCode()] = [
9196
'label' => __($attribute->getStoreLabel()),
9297
'value' => $value,
@@ -95,6 +100,7 @@ public function getAdditionalData(array $excludeAttr = [])
95100
}
96101
}
97102
}
103+
98104
return $data;
99105
}
100106
}

dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/ProductForm.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,8 @@ public function openSection($sectionName)
109109
$sectionElement = $this->getContainerElement($sectionName);
110110
if ($sectionElement->getAttribute('type') == 'button') {
111111
$sectionElement->click();
112+
// Wait until section animation finished.
113+
$this->waitForElementVisible($this->closeButton);
112114
} else {
113115
parent::openSection($sectionName);
114116
}

dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Product/ListProduct.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,17 @@
1616
*/
1717
class ListProduct extends Block
1818
{
19+
// @codingStandardsIgnoreStart
20+
1921
/**
2022
* Locator for product item block.
2123
*
2224
* @var string
2325
*/
2426
protected $productItem = './/*[contains(@class,"product-item-link") and normalize-space(text())="%s"]/ancestor::li';
2527

28+
// @codingStandardsIgnoreEnd
29+
2630
/**
2731
* Locator for product item link.
2832
*
@@ -48,7 +52,7 @@ public function getProductItem(FixtureInterface $product)
4852
$locator = sprintf($this->productItem, $product->getName());
4953

5054
return $this->blockFactory->create(
51-
'Magento\Catalog\Test\Block\Product\ProductList\ProductItem',
55+
\Magento\Catalog\Test\Block\Product\ProductList\ProductItem::class,
5256
['element' => $this->_rootElement->find($locator, Locator::SELECTOR_XPATH)]
5357
);
5458
}
@@ -77,6 +81,8 @@ public function getProductNames()
7781
*/
7882
public function getSortByValues()
7983
{
80-
return explode("\n", $this->_rootElement->find($this->sorter)->getText());
84+
$sortValues = $this->_rootElement->find($this->sorter)->getText();
85+
86+
return array_filter(array_map("trim", explode("\n", $sortValues)));
8187
}
8288
}

0 commit comments

Comments
 (0)