Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
DeleteAllSalesRuleStep.php
Go to the documentation of this file.
1 <?php
8 
9 use Magento\SalesRule\Test\Page\Adminhtml\PromoQuoteEdit;
10 use Magento\SalesRule\Test\Page\Adminhtml\PromoQuoteIndex;
11 use Magento\Mtf\TestStep\TestStepInterface;
12 
16 class DeleteAllSalesRuleStep implements TestStepInterface
17 {
23  protected $promoQuoteIndex;
24 
30  protected $promoQuoteEdit;
31 
37  public function __construct(
38  PromoQuoteIndex $promoQuoteIndex,
39  PromoQuoteEdit $promoQuoteEdit
40  ) {
41  $this->promoQuoteIndex = $promoQuoteIndex;
42  $this->promoQuoteEdit = $promoQuoteEdit;
43  }
44 
50  public function run()
51  {
52  $this->promoQuoteIndex->open();
53  $this->promoQuoteIndex->getPromoQuoteGrid()->resetFilter();
54  while ($this->promoQuoteIndex->getPromoQuoteGrid()->isFirstRowVisible()) {
55  $this->promoQuoteIndex->getPromoQuoteGrid()->openFirstRow();
56  $this->promoQuoteEdit->getFormPageActions()->delete();
57  $this->promoQuoteEdit->getModalBlock()->acceptAlert();
58  $this->promoQuoteIndex->getSystemMessageDialog()->closePopup();
59  }
60  }
61 }
__construct(PromoQuoteIndex $promoQuoteIndex, PromoQuoteEdit $promoQuoteEdit)