Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
DeleteAllTaxRulesStep.php
Go to the documentation of this file.
1 <?php
8 
9 use Magento\Tax\Test\Page\Adminhtml\TaxRuleIndex;
10 use Magento\Tax\Test\Page\Adminhtml\TaxRuleNew;
11 use Magento\Mtf\TestStep\TestStepInterface;
12 
17 class DeleteAllTaxRulesStep implements TestStepInterface
18 {
24  protected $taxRuleIndexPage;
25 
31  protected $taxRuleNewPage;
32 
38  public function __construct(
39  TaxRuleIndex $taxRuleIndexPage,
40  TaxRuleNew $taxRuleNewPage
41  ) {
42  $this->taxRuleIndexPage = $taxRuleIndexPage;
43  $this->taxRuleNewPage = $taxRuleNewPage;
44  }
45 
51  public function run()
52  {
53  $this->taxRuleIndexPage->open();
54  $this->taxRuleIndexPage->getTaxRuleGrid()->resetFilter();
55  while ($this->taxRuleIndexPage->getTaxRuleGrid()->isFirstRowVisible()) {
56  $this->taxRuleIndexPage->getTaxRuleGrid()->openFirstRow();
57  $this->taxRuleNewPage->getFormPageActions()->delete();
58  $this->taxRuleNewPage->getModalBlock()->acceptAlert();
59  }
60  }
61 }
__construct(TaxRuleIndex $taxRuleIndexPage, TaxRuleNew $taxRuleNewPage)