Skip to content

Commit b3d6462

Browse files
xmavValeriy Nayda
authored andcommitted
MAGETWO-64889: [Performance] Optimize "Is Salable" check on Category page for Configurable Product
- Fix functional tests for configurable product
1 parent 1ac9154 commit b3d6462

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

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

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,8 @@
88

99
use Magento\Catalog\Test\Block\Product\View\CustomOptions;
1010
use Magento\ConfigurableProduct\Test\Fixture\ConfigurableProduct;
11-
use Magento\Mtf\Client\Element;
1211
use Magento\Mtf\Client\Locator;
1312
use Magento\Mtf\Fixture\FixtureInterface;
14-
use Magento\Mtf\Fixture\InjectableFixture;
1513
use Magento\Mtf\Client\Element\SimpleElement;
1614

1715
/**
@@ -32,7 +30,7 @@ class ConfigurableOptions extends CustomOptions
3230
*
3331
* @var string
3432
*/
35-
protected $priceBlock = '//*[@class="product-info-main"]//*[contains(@class,"price-box")]';
33+
protected $priceBlock = '.product-info-price .price-box';
3634

3735
/**
3836
* Selector for tier prices.
@@ -160,10 +158,12 @@ private function getOptionTierPrices()
160158
*/
161159
protected function getPriceBlock()
162160
{
163-
return $this->blockFactory->create(
161+
/** @var \Magento\Catalog\Test\Block\Product\Price $priceBlock */
162+
$priceBlock = $this->blockFactory->create(
164163
\Magento\Catalog\Test\Block\Product\Price::class,
165-
['element' => $this->_rootElement->find($this->priceBlock, Locator::SELECTOR_XPATH)]
164+
['element' => $this->_rootElement->find($this->priceBlock)]
166165
);
166+
return $priceBlock;
167167
}
168168

169169
/**
@@ -213,4 +213,14 @@ public function getPresentOptions()
213213

214214
return $options;
215215
}
216+
217+
/**
218+
* Check if the options container is visible or not
219+
*
220+
* @return bool
221+
*/
222+
public function isVisible()
223+
{
224+
return $this->_rootElement->find($this->optionsContext, Locator::SELECTOR_XPATH)->isVisible();
225+
}
216226
}

0 commit comments

Comments
 (0)