9 use Magento\Mtf\TestCase\Injectable;
10 use Magento\Indexer\Test\Page\Adminhtml\IndexManagement;
11 use Magento\Catalog\Test\Page\Adminhtml\CatalogCategoryEdit;
13 use Magento\Mtf\Client\BrowserInterface;
15 use Magento\Mtf\Fixture\FixtureFactory;
38 private $indexManagement;
45 private $categoryEdit;
59 private $fixtureFactory;
79 IndexManagement $indexManagement,
80 CatalogCategoryEdit $categoryEdit,
81 BrowserInterface $browser,
82 FixtureFactory $fixtureFactory,
85 $this->indexManagement = $indexManagement;
86 $this->categoryEdit = $categoryEdit;
87 $this->browser = $browser;
88 $this->fixtureFactory = $fixtureFactory;
101 $this->indexManagement->open();
102 $this->indexManagement->getMainBlock()->massaction([],
'Update by Schedule',
false,
'Select All');
103 $initialCategory->persist();
104 $this->cache->flush();
106 $this->browser->open($_ENV[
'app_frontend_url'] . $initialCategory->getUrlKey() .
'.html');
107 $this->categoryEdit->open([
'id' => $initialCategory->getId()]);
108 $this->categoryEdit->getEditForm()->fill(
$category);
109 $this->categoryEdit->getFormPageActions()->save();
111 $products =
$category->getDataFieldConfig(
'category_products')[
'source']->getProducts();
113 'category' => $this->fixtureFactory->createByCode(
116 'data' => array_merge(
117 $initialCategory->getData(),
119 [
'category_products' => [
'products' =>
$products]]
133 $this->indexManagement->open();
134 $this->indexManagement->getMainBlock()->massaction([],
'Update on Save',
false,
'Select All');
__inject(IndexManagement $indexManagement, CatalogCategoryEdit $categoryEdit, BrowserInterface $browser, FixtureFactory $fixtureFactory, Cache $cache)
test(Category $initialCategory, Category $category)