Example #1
0
 /**
  * @ZephyrId MAGETWO-12405
  */
 public function testCreateNewLocalizedStoreView()
 {
     $objectManager = Factory::getObjectManager();
     $storeFixture = $objectManager->create('\\Magento\\Store\\Test\\Fixture\\Store', ['dataSet' => 'german']);
     $storeListPage = Factory::getPageFactory()->getAdminSystemStore();
     $storeListPage->open();
     $storeListPage->getGridPageActions()->addStoreView();
     $newStorePage = Factory::getPageFactory()->getAdminSystemStoreNewStore();
     $newStorePage->getStoreForm()->fill($storeFixture);
     $newStorePage->getFormPageActions()->save();
     $storeListPage->getMessagesBlock()->assertSuccessMessage();
     $this->assertContains('The store view has been saved', $storeListPage->getMessagesBlock()->getSuccessMessages());
     $this->assertTrue($storeListPage->getStoreGrid()->isStoreExists($storeFixture->getName()));
     $cachePage = Factory::getPageFactory()->getAdminCache();
     $cachePage->open();
     $cachePage->getActionsBlock()->flushCacheStorage();
     $cachePage->getMessagesBlock()->assertSuccessMessage();
     $configPage = Factory::getPageFactory()->getAdminSystemConfig();
     $configPage->open();
     $configPage->getPageActions()->selectStore(['Main Website', $storeFixture->getGroupId(), $storeFixture->getName()]);
     $configGroup = $configPage->getForm()->getGroup('Locale Options');
     $configGroup->open();
     $configGroup->setValue('select-groups-locale-fields-code-value', 'German (Germany)');
     $configPage->getPageActions()->save();
     $configPage->getMessagesBlock()->assertSuccessMessage();
     $homePage = Factory::getPageFactory()->getCmsIndexIndex();
     $homePage->open();
     $homePage->getStoreSwitcherBlock()->selectStoreView($storeFixture->getName());
     $this->assertTrue($homePage->getSearchBlock()->isPlaceholderContains('Den gesamten Shop durchsuchen'));
 }
Example #2
0
 /**
  * Init most popular custom roles
  */
 protected function initCustomRoles()
 {
     $resourceFixture = Factory::getFixtureFactory()->getMagentoUserResource();
     $salesAllScopes = $this->_data['custom_permissions_all_scopes']['data'];
     $salesAllScopes['fields']['resource']['value'] = $resourceFixture->get('Magento_Sales::sales');
     $this->_data['sales_all_scopes']['data'] = $salesAllScopes;
 }
Example #3
0
 /**
  * Create Customer account on frontend
  *
  * @ZephyrId MAGETWO-12394
  */
 public function testCreateCustomer()
 {
     //Data
     $customer = Factory::getFixtureFactory()->getMagentoCustomerCustomer();
     $customer->switchData('customer_US_1');
     $customerAddress = $customer->getAddressData();
     //Page
     $homePage = Factory::getPageFactory()->getCmsIndexIndex();
     $createPage = Factory::getPageFactory()->getCustomerAccountCreate();
     $accountIndexPage = Factory::getPageFactory()->getCustomerAccountIndex();
     $addressEditPage = Factory::getPageFactory()->getCustomerAddressEdit();
     //Step 1 Create Account
     $homePage->open();
     $topLinks = $homePage->getLinksBlock();
     $topLinks->openLink('Register');
     $createPage->getRegisterForm()->registerCustomer($customer);
     //Verifying
     $this->assertContains('Thank you for registering', $accountIndexPage->getMessages()->getSuccessMessages());
     //Check that customer redirected to Dashboard after registration
     $this->assertContains('My Dashboard', $accountIndexPage->getTitleBlock()->getTitle());
     //Step 2 Set Billing Address
     $accountIndexPage->getDashboardAddress()->editBillingAddress();
     $addressEditPage->getEditForm()->editCustomerAddress($customerAddress);
     //Verifying
     $accountIndexPage = Factory::getPageFactory()->getCustomerAccountIndex();
     $this->assertContains('The address has been saved', $accountIndexPage->getMessages()->getSuccessMessages());
     //Verify customer address against previously entered data
     $accountIndexPage->open();
     $accountIndexPage->getDashboardAddress()->editBillingAddress();
     $addressEditPage = Factory::getPageFactory()->getCustomerAddressEdit();
     $this->verifyCustomerAddress($customerAddress, $addressEditPage->getEditForm());
 }
