/** * 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); }
/** * 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(); }
/** * Persists prepared data into application */ public function persist() { Factory::getApp()->magentoCustomerCreateAddress($this); }
/** * 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); }
/** * Create product * * @return void */ public function persist() { $id = Factory::getApp()->magentoCatalogCreateProduct($this); $this->_data['fields']['id']['value'] = $id; }
/** * Create bundle product * * @return $this|void */ public function persist() { Factory::getApp()->magentoBundleCreateBundle($this); return $this; }
/** * Login into backend area before test */ protected function setUp() { Factory::getApp()->magentoBackendLoginUser(); }
/** * Create customer via frontend * * @return string */ public function persist() { return Factory::getApp()->magentoCustomerCreateCustomer($this); }
/** * Create product * * @return $this|ConfigurableProduct */ public function persist() { $id = Factory::getApp()->magentoConfigurableProductCreateConfigurable($this); $this->_data['id']['value'] = $id; return $this; }
/** * {@inheritdoc} */ public function persist() { return Factory::getApp()->magentoUserCreateRole($this); }
/** * Create customer group */ public function persist() { $this->_data['fields']['id']['value'] = Factory::getApp()->magentoCustomerCreateCustomerGroup($this); }
/** * Create user */ public function persist() { Factory::getApp()->magentoUserCreateUser($this); }
/** * 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; }
protected function setUp() { $this->product = Factory::getFixtureFactory()->getMagentoDownloadableDownloadableProductLinksPurchasedSeparately(); $this->product->switchData('downloadable'); Factory::getApp()->magentoBackendLoginUser(); }
/** * Create customer via backend */ public function persist() { Factory::getApp()->magentoCustomerCreateCustomerBackend($this); }
/** * Create product */ public function persist() { $id = Factory::getApp()->magentoDownloadableCreateDownloadable($this); $this->_data['fields']['id']['value'] = $id; }