Skip to content

Commit 8d12c9b

Browse files
author
Dmytro Voskoboinikov
committed
Merge branch 'MAGETWO-71515' into 2.1-develop-PR
2 parents 0329cf4 + e4fb63f commit 8d12c9b

File tree

3 files changed

+21
-3
lines changed

3 files changed

+21
-3
lines changed

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

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,10 +211,23 @@ class View extends AbstractConfigureBlock
211211
/**
212212
* Get block price.
213213
*
214+
* @param FixtureInterface|null $product
215+
*
214216
* @return Price
215217
*/
216-
public function getPriceBlock()
218+
public function getPriceBlock(FixtureInterface $product = null)
217219
{
220+
$typeId = null;
221+
222+
if ($product) {
223+
$dataConfig = $product->getDataConfig();
224+
$typeId = isset($dataConfig['type_id']) ? $dataConfig['type_id'] : null;
225+
}
226+
227+
if ($this->hasRender($typeId)) {
228+
return $this->callRender($typeId, 'getPriceBlock');
229+
}
230+
218231
return $this->blockFactory->create(
219232
'Magento\Catalog\Test\Block\Product\Price',
220233
['element' => $this->_rootElement->find($this->priceBlock, Locator::SELECTOR_XPATH)]

dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Block/Product/View.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
namespace Magento\ConfigurableProduct\Test\Block\Product;
77

88
use Magento\ConfigurableProduct\Test\Block\Product\View\ConfigurableOptions;
9+
use Magento\Mtf\Client\Locator;
910
use Magento\Mtf\Fixture\FixtureInterface;
1011
use Magento\Mtf\Fixture\InjectableFixture;
1112

@@ -18,9 +19,13 @@ class View extends \Magento\Catalog\Test\Block\Product\View
1819
/**
1920
* Gets a configurable product price block.
2021
*
22+
* @param FixtureInterface|null $product
23+
*
2124
* @return Price
25+
*
26+
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
2227
*/
23-
public function getPriceBlock()
28+
public function getPriceBlock(FixtureInterface $product = null)
2429
{
2530
return $this->blockFactory->create(
2631
'Magento\ConfigurableProduct\Test\Block\Product\Price',

dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Constraint/AssertConfigurableProductPage.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ protected function getHighestConfigurablePrice()
171171
protected function verifyPriceLabel()
172172
{
173173
/** @var \Magento\ConfigurableProduct\Test\Block\Product\Price $priceBlock */
174-
$priceBlock = $this->productView->getPriceBlock();
174+
$priceBlock = $this->productView->getPriceBlock($this->product);
175175

176176
$fixtureLowestPrice = $this->getLowestConfigurablePrice();
177177
$fixtureHighestPrice = $this->getHighestConfigurablePrice();

0 commit comments

Comments
 (0)