Example #4
0
 /**
  * Initialize fixture data
  *
  * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
  */
 protected function _initData()
 {
     $this->_data['checkout'] = ['prices' => ['price_from' => 110, 'price_to' => 120], 'selection' => [0]];
     parent::_initData();
     $this->_data['fields'] = array_merge_recursive($this->_data['fields'], ['sku_type' => ['value' => 'Fixed', 'input_value' => '1', 'group' => static::GROUP_PRODUCT_DETAILS, 'input' => 'select'], 'price_type' => ['value' => 'Fixed', 'input_value' => '1', 'group' => static::GROUP_PRODUCT_DETAILS, 'input' => 'select'], 'price' => ['value' => 100, 'group' => static::GROUP_PRODUCT_DETAILS], 'tax_class_id' => ['value' => 'Taxable Goods', 'input_value' => '2', 'group' => static::GROUP_PRODUCT_DETAILS, 'input' => 'select'], 'weight_type' => ['value' => 'Fixed', 'input_value' => '1', 'group' => static::GROUP_PRODUCT_DETAILS, 'input' => 'select'], 'weight' => ['value' => '1', 'group' => static::GROUP_PRODUCT_DETAILS], 'product_website_1' => ['value' => 'Yes', 'input_value' => [1], 'group' => static::GROUP_PRODUCT_WEBSITE, 'input' => 'checkbox', 'input_name' => 'website_ids'], 'shipment_type' => ['value' => 'Separately', 'input_value' => '1', 'group' => static::GROUP_PRODUCT_DETAILS, 'input' => 'select'], 'bundle_selections' => ['value' => ['bundle_options' => [['title' => 'Drop-down Option', 'type' => 'Drop-down', 'required' => 'Yes', 'assigned_products' => [['search_data' => ['name' => '%item1_simple1::getName%'], 'data' => ['selection_price_value' => 10, 'selection_price_type' => 'Fixed', 'selection_qty' => 1, 'product_id' => '%item1_simple1::getProductId%']], ['search_data' => ['name' => '%item1_virtual2::getName%'], 'data' => ['selection_price_value' => 20, 'selection_price_type' => 'Percent', 'selection_qty' => 1, 'product_id' => '%item1_virtual2::getProductId%']]]]]], 'group' => static::GROUP]]);
     $this->_repository = Factory::getRepositoryFactory()->getMagentoBundleBundle($this->_dataConfig, $this->_data);
 }
Example #5
0
 /**
  * Initialize fixture data
  */
 protected function _initData()
 {
     $this->_data['checkout'] = array('prices' => array('price_from' => 10, 'price_to' => 15), 'selection' => array('bundle_item_0' => 'assigned_product_0'));
     parent::_initData();
     $this->_data['fields'] = array_merge_recursive($this->_data['fields'], array('sku_type' => array('value' => 'Dynamic', 'input_value' => '0', 'group' => static::GROUP_PRODUCT_DETAILS, 'input' => 'select'), 'price_type' => array('value' => 'Dynamic', 'input_value' => '0', 'group' => static::GROUP_PRODUCT_DETAILS, 'input' => 'select'), 'weight_type' => array('value' => 'Dynamic', 'input_value' => '0', 'group' => static::GROUP_PRODUCT_DETAILS, 'input' => 'select'), 'product_website_1' => array('value' => 'Yes', 'input_value' => array(1), 'group' => static::GROUP_PRODUCT_WEBSITE, 'input' => 'checkbox', 'input_name' => 'website_ids'), 'shipment_type' => array('value' => 'Separately', 'input_value' => '1', 'group' => static::GROUP_PRODUCT_DETAILS, 'input' => 'select'), 'bundle_selections' => array('value' => array('bundle_options' => array('bundle_item_0' => array('title' => 'Drop-down Option', 'type' => 'Drop-down', 'required' => 'Yes', 'assigned_products' => array('assigned_product_0' => array('search_data' => array('name' => '%item1_simple1::getName%'), 'data' => array('selection_qty' => 1, 'product_id' => '%item1_simple1::getProductId%')), 'assigned_product_1' => array('search_data' => array('name' => '%item1_virtual2::getName%'), 'data' => array('selection_qty' => 1, 'product_id' => '%item1_virtual2::getProductId%')))))), 'group' => static::GROUP)));
     $this->_repository = Factory::getRepositoryFactory()->getMagentoBundleBundle($this->_dataConfig, $this->_data);
 }
