22 private $priceFormat = 2;
38 $errors[] = $this->verifyPriceLabel();
51 $priceBlock = $this->productView->getPriceBlock();
52 if (!$priceBlock->isVisible()) {
53 return "Price block for '{$this->product->getName()}' product' is not visible.";
55 $formPrice = $priceBlock->isOldPriceVisible() ? $priceBlock->getOldPrice() : $priceBlock->getPrice();
58 if ($fixturePrice != number_format($formPrice, $this->priceFormat)) {
59 return "Displayed product price on product page(front-end) not equals passed from fixture. " 60 .
"Actual: {$formPrice}, expected: {$fixturePrice}.";
74 $formOptions = $this->productView->getOptions($this->product);
80 'is_require' =>
'Yes',
99 $configurableFormOptions = $formOptions[
'configurable_options'];
100 $configurableFormOptions = $this->
sortDataByPath($configurableFormOptions,
'::title');
101 foreach ($configurableFormOptions as $key => $formOption) {
102 $configurableFormOptions[$key] = $this->
sortDataByPath($formOption,
'options::title');
122 foreach ($generatedMatrix as $key =>
$value) {
123 $generatedMatrix[$key] = array_intersect_key(
$value, [
'price' => 0]);
125 return $this->
verifyData($generatedMatrix, $variationsMatrix,
true,
false);
136 $priceDataConfig = $this->product->getDataFieldConfig(
'price');
137 if (isset($priceDataConfig[
'source'])) {
138 $priceData = $priceDataConfig[
'source']->getPriceData();
139 if (isset($priceData[
'price_from'])) {
140 $price = $priceData[
'price_from'];
161 protected function verifyPriceLabel()
164 $priceBlock = $this->productView->getPriceBlock($this->product);
166 if (!$priceBlock->getPriceLabel()->isVisible()) {
167 return "Product price label should be displayed.";
169 $expectedPriceLabel =
'As low as';
170 $actualPriceLabel = $priceBlock->getPriceLabel()->getText();
172 if ($expectedPriceLabel !== $actualPriceLabel) {
173 return "Displayed product price label on product page (front-end) not equals passed from fixture. " 174 .
"Actual: {$actualPriceLabel}, expected: {$expectedPriceLabel}.";
verifyAttributesMatrix($variationsMatrix, $generatedMatrix)
getLowestConfigurablePrice()