Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
DiscountCodes.php
Go to the documentation of this file.
1 <?php
8 
9 use Magento\Mtf\Block\Form;
10 use Magento\Mtf\Client\Locator;
11 
16 class DiscountCodes extends Form
17 {
23  protected $formWrapper = '.content';
24 
30  protected $openForm = '.payment-option-title';
31 
37  protected $couponCode = '#discount-code';
38 
44  protected $applyButton = '.action.action-apply';
45 
52  public function applyCouponCode($code)
53  {
54  $this->_rootElement->find($this->openForm, Locator::SELECTOR_CSS)->click();
55  $this->_rootElement->find($this->couponCode, Locator::SELECTOR_CSS)->setValue($code);
56  $this->_rootElement->find($this->applyButton, Locator::SELECTOR_CSS)->click();
57  }
58 }
$code
Definition: info.phtml:12