/**
  * Assert that created product template:
  * 1. Displays in product template suggest container dropdown
  * 2. Can be used for new created product.
  *
  * @param FixtureFactory $fixtureFactory
  * @param CatalogProductEdit $productEdit
  * @param CatalogProduct $productGrid
  * @param CatalogAttributeSet $attributeSet
  * @param CatalogAttributeSet $attributeSetOriginal
  * @param CatalogProductNew $newProductPage
  * @param CatalogProductAttribute $productAttribute
  * @return void
  */
 public function processAssert(FixtureFactory $fixtureFactory, CatalogProductEdit $productEdit, CatalogProduct $productGrid, CatalogAttributeSet $attributeSet, CatalogProductNew $newProductPage, CatalogProductAttribute $productAttribute, CatalogAttributeSet $attributeSetOriginal = null)
 {
     $productGrid->open();
     $productGrid->getGridPageActionBlock()->addNew();
     /**@var CatalogProductSimple $productSimple */
     $productSimple = $fixtureFactory->createByCode('catalogProductSimple', ['dataSet' => 'default', 'data' => ['attribute_set_id' => ['attribute_set' => $attributeSet]]]);
     $newProductPage->getProductForm()->fill($productSimple);
     $newProductPage->getFormPageActions()->saveAndContinue();
     $attributeSetName = $attributeSet->getAttributeSetName();
     \PHPUnit_Framework_Assert::assertTrue($productEdit->getProductForm()->checkAttributeSet($attributeSetName), "Product isn't in '{$attributeSetName}' Attribute Set.");
     if ($attributeSetOriginal === null) {
         $productEdit->getProductForm()->openTab('general');
         \PHPUnit_Framework_Assert::assertTrue($productEdit->getProductForm()->checkAttributeLabel($productAttribute), "Product Attribute is absent on Product form.");
     }
 }
 /**
  * Create and save product.
  *
  * @param InjectableFixture $product
  * @return void
  */
 protected function createAndSaveProduct(InjectableFixture $product)
 {
     $this->catalogProductIndex->open();
     $this->catalogProductIndex->getGridPageActionBlock()->addNew();
     $this->catalogProductNew->getProductForm()->fill($product);
     $this->catalogProductNew->getFormPageActions()->save();
 }
 /**
  * Create Gift Card product entity.
  *
  * @param GiftCardProduct $product
  * @param CatalogCategory $category
  * @return void
  */
 public function test(GiftCardProduct $product, CatalogCategory $category)
 {
     $this->catalogProductIndex->open();
     $this->catalogProductIndex->getGridPageActionBlock()->addNew();
     $this->catalogProductNew->getProductForm()->fill($product, null, $category);
     $this->catalogProductNew->getFormPageActions()->save();
 }
 /**
  * Run create product virtual entity test.
  *
  * @param CatalogProductVirtual $product
  * @param CatalogCategory $category
  * @return void
  */
 public function test(CatalogProductVirtual $product, CatalogCategory $category)
 {
     // Steps
     $this->productGrid->open();
     $this->productGrid->getGridPageActionBlock()->addNew();
     $this->newProductPage->getProductForm()->fill($product, null, $category);
     $this->newProductPage->getFormPageActions()->save();
 }
 /**
  * Test create catalog Configurable product run.
  *
  * @param ConfigurableProduct $product
  * @param CatalogCategory $category
  * @return array
  */
 public function test(ConfigurableProduct $product, CatalogCategory $category)
 {
     // Steps
     $this->productIndex->open();
     $this->productIndex->getGridPageActionBlock()->addNew();
     $this->productNew->getProductForm()->fill($product, null, $category);
     $this->productNew->getFormPageActions()->save();
 }
 /**
  * Run create product simple entity test.
  *
  * @param CatalogProductSimple $product
  * @param CatalogCategory $category
  * @param string $configData
  * @return void
  */
 public function test(CatalogProductSimple $product, CatalogCategory $category, $configData)
 {
     // Preconditions
     $this->objectManager->create('Mage\\Core\\Test\\TestStep\\SetupConfigurationStep', ['configData' => $configData])->run();
     // Steps
     $this->productGrid->open();
     $this->productGrid->getGridPageActionBlock()->addNew();
     $this->newProductPage->getProductForm()->fill($product, null, $category);
     $this->newProductPage->getFormPageActions()->save();
 }
 /**
  * Assert that special price can't be larger, than actual.
  *
  * @param CatalogProductNew $productPage
  * @param InjectableFixture $product
  * @return void
  */
 public function processAssert(CatalogProductNew $productPage, InjectableFixture $product)
 {
     $errorMessages = $productPage->getProductForm()->getRequireNoticeAttributes($product);
     \PHPUnit_Framework_Assert::assertEquals(self::ERROR_MESSAGE, $errorMessages['special_price']);
 }