/
Summary.php
64 lines (57 loc) · 1.21 KB
/
Summary.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<?php
/**
* @api
* Copyright © 2015 Magento. All rights reserved.
* See COPYING.txt for license details.
*/
namespace Magento\Review\Test\Block\Product\View;
use Magento\Mtf\Block\Block;
use Magento\Mtf\Client\ElementInterface;
/**
* Reviews frontend block.
*/
class Summary extends Block
{
/**
* Add review link selector.
*
* @var string
*/
protected $addReviewLinkSelector = '.action.add';
/**
* View review link selector.
*
* @var string
*/
protected $viewReviewLinkSelector = '.action.view';
/**
* Get add review link.
*
* @return ElementInterface
*/
public function getAddReviewLink()
{
return $this->_rootElement->find($this->addReviewLinkSelector);
}
/**
* Click on add review link.
*
* @return void
*/
public function clickAddReviewLink()
{
$reviewLink = $this->getAddReviewLink();
if ($reviewLink->isVisible()) {
$reviewLink->click();
}
}
/**
* Get view review link
*
* @return ElementInterface
*/
public function getViewReviewLink()
{
return $this->_rootElement->find($this->viewReviewLinkSelector);
}
}