Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
DeleteStoreGroupEntityTest.php
Go to the documentation of this file.
1 <?php
8 
9 use Magento\Backend\Test\Page\Adminhtml\DeleteGroup;
10 use Magento\Backend\Test\Page\Adminhtml\EditGroup;
11 use Magento\Backend\Test\Page\Adminhtml\StoreIndex;
12 use Magento\Backup\Test\Page\Adminhtml\BackupIndex;
14 use Magento\Mtf\TestCase\Injectable;
16 
38 class DeleteStoreGroupEntityTest extends Injectable
39 {
40  /* tags */
41  const MVP = 'yes';
42  const SEVERITY = 'S3';
43  /* end tags */
44 
50  protected $storeIndex;
51 
57  protected $editGroup;
58 
64  protected $deleteGroup;
65 
71  protected $backupIndex;
72 
82  public function __inject(
83  StoreIndex $storeIndex,
84  EditGroup $editGroup,
85  DeleteGroup $deleteGroup,
86  BackupIndex $backupIndex
87  ) {
88  $this->storeIndex = $storeIndex;
89  $this->editGroup = $editGroup;
90  $this->deleteGroup = $deleteGroup;
91  $this->backupIndex = $backupIndex;
92  }
93 
101  public function test(StoreGroup $storeGroup, $createBackup)
102  {
103  //Preconditions
104  $storeGroup->persist();
106  $enableBackupsStep = $this->objectManager->create(
107  SetupConfigurationStep::class,
108  ['configData' => 'enable_backups_functionality']
109  );
110  $enableBackupsStep->run();
111  $this->backupIndex->open()
112  ->getBackupGrid()
113  ->massaction([], 'Delete', true, 'Select All');
114 
115  //Steps
116  $this->storeIndex->open();
117  $this->storeIndex->getStoreGrid()->searchAndOpenStoreGroup($storeGroup);
118  $this->editGroup->getFormPageActions()->delete();
119  $this->deleteGroup->getDeleteGroupForm()->fillForm(['create_backup' => $createBackup]);
120  $this->deleteGroup->getFormPageActions()->delete();
121  }
122 }
__inject(StoreIndex $storeIndex, EditGroup $editGroup, DeleteGroup $deleteGroup, BackupIndex $backupIndex)