Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
CreateGroupedProductEntityTest.php
Go to the documentation of this file.
1 <?php
8 
10 use Magento\Catalog\Test\Page\Adminhtml\CatalogProductIndex;
11 use Magento\Catalog\Test\Page\Adminhtml\CatalogProductNew;
13 use Magento\Mtf\TestCase\Injectable;
14 
35 class CreateGroupedProductEntityTest extends Injectable
36 {
37  /* tags */
38  const TEST_TYPE = 'acceptance_test, extended_acceptance_test';
39  const MVP = 'no';
40  /* end tags */
41 
48 
54  protected $catalogProductNew;
55 
62  public function __prepare(Category $category)
63  {
64  $category->persist();
65  return ['category' => $category];
66  }
67 
75  public function __inject(
76  CatalogProductIndex $catalogProductIndexNewPage,
77  CatalogProductNew $catalogProductNewPage
78  ) {
79  $this->catalogProductIndex = $catalogProductIndexNewPage;
80  $this->catalogProductNew = $catalogProductNewPage;
81  }
82 
90  public function test(GroupedProduct $product, Category $category)
91  {
92  //Steps
93  $this->catalogProductIndex->open();
94  $this->catalogProductIndex->getGridPageActionBlock()->addProduct('grouped');
95  $this->catalogProductNew->getProductForm()->fill($product, null, $category);
96  $this->catalogProductNew->getFormPageActions()->save();
97  }
98 }
__inject(CatalogProductIndex $catalogProductIndexNewPage, CatalogProductNew $catalogProductNewPage)