作者:aies
项目:magento
/**
* Assert that deleted attribute can't be added to product template on Product Page via Add Attribute control
*
* @param CatalogProductAttribute $productAttribute
* @param CatalogProductIndex $productGrid
* @param CatalogProductNew $newProductPage
* @param CatalogProductEdit $productEdit
* @return void
*/
public function processAssert(CatalogProductAttribute $productAttribute, CatalogProductIndex $productGrid, CatalogProductEdit $productEdit, CatalogProductNew $newProductPage)
{
$productGrid->open();
$productGrid->getGridPageActionBlock()->addProduct('simple');
$productEdit->getForm()->openVariationsTab();
\PHPUnit_Framework_Assert::assertFalse($newProductPage->getForm()->checkAttributeInVariationsSearchAttributeForm($productAttribute), "Product attribute found in Attribute Search form.");
}
作者:Doabilit
项目:magento2de
/**
* Assert that deleted attribute can't be added to attribute set on Product Page via Add Attribute control.
*
* @param CatalogProductAttribute $productAttribute
* @param CatalogProductIndex $productGrid
* @param CatalogProductNew $newProductPage
* @return void
*/
public function processAssert(CatalogProductAttribute $productAttribute, CatalogProductIndex $productGrid, CatalogProductNew $newProductPage)
{
$productGrid->open();
$productGrid->getGridPageActionBlock()->addProduct('simple');
$newProductPage->getFormPageActions()->addNewAttribute();
$filter = ['label' => $productAttribute->getFrontendLabel()];
\PHPUnit_Framework_Assert::assertFalse($newProductPage->getProductForm()->getAttributesSearchGrid()->isRowVisible($filter), 'Attribute \'' . $productAttribute->getFrontendLabel() . '\' is found in Attributes grid.');
}
作者:Doabilit
项目:magento2de
/**
* Assert that customer group not on product page.
*
* @param CatalogProductIndex $catalogProductIndex
* @param CatalogProductNew $catalogProductNew
* @param CustomerGroup $customerGroup
* @return void
*/
public function processAssert(CatalogProductIndex $catalogProductIndex, CatalogProductNew $catalogProductNew, CustomerGroup $customerGroup)
{
$catalogProductIndex->open();
$catalogProductIndex->getGridPageActionBlock()->addProduct();
$catalogProductNew->getProductForm()->openSection('advanced-pricing');
/** @var AdvancedPricing $advancedPricingTab */
$advancedPricingTab = $catalogProductNew->getProductForm()->getSection('advanced-pricing');
\PHPUnit_Framework_Assert::assertFalse($advancedPricingTab->getTierPriceForm()->isVisibleCustomerGroup($customerGroup), "Customer group {$customerGroup->getCustomerGroupCode()} is still in tier price form on product page.");
}
作者:buskamuz
项目:magento2-skeleto
/**
* Assert check whether the attribute is used to create a configurable products
*
* @param CatalogProductAttribute $productAttribute
* @param CatalogProductAttribute $attribute
* @param CatalogProductIndex $productGrid
* @param FixtureFactory $fixtureFactory
* @param CatalogProductNew $newProductPage
*/
public function processAssert(CatalogProductAttribute $attribute, CatalogProductIndex $productGrid, FixtureFactory $fixtureFactory, CatalogProductNew $newProductPage, CatalogProductAttribute $productAttribute = null)
{
$this->attribute = !is_null($productAttribute) ? $productAttribute : $attribute;
$productGrid->open();
$productGrid->getGridPageActionBlock()->addProduct('configurable');
$productConfigurable = $fixtureFactory->createByCode('catalogProductConfigurable', ['dataSet' => 'default', 'data' => ['configurable_attributes_data' => ['preset' => 'one_variation', 'attributes' => [$this->attribute]]]]);
$productBlockForm = $newProductPage->getProductForm();
$productBlockForm->fill($productConfigurable);
\PHPUnit_Framework_Assert::assertTrue($productBlockForm->checkAttributeInSearchAttributeForm($this->attribute), "Product attribute is absent on the product page.");
}
作者:whoopl
项目:magento2-testin
/**
* Assert that deleted attribute can't be added to product template on Product Page via Add Attribute control
*
* @param CatalogProductAttribute $productAttribute
* @param CatalogProductIndex $productGrid
* @param CatalogProductNew $newProductPage
* @return void
*/
public function processAssert(CatalogProductAttribute $productAttribute, CatalogProductIndex $productGrid, CatalogProductNew $newProductPage)
{
$productGrid->open();
$productGrid->getGridPageActionBlock()->addProduct('simple');
/** @var VariationsTab $variationsTab */
$variationsTab = $newProductPage->getProductForm()->getTab(self::TAB_VARIATIONS);
$variationsTab->showContent();
/** @var AttributeBlock $attributesBlock */
$attributesBlock = $variationsTab->getAttributeBlock();
\PHPUnit_Framework_Assert::assertFalse($attributesBlock->getAttributeSelector()->isExistAttributeInSearchResult($productAttribute), "Product attribute found in Attribute Search form.");
}
作者:whoopl
项目:magento2-testin
/**
* Assert check whether the attribute is used to create a configurable products.
*
* @param CatalogProductAttribute $attribute
* @param CatalogProductIndex $productGrid
* @param CatalogProductNew $newProductPage
*/
public function processAssert(CatalogProductAttribute $attribute, CatalogProductIndex $productGrid, CatalogProductNew $newProductPage)
{
$productGrid->open();
$productGrid->getGridPageActionBlock()->addProduct('configurable');
$productBlockForm = $newProductPage->getProductForm();
$productBlockForm->openTab('variations');
/** @var TabVariation $tabVariation */
$tabVariation = $productBlockForm->getTab('variations');
$configurableAttributeSelector = $tabVariation->getAttributeBlock()->getAttributeSelector();
\PHPUnit_Framework_Assert::assertTrue($configurableAttributeSelector->isExistAttributeInSearchResult($attribute), "Product attribute is absent on the product page.");
}
作者:Doabilit
项目:magento2de
/**
* Assert that deleted attribute can't be added to attribute set on Product Page via Add Attribute control.
*
* @param CatalogProductAttribute $productAttribute
* @param ConfigurableProduct $assertProduct
* @param CatalogProductIndex $productGrid
* @param CatalogProductNew $newProductPage
* @return void
*/
public function processAssert(CatalogProductAttribute $productAttribute, ConfigurableProduct $assertProduct, CatalogProductIndex $productGrid, CatalogProductNew $newProductPage)
{
$productGrid->open();
$productGrid->getGridPageActionBlock()->addProduct('simple');
/** @var VariationsTab $variationsTab */
$newProductPage->getProductForm()->fill($assertProduct);
$variationsTab = $newProductPage->getProductForm()->getSection(self::TAB_VARIATIONS);
$variationsTab->createConfigurations();
$attributesGrid = $variationsTab->getAttributeBlock()->getAttributesGrid();
\PHPUnit_Framework_Assert::assertFalse($attributesGrid->isRowVisible(['frontend_label' => $productAttribute->getFrontendLabel()]), "Product attribute found in Attribute Search form.");
}
作者:koliaG
项目:magento
/**
* Run create product simple entity test.
*
* @param CatalogProductSimple $product
* @param Category $category
* @param CatalogProductIndex $productGrid
* @param CatalogProductNew $newProductPage
* @param string $configData
* @return array
*/
public function testCreate(CatalogProductSimple $product, Category $category, CatalogProductIndex $productGrid, CatalogProductNew $newProductPage, $configData = null)
{
$this->configData = $configData;
// Preconditions
$this->objectManager->create('Magento\\Config\\Test\\TestStep\\SetupConfigurationStep', ['configData' => $this->configData])->run();
// Steps
$productGrid->open();
$productGrid->getGridPageActionBlock()->addProduct('simple');
$newProductPage->getProductForm()->fill($product, null, $category);
$newProductPage->getFormPageActions()->save();
return ['product' => $product];
}
作者:niranjanssie
项目:magento
/**
* 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 CatalogProductIndex $productGrid
* @param CatalogAttributeSet $attributeSet
* @param CatalogProductNew $newProductPage
* @param CatalogProductAttribute $productAttributeOriginal
* @return void
*/
public function processAssert(FixtureFactory $fixtureFactory, CatalogProductEdit $productEdit, CatalogProductIndex $productGrid, CatalogAttributeSet $attributeSet, CatalogProductNew $newProductPage, CatalogProductAttribute $productAttributeOriginal)
{
$productGrid->open();
$productGrid->getGridPageActionBlock()->addProduct('simple');
$productBlockForm = $newProductPage->getProductForm();
/**@var CatalogProductSimple $catalogProductSimple */
$productSimple = $fixtureFactory->createByCode('catalogProductSimple', ['dataSet' => 'default', 'data' => ['attribute_set_id' => ['attribute_set' => $attributeSet]]]);
$productBlockForm->fill($productSimple);
\PHPUnit_Framework_Assert::assertTrue($productEdit->getProductForm()->isCustomTabVisible($attributeSet->getGroup()), "Product Group is absent on Product form tabs.");
$productEdit->getProductForm()->openCustomTab($attributeSet->getGroup());
\PHPUnit_Framework_Assert::assertTrue($productEdit->getProductForm()->checkAttributeLabel($productAttributeOriginal), "Product Attribute is absent on Product form.");
}
作者:kidaa3
项目:magento2-platforms
/**
* Assert check whether the attribute is used to create a configurable products.
*
* @param CatalogProductAttribute $attribute
* @param ConfigurableProduct $assertProduct
* @param CatalogProductIndex $productGrid
* @param CatalogProductNew $newProductPage
*/
public function processAssert(CatalogProductAttribute $attribute, ConfigurableProduct $assertProduct, CatalogProductIndex $productGrid, CatalogProductNew $newProductPage)
{
$productGrid->open();
$productGrid->getGridPageActionBlock()->addProduct('configurable');
$productBlockForm = $newProductPage->getProductForm();
$productBlockForm->fill($assertProduct);
$productBlockForm->openTab('variations');
/** @var \Magento\ConfigurableProduct\Test\Block\Adminhtml\Product\Edit\Tab\Variations\Config $variationsTab */
$variationsTab = $productBlockForm->getTab('variations');
$variationsTab->createConfigurations();
$attributesGrid = $variationsTab->getAttributeBlock()->getAttributesGrid();
\PHPUnit_Framework_Assert::assertTrue($attributesGrid->isRowVisible(['frontend_label' => $attribute->getFrontendLabel()]), "Product attribute is absent on the product page.");
}
作者:Atli
项目:docker-magento
/**
* 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 CatalogProductIndex $productGrid
* @param CatalogAttributeSet $attributeSet
* @param CatalogProductNew $newProductPage
* @param CatalogProductAttribute $productAttribute
* @return void
*/
public function processAssert(FixtureFactory $fixtureFactory, CatalogProductEdit $productEdit, CatalogProductIndex $productGrid, CatalogAttributeSet $attributeSet, CatalogProductNew $newProductPage, CatalogProductAttribute $productAttribute)
{
$productGrid->open();
$productGrid->getProductBlock()->addProduct('simple');
$productBlockForm = $newProductPage->getForm();
/**@var CatalogProductSimple $catalogProductSimple */
$productSimple = $fixtureFactory->createByCode('catalogProductSimple', ['dataSet' => 'default', 'data' => ['attribute_set_id' => ['attribute_set' => $attributeSet]]]);
$productBlockForm->fillProduct($productSimple);
$newProductPage->getFormAction()->save();
$formData = $productEdit->getForm()->getData($productSimple);
$formAttributeSet = $formData['attribute_set_id'];
\PHPUnit_Framework_Assert::assertEquals($attributeSet->getAttributeSetName(), $formAttributeSet, 'Attribute Set not found on Product form.' . "\nExpected: " . $attributeSet->getAttributeSetName() . "\nActual: " . $formAttributeSet);
$productEdit->getForm()->openTab('product-details');
\PHPUnit_Framework_Assert::assertTrue($productEdit->getForm()->checkAttributeLabel($productAttribute), "Product Attribute is absent on Product form.");
}
作者:pradeep-wagent
项目:magento
/**
* Test create catalog Configurable product run
*
* @param ConfigurableProduct $product
* @return void
*/
public function test(ConfigurableProduct $product)
{
// Steps
$this->productIndex->open();
$this->productIndex->getGridPageActionBlock()->addProduct('configurable');
$this->productNew->getProductForm()->fill($product);
$this->productNew->getFormPageActions()->save($product);
}
作者:Doabilit
项目:magento2de
/**
* Test create bundle product
*
* @param BundleProduct $product
* @param Category $category
* @return void
*/
public function test(BundleProduct $product, Category $category)
{
$this->catalogProductIndex->open();
$this->catalogProductIndex->getGridPageActionBlock()->addProduct('bundle');
$productBlockForm = $this->catalogProductNew->getProductForm();
$productBlockForm->fill($product, null, $category);
$this->catalogProductNew->getFormPageActions()->save();
}
作者:nja7
项目:magento
/**
* Test create catalog Configurable product run
*
* @param ConfigurableProduct $product
* @return void
*/
public function test(ConfigurableProduct $product)
{
$this->markTestIncomplete('MAGETWO-40002');
// Steps
$this->productIndex->open();
$this->productIndex->getGridPageActionBlock()->addProduct('configurable');
$this->productNew->getProductForm()->fill($product);
$this->productNew->getFormPageActions()->save($product);
}
作者:opexs
项目:magento
/**
* Run product type switching on creation test
*
* @param string $createProduct
* @param string $product
* @return array
*/
public function test($createProduct, $product)
{
// Steps
$this->catalogProductIndex->open();
$this->catalogProductIndex->getGridPageActionBlock()->addProduct($createProduct);
list($fixture, $dataSet) = explode('::', $product);
$product = $this->fixtureFactory->createByCode($fixture, ['dataSet' => $dataSet]);
$this->catalogProductNew->getProductForm()->fill($product);
$this->catalogProductNew->getFormPageActions()->save($product);
return ['product' => $product];
}
作者:opexs
项目:magento
/**
* Test create grouped product
*
* @param GroupedProduct $product
* @param Category $category
* @return void
*/
public function test(GroupedProduct $product, Category $category)
{
//Steps
$this->catalogProductIndex->open();
$this->catalogProductIndex->getGridPageActionBlock()->addProduct('grouped');
$this->catalogProductNew->getProductForm()->fill($product, null, $category);
$this->catalogProductNew->getFormPageActions()->save();
}
作者:zhangjiacha
项目:magento
/**
* Test create downloadable product
*
* @param DownloadableProductInjectable $product
* @param CatalogCategory $category
* @return void
*/
public function testCreateDownloadableProduct(DownloadableProductInjectable $product, CatalogCategory $category)
{
$this->catalogProductIndex->open();
$this->catalogProductIndex->getGridPageActionBlock()->addProduct('downloadable');
$productBlockForm = $this->catalogProductNew->getProductForm();
$productBlockForm->fill($product, null, $category);
$this->catalogProductNew->getFormPageActions()->save();
}
作者:koliaG
项目:magento
/**
* Run create product virtual entity test
*
* @param CatalogProductVirtual $product
* @param Category $category
* @return void
*/
public function testCreate(CatalogProductVirtual $product, Category $category)
{
// Steps
$this->productGrid->open();
$this->productGrid->getGridPageActionBlock()->addProduct('virtual');
$this->newProductPage->getProductForm()->fill($product, null, $category);
$this->newProductPage->getFormPageActions()->save();
}
作者:Atli
项目:docker-magento
/**
* Test create downloadable product
*
* @param CatalogProductDownloadable $product
* @param CatalogCategory $category
*/
public function testCreateDownloadableProduct(CatalogProductDownloadable $product, CatalogCategory $category)
{
$this->catalogProductIndex->open();
$this->catalogProductIndex->getProductBlock()->addProduct('downloadable');
$productBlockForm = $this->catalogProductNew->getForm();
$productBlockForm->fillProduct($product, $category);
$this->catalogProductNew->getFormAction()->save();
}
作者:Doabilit
项目:magento2de
/**
* Run update product simple entity test.
*
* @param CatalogProductSimple $product
* @param string $configData
* @return array
*/
public function test(CatalogProductSimple $product, $configData = null)
{
$this->configData = $configData;
// Preconditions
$this->objectManager->create('Magento\\Config\\Test\\TestStep\\SetupConfigurationStep', ['configData' => $this->configData])->run();
// Steps
// * 1. Go to backend.
$this->productGrid->open();
// * 2. Open simple product page to create a new one.
$this->productGrid->getGridPageActionBlock()->addProduct('simple');
// * 3. Click "Add Video" in "Images and Videos" section.
// * 4. Fill fields regarding to Test Data.
// * 5. Click "Save" button on "Add Video" panel.
$this->newProductPage->getProductForm()->fill($product);
// * 6. Click "Save" button on product page.
$this->newProductPage->getFormPageActions()->save();
return ['product' => $product];
}