Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
ReviewForm.php
Go to the documentation of this file.
1 <?php
8 
9 use Magento\Mtf\Block\Form;
10 use Magento\Mtf\Client\Locator;
11 use Magento\Mtf\Fixture\FixtureInterface;
12 use Magento\Mtf\Client\Element\SimpleElement;
13 
17 class ReviewForm extends Form
18 {
24  protected $customer = '#customer';
25 
31  protected $status = '[name=status_id]';
32 
38  protected $saveButton = '[data-ui-id$=save-button-button]';
39 
47  public function fill(FixtureInterface $fixture, SimpleElement $element = null)
48  {
49  $data = $fixture->getData();
50  if (isset($data['entity_id'])) {
51  unset($data['entity_id']);
52  }
53  $mapping = $this->dataMapping($data);
54  $this->_fill($mapping, $element);
55 
56  return $this;
57  }
58 
64  public function getPostedBy()
65  {
66  return $this->_rootElement->find($this->customer, Locator::SELECTOR_CSS)->getText();
67  }
68 
74  public function getStatus()
75  {
76  return $this->_rootElement->find($this->status, Locator::SELECTOR_CSS, 'select')->getText();
77  }
78 
84  public function setApproveReview()
85  {
86  $this->_rootElement->find($this->status, Locator::SELECTOR_CSS, 'select')->setValue('Approved');
87  }
88 }
fill(FixtureInterface $fixture, SimpleElement $element=null)
Definition: ReviewForm.php:47
$element
Definition: element.phtml:12