Example #1
0
 /**
  * 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);
 }
Example #2
0
 /**
  * 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();
 }
Example #3
0
 /**
  * Persists prepared data into application
  */
 public function persist()
 {
     Factory::getApp()->magentoCustomerCreateAddress($this);
 }
Example #4
0
 /**
  * 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);
 }
Example #5
0
 /**
  * Create product
  *
  * @return void
  */
 public function persist()
 {
     $id = Factory::getApp()->magentoCatalogCreateProduct($this);
     $this->_data['fields']['id']['value'] = $id;
 }
Example #6
0
 /**
  * Create bundle product
  *
  * @return $this|void
  */
 public function persist()
 {
     Factory::getApp()->magentoBundleCreateBundle($this);
     return $this;
 }
Example #7
0
 /**
  * Login into backend area before test
  */
 protected function setUp()
 {
     Factory::getApp()->magentoBackendLoginUser();
 }
Example #8
0
 /**
  * Create customer via frontend
  *
  * @return string
  */
 public function persist()
 {
     return Factory::getApp()->magentoCustomerCreateCustomer($this);
 }
Example #9
0
 /**
  * Create product
  *
  * @return $this|ConfigurableProduct
  */
 public function persist()
 {
     $id = Factory::getApp()->magentoConfigurableProductCreateConfigurable($this);
     $this->_data['id']['value'] = $id;
     return $this;
 }
Example #10
0
 /**
  * {@inheritdoc}
  */
 public function persist()
 {
     return Factory::getApp()->magentoUserCreateRole($this);
 }
 /**
  * Create customer group
  */
 public function persist()
 {
     $this->_data['fields']['id']['value'] = Factory::getApp()->magentoCustomerCreateCustomerGroup($this);
 }
Example #12
0
 /**
  * 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;
 }
Example #14
0
 protected function setUp()
 {
     $this->product = Factory::getFixtureFactory()->getMagentoDownloadableDownloadableProductLinksPurchasedSeparately();
     $this->product->switchData('downloadable');
     Factory::getApp()->magentoBackendLoginUser();
 }
Example #15
0
 /**
  * Create customer via backend
  */
 public function persist()
 {
     Factory::getApp()->magentoCustomerCreateCustomerBackend($this);
 }
Example #16
0
 /**
  * Create product
  */
 public function persist()
 {
     $id = Factory::getApp()->magentoDownloadableCreateDownloadable($this);
     $this->_data['fields']['id']['value'] = $id;
 }