Magento Extensions Rating 2024
EXTENSIONS BY CATEGORY
B2B (Business-To-Business)
Blog
Customer
ERP (Enterprise Resource Planning)
Mega Menu
One Step Checkout
Order
POS (Point Of Sale)
Search
Shopping Cart
Sitemap
SEO
Social
Stock & Inventory Management
EXTENSIONS BY DEVELOPER
aheadWorks
Amasty
Boost My Shop
BSS Commerce
Magestore
MageWorx
Mirasvit
Templates Master
Wyomind
XTENTO
Magento 2 Documentation
Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
vendor
magento
magento2-base
dev
tests
functional
tests
app
Magento
Catalog
Test
Block
Adminhtml
Product
Edit
Section
ProductDetails
NewCategoryIds.php
Go to the documentation of this file.
1
<?php
7
namespace
Magento\Catalog\Test\Block\Adminhtml\Product\Edit\Section\ProductDetails
;
8
9
use
Magento\Catalog\Test\Fixture\Category
;
10
use Magento\Mtf\Block\Form;
11
15
class
NewCategoryIds
extends
Form
16
{
22
protected
$buttonNewCategory
=
'[data-index="create_category_button"]'
;
23
29
protected
$createCategoryModal
=
'.product_form_product_form_create_category_modal'
;
30
36
protected
$createCategoryButton
=
'#save'
;
37
44
public
function
addNewCategory
(Category
$category
)
45
{
46
$data
= [
47
'name'
=>
$category
->getName(),
48
'parent_category'
=>
$category
->getDataFieldConfig(
'parent_id'
)[
'source'
]->getParentCategory()->getName()
49
];
50
51
$this->
openNewCategoryDialog
();
52
$this->_fill($this->
dataMapping
(
$data
));
53
54
$this->_rootElement->find($this->createCategoryButton)->click();
55
$this->waitForElementNotVisible($this->createCategoryButton);
56
}
57
63
protected
function
openNewCategoryDialog
()
64
{
65
$this->browser->find($this->buttonNewCategory)->click();
66
$this->waitForElementVisible($this->createCategoryModal);
67
}
68
}
$category
$category
Definition:
catalog_category_with_slash.php:7
Magento\Catalog\Test\Block\Adminhtml\Product\Edit\Section\ProductDetails\NewCategoryIds\$buttonNewCategory
$buttonNewCategory
Definition:
NewCategoryIds.php:22
Magento\Catalog\Test\Block\Adminhtml\Product\Edit\Section\ProductDetails\dataMapping
dataMapping(array $fields=null, $parent=null)
Definition:
ProductDetails.php:38
Magento\Catalog\Test\Block\Adminhtml\Product\Edit\Section\ProductDetails\NewCategoryIds\addNewCategory
addNewCategory(Category $category)
Definition:
NewCategoryIds.php:44
Magento\Catalog\Test\Block\Adminhtml\Product\Edit\Section\ProductDetails\NewCategoryIds\openNewCategoryDialog
openNewCategoryDialog()
Definition:
NewCategoryIds.php:63
Magento\Catalog\Test\Fixture\Category
Definition:
CategoryProducts.php:7
$data
$data
Definition:
attribute_set_with_image_attribute.php:16
Magento\Catalog\Test\Block\Adminhtml\Product\Edit\Section\ProductDetails\NewCategoryIds\$createCategoryButton
$createCategoryButton
Definition:
NewCategoryIds.php:36
Magento\Catalog\Test\Block\Adminhtml\Product\Edit\Section\ProductDetails
Definition:
AttributeSet.php:7
Magento\Catalog\Test\Block\Adminhtml\Product\Edit\Section\ProductDetails\NewCategoryIds\$createCategoryModal
$createCategoryModal
Definition:
NewCategoryIds.php:29
Magento\Catalog\Test\Block\Adminhtml\Product\Edit\Section\ProductDetails\NewCategoryIds
Definition:
NewCategoryIds.php:15