Example #6
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()->getMagentoCatalogConfigurableProduct();
     $configurable->switchData('configurable');
     $configurable->persist();
     $productSku = $configurable->getProductSku();
     //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->getFormAction()->save();
     //Verifying
     $createProductPage->getMessagesBlock()->assertSuccessMessage();
     //Flush cache
     $cachePage = Factory::getPageFactory()->getAdminCache();
     $cachePage->open();
     $cachePage->getActionsBlock()->flushMagentoCache();
     //Verifying
     $this->assertOnGrid($editProduct);
     $this->assertOnFrontend($editProduct);
 }
Example #7
0
 /**
  * @param Config $configuration
  * @param array $placeholders
  */
 public function __construct(Config $configuration, array $placeholders = array())
 {
     parent::__construct($configuration, $placeholders);
     $this->_placeholders['rewritten_category_request_path'] = array($this, 'getRewrittenRequestPath');
     $this->_repository = Factory::getRepositoryFactory()->getMagentoUrlRewriteUrlRewriteCategory($this->_dataConfig, $this->_data);
     $this->category = Factory::getFixtureFactory()->getMagentoCatalogCategory();
     $this->category->persist();
 }
Example #8
0
 /**
  * {inheritdoc}
  */
 protected function _initData()
 {
     parent::_initData();
     $this->_dataConfig = array('constraint' => 'Success', 'grid_filter' => array('name'), 'create_url_params' => array('type' => 'simple', 'set' => static::DEFAULT_ATTRIBUTE_SET_ID), 'input_prefix' => 'product');
     $data = $this->_getPreparedData();
     $this->_data['fields'] = array_merge($this->_data['fields'], $data);
     $this->_repository = Factory::getRepositoryFactory()->getMagentoCatalogSimpleProduct($this->_dataConfig, $this->_data);
 }
Example #9
0
 /**
  * Init Data
  */
 protected function _initData()
 {
     $this->_dataConfig = array('assignType ' => $this->assignType);
     /** @var  $type Related|Upsell */
     $type = 'Magento\\Catalog\\Test\\Block\\Adminhtml\\Product\\Edit\\Tab\\' . ucfirst(strtolower($this->assignType));
     $this->_data = array('fields' => array($this->assignType . '_products' => array('value' => array('product_1' => array('sku' => '%' . $this->assignType . '_simple::getProductSku%', 'name' => '%' . $this->assignType . '_simple::getName%'), 'product_2' => array('sku' => '%' . $this->assignType . '_configurable::getProductSku%', 'name' => '%' . $this->assignType . '_configurable::getName%')), 'group' => $type::GROUP)));
     $this->_repository = Factory::getRepositoryFactory()->getMagentoCatalogAssignProducts($this->_dataConfig, $this->_data);
 }
Example #10
0
 /**
  * {@inheritdoc}
  */
 protected function _initData()
 {
     parent::_initData();
     $this->_dataConfig = array('constraint' => 'Success', 'grid_filter' => array('name'), 'create_url_params' => array('type' => 'virtual', 'set' => static::DEFAULT_ATTRIBUTE_SET_ID), 'input_prefix' => 'product');
     $data = array('is_virtual' => array('value' => '', 'group' => null), 'price' => array('value' => 15, 'group' => static::GROUP_PRODUCT_DETAILS), 'tax_class_id' => array('value' => 'Taxable Goods', 'input_value' => '2', 'group' => static::GROUP_PRODUCT_DETAILS, 'input' => 'select'), 'qty' => array('value' => 1000, 'group' => static::GROUP_PRODUCT_DETAILS, 'input_name' => 'product[quantity_and_stock_status][qty]'), 'product_website_1' => array('value' => 'Yes', 'input_value' => 1, 'group' => static::GROUP_PRODUCT_WEBSITE, 'input' => 'checkbox', 'input_name' => 'product[website_ids][]'), 'inventory_manage_stock' => array('value' => 'No', 'input_value' => '0', 'group' => static::GROUP_PRODUCT_INVENTORY, 'input' => 'select', 'input_name' => 'product[stock_data][manage_stock]'));
     $this->_data['fields'] = array_merge($this->_data['fields'], $data);
     $this->_repository = Factory::getRepositoryFactory()->getMagentoCatalogVirtualProduct($this->_dataConfig, $this->_data);
 }
