Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
CreateSimpleProductEntityTest.php
Go to the documentation of this file.
1 <?php
8 
11 use Magento\Catalog\Test\Page\Adminhtml\CatalogProductIndex;
12 use Magento\Catalog\Test\Page\Adminhtml\CatalogProductNew;
13 use Magento\Mtf\TestCase\Injectable;
14 
27 class CreateSimpleProductEntityTest extends Injectable
28 {
29  /* tags */
30  const TEST_TYPE = 'acceptance_test, extended_acceptance_test';
31  const MVP = 'yes';
32  /* end tags */
33 
39  protected $configData;
40 
46  private $flushCache;
47 
54  public function __prepare(Category $category)
55  {
56  $category->persist();
57 
58  return [
59  'category' => $category
60  ];
61  }
62 
74  public function testCreate(
75  CatalogProductSimple $product,
76  Category $category,
77  CatalogProductIndex $productGrid,
78  CatalogProductNew $newProductPage,
79  $flushCache = false,
80  $configData = null
81  ) {
82  $this->markTestIncomplete('https://github.com/magento-engcom/msi/issues/1620');
83 
84  $this->configData = $configData;
85  $this->flushCache = $flushCache;
86 
87  // Preconditions
88  $this->objectManager->create(
89  \Magento\Config\Test\TestStep\SetupConfigurationStep::class,
90  ['configData' => $this->configData, 'flushCache' => $this->flushCache]
91  )->run();
92 
93  // Steps
94  $productGrid->open();
95  $productGrid->getGridPageActionBlock()->addProduct('simple');
96  $newProductPage->getProductForm()->fill($product, null, $category);
97  $newProductPage->getFormPageActions()->save();
98 
99  return ['product' => $product];
100  }
101 
107  public function tearDown()
108  {
109  $this->objectManager->create(
110  \Magento\Config\Test\TestStep\SetupConfigurationStep::class,
111  ['configData' => $this->configData, 'rollback' => true, 'flushCache' => $this->flushCache]
112  )->run();
113  }
114 }
testCreate(CatalogProductSimple $product, Category $category, CatalogProductIndex $productGrid, CatalogProductNew $newProductPage, $flushCache=false, $configData=null)