Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
UpdateGroupedProductEntityTest.php
Go to the documentation of this file.
1 <?php
8 
9 use Magento\Catalog\Test\Page\Adminhtml\CatalogProductEdit;
10 use Magento\Catalog\Test\Page\Adminhtml\CatalogProductIndex;
12 use Magento\Mtf\TestCase\Injectable;
13 
29 class UpdateGroupedProductEntityTest extends Injectable
30 {
31  /* tags */
32  const MVP = 'no';
33  /* end tags */
34 
41 
48 
56  public function __inject(
57  CatalogProductIndex $catalogProductIndexNewPage,
58  CatalogProductEdit $catalogProductEditPage
59  ) {
60  $this->catalogProductIndex = $catalogProductIndexNewPage;
61  $this->catalogProductEdit = $catalogProductEditPage;
62  }
63 
71  public function test(GroupedProduct $product, GroupedProduct $originalProduct)
72  {
73  // Precondition
74  $originalProduct->persist();
75 
76  // Steps
77  $this->catalogProductIndex->open();
78  $this->catalogProductIndex->getProductGrid()->searchAndOpen(['sku' => $originalProduct->getSku()]);
79  $this->catalogProductEdit->getProductForm()->fill($product);
80  $this->catalogProductEdit->getFormPageActions()->save();
81  }
82 }
__inject(CatalogProductIndex $catalogProductIndexNewPage, CatalogProductEdit $catalogProductEditPage)
test(GroupedProduct $product, GroupedProduct $originalProduct)