Example #11
0
 /**
  * Verify category on the frontend
  *
  * @param Category $category
  */
 protected function assertCategoryOnFrontend(Category $category)
 {
     //Open created category on frontend
     $frontendHomePage = Factory::getPageFactory()->getCmsIndexIndex();
     $frontendHomePage->open();
     $navigationMenu = $frontendHomePage->getTopmenu();
     $navigationMenu->selectCategoryByName($category->getCategoryName());
     $this->assertEquals($category->getCategoryName(), $frontendHomePage->getTitleBlock()->getTitle());
 }
 /**
  * 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()->assertSuccessMessage();
 }
Example #13
0
 /**
  * Test admin login to backend
  *
  * @param SuperAdmin $fixture
  */
 public function test(SuperAdmin $fixture)
 {
     //Page
     $loginPage = Factory::getPageFactory()->getAdminAuthLogin();
     //Steps
     $loginPage->open();
     $loginPage->getLoginBlock()->fill($fixture);
     $loginPage->getLoginBlock()->submit();
 }
Example #14
0
 /**
  * @param Config $configuration
  * @param array $placeholders
  */
 public function __construct(Config $configuration, $placeholders = array())
 {
     parent::__construct($configuration, $placeholders);
     $this->_placeholders['rewritten_product_request_path'] = array($this, 'getRewrittenRequestPath');
     $this->_repository = Factory::getRepositoryFactory()->getMagentoUrlRewriteUrlRewriteProduct($this->_dataConfig, $this->_data);
     $this->product = Factory::getFixtureFactory()->getMagentoCatalogSimpleProduct();
     $this->product->switchData('simple');
     $this->product->persist();
 }
Example #15
0
 /**
  * Create product
  *
  * @param FixtureInterface $fixture [optional]
  * @return mixed|string
  */
 public function persist(FixtureInterface $fixture = null)
 {
     Factory::getApp()->magentoBackendLoginUser();
     $createProductPage = Factory::getPageFactory()->getCatalogProductNew();
     $createProductPage->init($fixture);
     $createProductPage->open();
     $productForm = $createProductPage->getProductForm();
     $productForm->fill($fixture);
     $createProductPage->getFormAction()->save();
     $createProductPage->getMessagesBlock()->assertSuccessMessage();
 }
Example #16
0
 /**
  * Fill bundle options
  *
  * @param array $bundleOptions
  * @return void
  */
 public function fillBundleOptions($bundleOptions)
 {
     $index = 1;
     foreach ($bundleOptions as $option) {
         /** @var $optionBlock \Magento\Bundle\Test\Block\Catalog\Product\View\Type\Option\Radio|
          * \Magento\Bundle\Test\Block\Catalog\Product\View\Type\Option\Select */
         $getClass = 'getMagentoBundleCatalogProductViewTypeOption' . ucfirst($option['type']);
         $optionBlock = Factory::getBlockFactory()->{$getClass}($this->_rootElement->find('.field.option.required:nth-of-type(' . $index++ . ')'));
         $optionBlock->fillOption($option);
     }
 }
 /**
  * Assert absence product on category page (frontend)
  *
  * @param Product $product
  * @return void
  */
 protected function assertAbsenceOnCategory(Product $product)
 {
     //Pages
     $frontendHomePage = Factory::getPageFactory()->getCmsIndexIndex();
     $categoryPage = Factory::getPageFactory()->getCatalogCategoryView();
     //Steps
     $frontendHomePage->open();
     $frontendHomePage->getTopmenu()->selectCategoryByName($product->getCategoryName());
     //Verification on category product list
     $productListBlock = $categoryPage->getListProductBlock();
     $this->assertFalse($productListBlock->isProductVisible($product->getName()));
 }
