Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
AgreementReview.php
Go to the documentation of this file.
1 <?php
8 
11 use Magento\Mtf\Client\Locator;
12 
17 class AgreementReview extends Payment
18 {
24  protected $notification = 'div.mage-error';
25 
31  protected $agreement = '//label[.="%s"]';
32 
38  protected $agreementCheckbox = '//label[contains(., "%s")]//../input';
39 
45  public function getNotificationMassage()
46  {
47  return $this->_rootElement->find($this->notification)->getText();
48  }
49 
57  public function setAgreement($value, CheckoutAgreement $agreement)
58  {
59  $this->getSelectedPaymentMethodBlock()->_rootElement->find(
60  sprintf($this->agreementCheckbox, $agreement->getCheckboxText()),
61  Locator::SELECTOR_XPATH,
62  'checkbox'
63  )->setValue($value);
64  }
65 
72  public function checkAgreement(CheckoutAgreement $agreement)
73  {
74  return $this->_rootElement
75  ->find(sprintf($this->agreement, $agreement->getCheckboxText()), Locator::SELECTOR_XPATH)->isVisible();
76  }
77 }
$value
Definition: gender.phtml:16