Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
DeleteTaxRuleEntityTest.php
Go to the documentation of this file.
1 <?php
8 
10 use Magento\Tax\Test\Page\Adminhtml\TaxRuleIndex;
11 use Magento\Tax\Test\Page\Adminhtml\TaxRuleNew;
13 use Magento\Mtf\TestCase\Injectable;
14 
29 class DeleteTaxRuleEntityTest extends Injectable
30 {
31  /* tags */
32  const MVP = 'yes';
33  /* end tags */
34 
40  protected $taxRuleIndexPage;
41 
47  protected $taxRuleNewPage;
48 
55  public function __prepare(Customer $customer)
56  {
57  $customer->persist();
58 
59  return ['customer' => $customer];
60  }
61 
68  public function __inject(
69  TaxRuleIndex $taxRuleIndexPage,
70  TaxRuleNew $taxRuleNewPage
71  ) {
72  $this->taxRuleIndexPage = $taxRuleIndexPage;
73  $this->taxRuleNewPage = $taxRuleNewPage;
74  }
75 
82  public function testDeleteTaxRule(TaxRule $taxRule)
83  {
84  // Precondition
85  $taxRule->persist();
86 
87  // Steps
88  $this->taxRuleIndexPage->open();
89  $this->taxRuleIndexPage->getTaxRuleGrid()->searchAndOpen(['code' => $taxRule->getCode()]);
90  $this->taxRuleNewPage->getFormPageActions()->delete();
91  $this->taxRuleNewPage->getModalBlock()->acceptAlert();
92  }
93 }
$customer
Definition: customers.php:11
__inject(TaxRuleIndex $taxRuleIndexPage, TaxRuleNew $taxRuleNewPage)
$taxRule
Definition: tax_rule.php:35