Example #18
0
 /**
  * Select cross-sells products
  *
  * @param array $products
  * @param Element|null $context
  * @return $this
  */
 public function fillFormTab(array $products, Element $context = null)
 {
     if (!isset($products['crosssell_products'])) {
         return $this;
     }
     $element = $context ?: $this->_rootElement;
     $crossSellBlock = Factory::getBlockFactory()->getMagentoCatalogAdminhtmlProductEditTabCrosssellGrid($element->find('#cross_sell_product_grid'));
     foreach ($products['crosssell_products']['value'] as $product) {
         $crossSellBlock->searchAndSelect($product);
     }
     return $this;
 }
Example #19
0
 /**
  * Execute handler
  *
  * @param FixtureInterface $fixture [optional]
  * @return mixed
  */
 public function persist(FixtureInterface $fixture = null)
 {
     /** @var \Magento\Customer\Test\Fixture\Address $fixture */
     // Pages
     $loginPage = Factory::getPageFactory()->getCustomerAccountLogin();
     $addressPage = Factory::getPageFactory()->getCustomerAddressEdit();
     $loginPage->open();
     if ($loginPage->getLoginBlock()->isVisible()) {
         $loginPage->getLoginBlock()->login($fixture->getCustomer());
     }
     $addressPage->open();
     $addressPage->getEditForm()->editCustomerAddress($fixture);
 }
 /**
  * Init Data
  */
 protected function _initData()
 {
     $this->_dataConfig = array('assignType ' => $this->assignType);
     /** @var  $type Related|Upsell */
     $type = 'Magento\\Catalog\\Test\\Block\\Adminhtml\\Product\\Edit\\Tab\\' . ucfirst(strtolower($this->assignType));
     $productsArray = array();
     foreach ($this->_products as $key => $product) {
         /** @var $product \Magento\Catalog\Test\Fixture\Product */
         $productsArray['product_' . $key] = array('sku' => $product->getProductSku(), 'name' => $product->getName());
     }
     $this->_data['fields'][$this->assignType . '_products']['value'] = $productsArray;
     $this->_data['fields'][$this->assignType . '_products']['group'] = $type::GROUP;
     $this->_repository = Factory::getRepositoryFactory()->getMagentoCatalogAssignProducts($this->_dataConfig, $this->_data);
 }
 /**
  * Reset password on frontend
  */
 public function testForgotPassword()
 {
     // Create Customer
     $customer = Factory::getFixtureFactory()->getMagentoCustomerCustomer();
     $customer->switchData('customer_US_1');
     $customer->persist();
     $customerAccountLoginPage = Factory::getPageFactory()->getCustomerAccountLogin();
     $forgotPasswordPage = Factory::getPageFactory()->getCustomerAccountForgotpassword();
     $forgotPasswordPage->open();
     $forgotPasswordPage->getForgotPasswordForm()->resetForgotPassword($customer);
     //Verifying
     $message = sprintf('If there is an account associated with %s you will receive an email with a link to reset your password.', $customer->getEmail());
     $this->assertContains($message, $customerAccountLoginPage->getMessages()->getSuccessMessages());
 }
Example #22
0
 /**
  * Assert existing tax rule on manage tax rule grid
  *
  * @param TaxRule $fixture
  */
 protected function _assertOnGrid(TaxRule $fixture)
 {
     //Data
     $filter = ['code' => $fixture->getCode(), 'tax_rate' => implode(', ', $fixture->getTaxRate())];
     if ($fixture->getTaxCustomerClass() !== null) {
         $filter['tax_customer_class'] = implode(', ', $fixture->getTaxCustomerClass());
     }
     if ($fixture->getTaxProductClass() !== null) {
         $filter['tax_product_class'] = implode(', ', $fixture->getTaxProductClass());
     }
     //Verification
     $taxGridPage = Factory::getPageFactory()->getTaxRuleIndex();
     $taxGridPage->open();
     $this->assertTrue($taxGridPage->getTaxRuleGrid()->isRowVisible($filter), 'New tax rule was not found.');
 }
