/**
  * Assert that after save a product template on edit product set page displays:
  * 1. Correct product template name in Attribute set name field passed from fixture
  * 2. Created Product Attribute (if was added)
  *
  * @param CatalogProductSetIndex $productSet
  * @param CatalogProductSetEdit $productSetEdit
  * @param CatalogAttributeSet $attributeSet
  * @param CatalogProductAttribute $productAttribute [optional]
  * @return void
  */
 public function processAssert(CatalogProductSetIndex $productSet, CatalogProductSetEdit $productSetEdit, CatalogAttributeSet $attributeSet, CatalogProductAttribute $productAttribute = null)
 {
     $filterAttribute = ['set_name' => $attributeSet->getAttributeSetName()];
     $productSet->open();
     $productSet->getGrid()->searchAndOpen($filterAttribute);
     \PHPUnit_Framework_Assert::assertEquals($filterAttribute['set_name'], $productSetEdit->getAttributeSetEditBlock()->getAttributeSetName());
     if ($productAttribute !== null) {
         $attributeLabel = $productAttribute->getFrontendLabel();
         \PHPUnit_Framework_Assert::assertTrue($productSetEdit->getAttributeSetEditBlock()->checkProductAttribute($attributeLabel), "Product Attribute '{$attributeLabel}' is absent on Product Template Groups.");
     }
 }
 /**
  * Run CreateAttributeSetEntity test.
  *
  * @param CatalogAttributeSet $attributeSet
  * @param CatalogProductAttribute $productAttribute
  * @return void
  */
 public function test(CatalogAttributeSet $attributeSet, CatalogProductAttribute $productAttribute)
 {
     // Precondition
     $productAttribute->persist();
     // Steps:
     $this->productSetIndex->open();
     $this->productSetIndex->getPageActionsBlock()->addNew();
     $this->productSetAdd->getAttributeSetForm()->fill($attributeSet);
     $this->productSetAdd->getPageActions()->save();
     $this->productSetEdit->getAttributeSetEditBlock()->moveAttribute($productAttribute->getData());
     $this->productSetEdit->getPageActions()->save();
 }