本文整理汇总了PHP中magento\mtf\factory\Factory::getApp方法的典型用法代码示例。如果您正苦于以下问题:PHP Factory::getApp方法的具体用法?PHP Factory::getApp怎么用?PHP Factory::getApp使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类magento\mtf\factory\Factory
的用法示例。
在下文中一共展示了Factory::getApp方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testCreateConfigurableProduct
/**
* Edit configurable product and add new options to attribute
*
* @ZephyrId MAGETWO-12840
* @return void
*/
public function testCreateConfigurableProduct()
{
//Preconditions
//Preparing Data for original product
$configurable = Factory::getFixtureFactory()->getMagentoConfigurableProductConfigurableProduct();
$configurable->switchData('configurable');
$configurable->persist();
$productSku = $configurable->getSku();
//Preparing Data for editing product
$editProduct = $configurable->getEditData();
//Steps
$createProductPage = Factory::getPageFactory()->getCatalogProductNew();
$productForm = $createProductPage->getProductForm();
//Login
Factory::getApp()->magentoBackendLoginUser();
$productGridPage = Factory::getPageFactory()->getCatalogProductIndex();
$productGridPage->open();
//Search and open original configurable product
$productGridPage->getProductGrid()->searchAndOpen(['sku' => $productSku]);
//Editing product options
$productForm->fill($editProduct);
$createProductPage->getFormPageActions()->save();
//Verifying
$createProductPage->getMessagesBlock()->waitSuccessMessage();
//Flush cache
$cachePage = Factory::getPageFactory()->getAdminCache();
$cachePage->open();
$cachePage->getActionsBlock()->flushMagentoCache();
//Verifying
$this->assertOnGrid($editProduct);
$this->assertOnFrontend($editProduct);
}
示例2: persist
/**
* Create product
*
* @param FixtureInterface $fixture [optional]
* @return mixed|string
*/
public function persist(FixtureInterface $fixture = null)
{
Factory::getApp()->magentoBackendLoginUser();
$createProductPage = Factory::getPageFactory()->getCatalogProductNew();
$createProductPage->open(['type' => $fixture->getDataConfig()['create_url_params']['type'], 'set' => $fixture->getDataConfig()['create_url_params']['set']]);
$createProductPage->getProductForm()->fill($fixture);
$createProductPage->getFormPageActions()->save();
$createProductPage->getMessagesBlock()->waitSuccessMessage();
}
示例3: open
/**
* Open backend page and log in if needed
*
* @param array $params
* @return $this
*/
public function open(array $params = [])
{
Factory::getApp()->magentoBackendLoginUser();
return parent::open($params);
}
示例4: setUp
/**
* Login into backend area before test
*/
protected function setUp()
{
Factory::getApp()->magentoBackendLoginUser();
}
示例5: persist
/**
* Create customer group
*/
public function persist()
{
$this->_data['fields']['id']['value'] = Factory::getApp()->magentoCustomerCreateCustomerGroup($this);
}
示例6: persist
/**
* Save Attribute into Magento
*/
public function persist()
{
$attributeIds = Factory::getApp()->magentoCatalogCreateProductAttribute($this);
$this->_data['fields']['attribute_id']['value'] = $attributeIds['attributeId'];
$this->_data['fields']['option_ids'] = $attributeIds['optionIds'];
return $this;
}