HEX
Server: Apache
System: Linux webm019.cluster128.gra.hosting.ovh.net 6.18.42-ovh-vps-grsec-zfs+ #1 SMP PREEMPT_DYNAMIC Wed Aug 5 15:59:48 CEST 2026 x86_64
User: petsclubcc (68997)
PHP: 5.4.45
Disabled: _dyuweyrj4,_dyuweyrj4r,dl
Upload Files
File: /home/petsclubcc/magento/dev/tests/functional/tests/app/Magento/Review/Test/Block/Product/View.php
<?php
/**
 * @api
 * Copyright © 2016 Magento. All rights reserved.
 * See COPYING.txt for license details.
 */

namespace Magento\Review\Test\Block\Product;

use Magento\Mtf\Block\Block;

/**
 * Class View
 * Reviews frontend block
 */
class View extends Block
{
    /**
     * Review item selector
     *
     * @var string
     */
    protected $itemSelector = '.review-items .review-item';

    /**
     * Selectors mapping
     *
     * @var array
     */
    protected $selectorsMapping = [
        'nickname' => '.review-author .review-details-value',
        'title' => '.review-title',
        'detail' => '.review-content',
    ];

    /**
     * Is visible review item
     *
     * @return bool
     */
    public function isVisibleReviewItem()
    {
        return $this->_rootElement->find($this->itemSelector)->isVisible();
    }

    /**
     * Get field value for review on product view page
     *
     * @param string $field
     * @return string|null
     */
    public function getFieldValue($field)
    {
        if (isset($this->selectorsMapping[$field])) {
            return $this->_rootElement->find($this->selectorsMapping[$field])->getText();
        }

        return null;
    }
}