Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
DeleteAllTermsEntityStep.php
Go to the documentation of this file.
1 <?php
2 
9 
10 use Magento\CheckoutAgreements\Test\Page\Adminhtml\CheckoutAgreementIndex;
11 use Magento\CheckoutAgreements\Test\Page\Adminhtml\CheckoutAgreementNew;
12 use Magento\Mtf\TestStep\TestStepInterface;
13 
18 class DeleteAllTermsEntityStep implements TestStepInterface
19 {
25  protected $agreementIndex;
26 
32  protected $agreementNew;
33 
39  public function __construct(
40  CheckoutAgreementNew $agreementNew,
41  CheckoutAgreementIndex $agreementIndex
42  ) {
43  $this->agreementNew = $agreementNew;
44  $this->agreementIndex = $agreementIndex;
45  }
46 
52  public function run()
53  {
54  $this->agreementIndex->open();
55  $this->agreementIndex->getAgreementGridBlock()->resetFilter();
56  while ($this->agreementIndex->getAgreementGridBlock()->isFirstRowVisible()) {
57  $this->agreementIndex->getAgreementGridBlock()->openFirstRow();
58  $this->agreementNew->getPageActionsBlock()->delete();
59  $this->agreementNew->getModalBlock()->acceptAlert();
60  }
61  }
62 }
__construct(CheckoutAgreementNew $agreementNew, CheckoutAgreementIndex $agreementIndex)