Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
DeleteCustomVariableEntityTest.php
Go to the documentation of this file.
1 <?php
8 
9 use Magento\Variable\Test\Fixture\SystemVariable;
10 use Magento\Variable\Test\Page\Adminhtml\SystemVariableIndex;
11 use Magento\Variable\Test\Page\Adminhtml\SystemVariableNew;
12 use Magento\Mtf\TestCase\Injectable;
13 
28 class DeleteCustomVariableEntityTest extends Injectable
29 {
30  /* tags */
31  const MVP = 'yes';
32  /* end tags */
33 
40 
47 
55  public function __inject(
56  SystemVariableIndex $systemVariableIndex,
57  SystemVariableNew $systemVariableNew
58  ) {
59  $this->systemVariableIndexPage = $systemVariableIndex;
60  $this->systemVariableNewPage = $systemVariableNew;
61  }
62 
69  public function test(SystemVariable $systemVariable)
70  {
71  // Precondition
72  $systemVariable->persist();
73 
74  // Steps
75  $filter = [
76  'code' => $systemVariable->getCode(),
77  'name' => $systemVariable->getName(),
78  ];
79  $this->systemVariableIndexPage->open();
80  $this->systemVariableIndexPage->getSystemVariableGrid()->searchAndOpen($filter);
81  $this->systemVariableNewPage->getFormPageActions()->delete();
82  $this->systemVariableNewPage->getModalBlock()->acceptAlert();
83  }
84 }
__inject(SystemVariableIndex $systemVariableIndex, SystemVariableNew $systemVariableNew)