Example #23
0
 /**
  * Login admin user
  *
  * @param FixtureInterface $fixture [optional]
  * @return void|mixed
  */
 public function persist(FixtureInterface $fixture = null)
 {
     if (null === $fixture) {
         $fixture = Factory::getFixtureFactory()->getMagentoBackendAdminSuperAdmin();
     }
     $loginPage = Factory::getPageFactory()->getAdminAuthLogin();
     $loginForm = $loginPage->getLoginBlock();
     $adminHeaderPanel = $loginPage->getHeaderBlock();
     if (!$adminHeaderPanel || !$adminHeaderPanel->isVisible()) {
         $loginPage->open();
         if ($adminHeaderPanel->isVisible()) {
             return;
         }
         $loginForm->fill($fixture);
         $loginForm->submit();
         $loginPage->waitForHeaderBlock();
     }
 }
 /**
  * New customer creation in backend
  *
  * @ZephyrId MAGETWO-12516
  */
 public function testCreateCustomer()
 {
     //Data
     $customerFixture = Factory::getFixtureFactory()->getMagentoCustomerCustomer();
     $customerFixture->switchData('backend_customer');
     $searchData = array('email' => $customerFixture->getEmail());
     //Pages
     $customerPage = Factory::getPageFactory()->getCustomerIndex();
     $customerCreatePage = Factory::getPageFactory()->getCustomerIndexNew();
     //Steps
     $customerPage->open();
     $customerPage->getPageActionsBlock()->addNew();
     $customerCreatePage->getCustomerForm()->fillCustomer($customerFixture);
     $customerCreatePage->getPageActionsBlock()->saveAndContinue();
     $customerCreatePage->getMessagesBlock()->assertSuccessMessage();
     //Verifying
     $customerPage->open();
     $this->assertTrue($customerPage->getCustomerGridBlock()->isRowVisible($searchData), 'Customer email "' . $searchData['email'] . '" not found in the grid');
 }
Example #25
0
 /**
  * Advanced search product on frontend by product name
  *
  * @ZephyrId MAGETWO-12421
  */
 public function testProductSearch()
 {
     //Data
     $productFixture = Factory::getFixtureFactory()->getMagentoCatalogSimpleProduct();
     $productFixture->switchData('simple');
     $productFixture->persist();
     //Pages
     $homePage = Factory::getPageFactory()->getCmsIndexIndex();
     $advancedSearchPage = Factory::getPageFactory()->getCatalogsearchAdvanced();
     $advancedSearchResultPage = Factory::getPageFactory()->getCatalogsearchResult();
     //Steps
     $homePage->open();
     $homePage->getSearchBlock()->clickAdvancedSearchButton();
     $searchForm = $advancedSearchPage->getForm();
     $this->assertTrue($searchForm->isVisible(), '"Advanced Search" form is not opened');
     $searchForm->fillCustom($productFixture, ['name', 'sku']);
     $searchForm->submit();
     //Verifying
     $productName = $productFixture->getName();
     $this->assertTrue($advancedSearchResultPage->getListProductBlock()->isProductVisible($productName), sprintf('Product "%s" is not displayed on the "Catalog Advanced Search" results page."', $productName));
 }
Example #26
0
 /**
  * Create product
  *
  * @return void
  */
 public function persist()
 {
     $id = Factory::getApp()->magentoCatalogCreateProduct($this);
     $this->_data['fields']['id']['value'] = $id;
 }
Example #27
0
 /**
  * Get proceed to checkout block
  *
  * @return Link
  */
 public function getOnepageLinkBlock()
 {
     return Factory::getBlockFactory()->getMagentoCheckoutOnepageLink($this->_rootElement->find($this->onepageLinkBlock, Locator::SELECTOR_CSS));
 }
