9 use Magento\Mtf\Fixture\FixtureFactory;
10 use Magento\Mtf\Fixture\FixtureInterface;
11 use Magento\Mtf\TestCase\Injectable;
13 use Magento\Catalog\Test\Page\Adminhtml\CatalogProductIndex;
14 use Magento\Catalog\Test\Page\Adminhtml\CatalogProductActionAttributeEdit;
15 use Magento\Mtf\TestStep\TestStepFactory;
69 private $testStepFactory;
76 private $fixtureFactory;
90 TestStepFactory $testStepFactory,
91 FixtureFactory $fixtureFactory
95 $this->testStepFactory = $testStepFactory;
96 $this->fixtureFactory = $fixtureFactory;
112 $products = $this->testStepFactory->create(
113 \
Magento\Catalog\Test\TestStep\CreateProductsStep::class,
114 [
'products' => $initialProducts]
115 )->run()[
'products'];
117 $this->objectManager->create(
123 $this->productGrid->open();
124 $this->productGrid->getProductGrid()->updateAttributes(
$products);
125 $this->attributeMassActionPage->getAttributesBlockForm()->fill(
$product);
126 $this->attributeMassActionPage->getFormPageActions()->save();
129 return [
'products' => $updatedProducts];
139 private function prepareUpdatedProducts(array
$products, CatalogProductSimple
$product)
141 $productsReturn = [];
144 $productsReturn[] = $this->fixtureFactory->create(
146 [
'data' => array_merge(
$item->getData(),
$product->getData())]
150 return $productsReturn;
160 $this->objectManager->create(
162 [
'configData' => $this->configData,
'rollback' =>
true]
__inject(CatalogProductIndex $productGrid, CatalogProductActionAttributeEdit $attributeMassActionPage, TestStepFactory $testStepFactory, FixtureFactory $fixtureFactory)
test(CatalogProductSimple $product, $configData, array $initialProducts)