9 use Magento\Catalog\Test\Page\Adminhtml\CatalogCategoryIndex;
10 use Magento\Catalog\Test\Page\Adminhtml\CatalogCategoryEdit;
12 use Magento\Mtf\TestCase\Injectable;
42 private $catalogCategoryIndex;
49 private $catalogCategoryEdit;
59 CatalogCategoryIndex $catalogCategoryIndex,
60 CatalogCategoryEdit $catalogCategoryEdit
62 $this->catalogCategoryIndex = $catalogCategoryIndex;
63 $this->catalogCategoryEdit = $catalogCategoryEdit;
75 public function test(Store $storeView, Category $childCategory, Category $parentCategory, Category $categoryUpdates)
78 $storeView->persist();
79 $parentCategory->persist();
80 $childCategory->persist();
83 $this->catalogCategoryIndex->open();
84 $this->catalogCategoryIndex->getTreeCategories()->selectCategory($childCategory);
85 $this->catalogCategoryEdit->getFormPageActions()->selectStoreView($storeView->getName());
86 $this->catalogCategoryEdit->getEditForm()->fill($categoryUpdates);
87 $this->catalogCategoryEdit->getFormPageActions()->save();
88 $this->catalogCategoryIndex->getTreeCategories()->assignCategory(
89 $parentCategory->getName(),
90 $childCategory->getName()
92 if ($this->catalogCategoryEdit->getModalBlock()->isVisible()) {
93 $this->catalogCategoryEdit->getModalBlock()->acceptWarning();
97 'storeView' => $storeView,
98 'childCategory' => $childCategory,
99 'parentCategory' => $parentCategory
__inject(CatalogCategoryIndex $catalogCategoryIndex, CatalogCategoryEdit $catalogCategoryEdit)
test(Store $storeView, Category $childCategory, Category $parentCategory, Category $categoryUpdates)