本文整理汇总了PHP中Magento\Catalog\Test\Page\Adminhtml\CatalogProductIndex::open方法的典型用法代码示例。如果您正苦于以下问题:PHP CatalogProductIndex::open方法的具体用法?PHP CatalogProductIndex::open怎么用?PHP CatalogProductIndex::open使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Magento\Catalog\Test\Page\Adminhtml\CatalogProductIndex
的用法示例。
在下文中一共展示了CatalogProductIndex::open方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: test
/**
* 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();
}
示例2: test
/**
* 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);
}
示例3: testCreate
/**
* 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();
}
示例4: test
/**
* 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();
}
示例5: test
/**
* 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);
}
示例6: test
/**
* Test update grouped product.
*
* @param GroupedProduct $product
* @param GroupedProduct $originalProduct
* @return void
*/
public function test(GroupedProduct $product, GroupedProduct $originalProduct)
{
// Precondition
$originalProduct->persist();
// Steps
$this->catalogProductIndex->open();
$this->catalogProductIndex->getProductGrid()->searchAndOpen(['sku' => $originalProduct->getSku()]);
$this->catalogProductEdit->getProductForm()->fill($product);
$this->catalogProductEdit->getFormPageActions()->save();
}
示例7: test
/**
* 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];
}
示例8: test
/**
* Test update bundle product
*
* @param BundleProduct $product
* @param BundleProduct $originalProduct
* @return array
*/
public function test(BundleProduct $product, BundleProduct $originalProduct)
{
// Preconditions
$originalProduct->persist();
$originalCategory = $originalProduct->hasData('category_ids') ? $originalProduct->getDataFieldConfig('category_ids')['source']->getCategories() : null;
$category = $product->hasData('category_ids') ? $product->getDataFieldConfig('category_ids')['source']->getCategories() : $originalCategory;
// Steps
$filter = ['sku' => $originalProduct->getSku()];
$this->catalogProductIndex->open();
$this->catalogProductIndex->getProductGrid()->searchAndOpen($filter);
$this->catalogProductEdit->getProductForm()->fill($product);
$this->catalogProductEdit->getFormPageActions()->save();
return ['category' => $category];
}
示例9: test
/**
* Run update product simple entity test
*
* @param CatalogProductSimple $initialProduct
* @param CatalogProductSimple $product
* @return array
*/
public function test(CatalogProductSimple $initialProduct, CatalogProductSimple $product)
{
// Preconditions
$initialProduct->persist();
$initialCategory = $initialProduct->hasData('category_ids') ? $initialProduct->getDataFieldConfig('category_ids')['source']->getCategories()[0] : null;
$category = $product->hasData('category_ids') && $product->getCategoryIds()[0] ? $product->getDataFieldConfig('category_ids')['source']->getCategories()[0] : $initialCategory;
// Steps
$filter = ['sku' => $initialProduct->getSku()];
$this->productGrid->open();
$this->productGrid->getProductGrid()->searchAndOpen($filter);
$this->editProductPage->getProductForm()->fill($product);
$this->editProductPage->getFormPageActions()->save();
return ['category' => $category];
}
示例10: test
/**
* Run delete product test.
*
* @param string $products
* @param FixtureFactory $fixtureFactory
* @param Category $category
* @return array
*/
public function test($products, FixtureFactory $fixtureFactory, Category $category)
{
//Steps
$products = explode(',', $products);
$deleteProducts = [];
foreach ($products as &$product) {
list($fixture, $dataset) = explode('::', $product);
$product = $fixtureFactory->createByCode($fixture, ['dataset' => $dataset, 'data' => ['category_ids' => ['category' => $category]]]);
$product->persist();
$deleteProducts[] = ['sku' => $product->getSku()];
}
$this->catalogProductIndex->open();
$this->catalogProductIndex->getProductGrid()->massaction($deleteProducts, 'Delete', true);
return ['product' => $products];
}
示例11: test
/**
* Run mass update product simple entity test.
*
* @param CatalogProductSimple $initialProduct
* @param CatalogProductSimple $product
* @param string $configData
* @return array
*/
public function test(CatalogProductSimple $initialProduct, CatalogProductSimple $product, $configData)
{
$this->configData = $configData;
// Preconditions
$initialProduct->persist();
$this->objectManager->create('Magento\\Config\\Test\\TestStep\\SetupConfigurationStep', ['configData' => $configData])->run();
// Steps
$this->productGrid->open();
$this->productGrid->getProductGrid()->updateAttributes([['sku' => $initialProduct->getSku()]]);
$this->attributeMassActionPage->getAttributesBlockForm()->fill($product);
$this->attributeMassActionPage->getFormPageActions()->save();
$data = array_merge($initialProduct->getData(), $product->getData());
$product = $this->objectManager->create('Magento\\Catalog\\Test\\Fixture\\CatalogProductSimple', ['data' => $data]);
return ['category' => $initialProduct->getDataFieldConfig('category_ids')['source']->getCategories()[0], 'product' => $product];
}
示例12: processAssert
/**
* 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.");
}
示例13: processAssert
/**
* Assert that product is present in products grid and can be found by sku, type, status and attribute set.
*
* @param FixtureInterface $product
* @param CatalogProductIndex $productIndex
* @return void
*/
public function processAssert(FixtureInterface $product, CatalogProductIndex $productIndex)
{
$this->product = $product;
$productIndex->open();
$productIndex->getProductGrid()->resetFilter();
\PHPUnit_Framework_Assert::assertTrue($productIndex->getProductGrid()->isRowVisible($this->prepareFilter()), 'Product \'' . $this->product->getName() . '\' is absent in Products grid.');
}
示例14: testUpdate
/**
* Run update product simple entity test
*
* @param CatalogProductSimple $product
* @return void
*/
public function testUpdate(CatalogProductSimple $product)
{
$filter = ['sku' => $this->product->getSku()];
$this->productGrid->open()->getProductGrid()->searchAndOpen($filter);
$this->editProductPage->getProductForm()->fill($product);
$this->editProductPage->getFormPageActions()->save();
}
示例15: test
/**
* Run update product simple entity test.
*
* @param CatalogProductSimple $initialProduct
* @param CatalogProductSimple $product
* @param string $configData
* @return array
*/
public function test(CatalogProductSimple $initialProduct, CatalogProductSimple $product, $configData = '')
{
$this->configData = $configData;
// Preconditions
$initialProduct->persist();
$initialCategory = $initialProduct->hasData('category_ids') ? $initialProduct->getDataFieldConfig('category_ids')['source']->getCategories()[0] : null;
$category = $product->hasData('category_ids') && $product->getCategoryIds()[0] ? $product->getDataFieldConfig('category_ids')['source']->getCategories()[0] : $initialCategory;
$this->objectManager->create('Magento\\Config\\Test\\TestStep\\SetupConfigurationStep', ['configData' => $configData])->run();
// Steps
$filter = ['sku' => $initialProduct->getSku()];
$this->productGrid->open();
$this->productGrid->getProductGrid()->searchAndOpen($filter);
$this->editProductPage->getProductForm()->fill($product);
$this->editProductPage->getFormPageActions()->save();
return ['category' => $category];
}