本文整理匯總了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;
}