Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
CatalogCategoryEdit.php
Go to the documentation of this file.
1 <?php
8 
10 use Magento\Mtf\Client\Locator;
11 use Magento\Mtf\Factory\Factory;
12 use Magento\Mtf\Page\Page;
13 
17 class CatalogCategoryEdit extends Page
18 {
22  const MCA = 'catalog/category/edit/id/';
23 
29  protected $formBlock = '//div[contains(@data-bind, "category_form")]';
30 
36  protected $treeBlock = '.categories-side-col';
37 
43  protected $messagesBlock = '#messages .messages';
44 
50  protected $templateBlock = './ancestor::body';
51 
57  protected $pageActionsBlock = '.page-main-actions';
58 
64  protected function initUrl()
65  {
66  $this->url = $_ENV['app_backend_url'] . self::MCA;
67  }
68 
77  public function open(array $params = [])
78  {
79  parent::open();
80  $this->getTemplateBlock()->waitLoader();
81  }
82 
88  public function getFormBlock()
89  {
90  return Factory::getBlockFactory()->getMagentoCatalogAdminhtmlCategoryEditCategoryForm(
91  $this->browser->find($this->formBlock, Locator::SELECTOR_CSS)
92  );
93  }
94 
100  public function getTreeBlock()
101  {
102  return Factory::getBlockFactory()->getMagentoCatalogAdminhtmlCategoryTree(
103  $this->browser->find($this->treeBlock, Locator::SELECTOR_CSS),
104  $this->getTemplateBlock()
105  );
106  }
107 
113  public function getMessagesBlock()
114  {
115  return Factory::getBlockFactory()->getMagentoBackendMessages(
116  $this->browser->find($this->messagesBlock, Locator::SELECTOR_CSS)
117  );
118  }
119 
125  public function getTemplateBlock()
126  {
127  return Factory::getBlockFactory()->getMagentoBackendTemplate(
128  $this->browser->find($this->templateBlock, Locator::SELECTOR_CSS)
129  );
130  }
131 
137  public function getPageActionsBlock()
138  {
139  return Factory::getBlockFactory()->getMagentoBackendFormPageActions(
140  $this->browser->find($this->pageActionsBlock)
141  );
142  }
143 }
$params[\Magento\Store\Model\StoreManager::PARAM_RUN_CODE]
Definition: website.php:18