Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
RadiobuttonElement.php
Go to the documentation of this file.
1 <?php
8 
9 use Magento\Mtf\Client\Locator;
10 
14 class RadiobuttonElement extends SimpleElement
15 {
21  protected $labelSelector = './..//label[contains(., "%s")]';
22 
28  protected $selectedLabelSelector = 'input[type=radio]:checked + label';
29 
35  public function getValue()
36  {
37  $this->eventManager->dispatchEvent(['get_value'], [$this->getAbsoluteSelector()]);
38 
39  return $this->find($this->selectedLabelSelector)->getText();
40  }
41 
48  public function setValue($value)
49  {
50  $this->eventManager->dispatchEvent(['set_value'], [__METHOD__, $this->getAbsoluteSelector()]);
51 
52  $radioButtonLabel = $this->find(sprintf($this->labelSelector, $value), Locator::SELECTOR_XPATH);
53  if (!$this->isSelected()) {
54  $radioButtonLabel->click();
55  }
56  }
57 }
taxRateField find('.mselect-list') .on( 'click.mselect-edit'
Definition: edit.phtml:162
$value
Definition: gender.phtml:16