Example #28
0
 /**
  * Retrieve actions block
  *
  * @return \Magento\Backend\Test\Block\System\Store\Actions
  */
 public function getPageActionsBlock()
 {
     return Factory::getBlockFactory()->getMagentoBackendSystemStoreActions($this->_browser->find($this->actionsBlock));
 }
 /**
  * {inheritdoc}
  *
  * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
  */
 protected function _initData()
 {
     $this->_data = array('fields' => array('attribute_code' => array('value' => 'attribute_code_%isolation%', 'group' => self::GROUP_PRODUCT_ATTRIBUTE_MAIN), 'frontend_label' => array('value' => 'Attribute %isolation%', 'input_name' => 'frontend_label[0]', 'group' => self::GROUP_PRODUCT_ATTRIBUTE_MAIN), 'frontend_input' => array('value' => 'Dropdown', 'input' => 'select', 'input_value' => 'select', 'group' => self::GROUP_PRODUCT_ATTRIBUTE_MAIN), 'is_configurable' => array('value' => 'Yes', 'input' => 'select', 'input_value' => 1, 'group' => self::GROUP_PRODUCT_ATTRIBUTE_MAIN), 'is_searchable' => array('value' => 'Yes', 'input' => 'select', 'input_value' => 1, 'group' => self::GROUP_PRODUCT_ATTRIBUTE_FRONT), 'is_visible_in_advanced_search' => array('value' => 'Yes', 'input' => 'select', 'input_value' => 1, 'group' => self::GROUP_PRODUCT_ATTRIBUTE_FRONT), 'is_comparable' => array('value' => 'Yes', 'input' => 'select', 'input_value' => 1, 'group' => self::GROUP_PRODUCT_ATTRIBUTE_FRONT), 'is_filterable' => array('value' => 'Filterable (with results)', 'input' => 'select', 'input_value' => 1, 'group' => self::GROUP_PRODUCT_ATTRIBUTE_FRONT), 'is_visible_on_front' => array('value' => 'Yes', 'input' => 'select', 'input_value' => 1, 'group' => self::GROUP_PRODUCT_ATTRIBUTE_FRONT), 'is_filterable_in_search' => array('value' => 'Yes', 'input' => 'select', 'input_value' => 1, 'group' => self::GROUP_PRODUCT_ATTRIBUTE_FRONT)), 'options' => array('value' => array('option_1' => array('label' => array('value' => 'Option 1 %isolation%', 'input_name' => 'option[value][option_0][0]', 'selector' => '//*[@id="manage-options-panel"]/table/tbody/tr[1]/td[3]/input', 'strategy' => Locator::SELECTOR_XPATH), 'default' => array('value' => 'Yes', 'input' => 'checkbox', 'input_name' => 'default[0]', 'input_value' => 'option_0', 'selector' => '//*[@id="manage-options-panel"]/table/tbody/tr[1]/td[2]/input', 'strategy' => Locator::SELECTOR_XPATH)), 'option_2' => array('label' => array('value' => 'Option 2 %isolation%', 'input_name' => 'option[value][option_1][0]', 'selector' => '//*[@id="manage-options-panel"]/table/tbody/tr[2]/td[3]/input', 'strategy' => Locator::SELECTOR_XPATH), 'default' => array('value' => 'No', 'input' => 'checkbox', 'input_name' => 'default[1]', 'input_value' => 'option_1', 'selector' => '//*[@id="manage-options-panel"]/table/tbody/tr[2]/td[2]/input', 'strategy' => Locator::SELECTOR_XPATH)))));
     $this->_repository = Factory::getRepositoryFactory()->getMagentoCatalogProductAttribute($this->_dataConfig, $this->_data);
 }
 /**
  * Assert product data on product page
  *
  * @param SimpleProduct $productOld
  * @param SimpleProduct $productEdited
  * @return void
  */
 protected function assertOnProductPage(SimpleProduct $productOld, SimpleProduct $productEdited)
 {
     Factory::getClientBrowser()->open($_ENV['app_frontend_url'] . $productOld->getUrlKey() . '.html');
     $productPage = Factory::getPageFactory()->getCatalogProductView();
     $productViewBlock = $productPage->getViewBlock();
     $this->assertEquals($productEdited->getName(), $productViewBlock->getProductName());
     $price = $productViewBlock->getProductPrice();
     $this->assertEquals(number_format($productEdited->getProductPrice(), 2), $price['price_regular_price']);
 }