Exemplo n.º 1
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);
     }
 }
Exemplo n.º 2
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;
 }
Exemplo n.º 3
0
 /**
  * Get backend abstract block
  *
  * @return \Magento\Backend\Test\Block\Template
  */
 protected function getTemplateBlock()
 {
     return Factory::getBlockFactory()->getMagentoBackendTemplate($this->_rootElement->find($this->templateBlock, Locator::SELECTOR_XPATH));
 }
Exemplo n.º 4
0
 /**
  * Get variations block
  *
  * @return \Magento\Catalog\Test\Block\Adminhtml\Product\Edit\Tab\Super\Config
  */
 protected function getVariationsBlock()
 {
     return Factory::getBlockFactory()->getMagentoCatalogAdminhtmlProductEditTabSuperConfig($this->_rootElement->find($this->variationsWrapper));
 }
Exemplo n.º 5
0
 /**
  * Retrieve actions block
  *
  * @return \Magento\Backend\Test\Block\System\Store\Actions
  */
 public function getPageActionsBlock()
 {
     return Factory::getBlockFactory()->getMagentoBackendSystemStoreActions($this->_browser->find($this->actionsBlock));
 }
Exemplo n.º 6
0
 /**
  * Get abstract block
  *
  * @return \Magento\Backend\Test\Block\Template
  */
 public function getTemplateBlock()
 {
     return Factory::getBlockFactory()->getMagentoBackendTemplate($this->_browser->find($this->templateBlock, Locator::SELECTOR_CSS));
 }
Exemplo n.º 7
0
 /**
  * Get product variations matrix block
  *
  * @return \Magento\Catalog\Test\Block\Adminhtml\Product\Edit\Tab\Super\Config\Matrix
  */
 protected function getMatrixBlock()
 {
     return Factory::getBlockFactory()->getMagentoCatalogAdminhtmlProductEditTabSuperConfigMatrix($this->_rootElement->find($this->matrixBlock, Locator::SELECTOR_CSS));
 }
Exemplo n.º 8
0
 /**
  * Get messages block
  *
  * @return \Magento\Core\Test\Block\Messages
  */
 public function getMessagesBlock()
 {
     return Factory::getBlockFactory()->getMagentoCoreMessages($this->_browser->find($this->messagesBlock, Locator::SELECTOR_CSS));
 }
Exemplo n.º 9
0
 /**
  * Get bundle options block
  *
  * @param int $blockNumber
  * @return \Magento\Bundle\Test\Block\Adminhtml\Catalog\Product\Edit\Tab\Bundle\Option
  */
 protected function getBundleOptionBlock($blockNumber)
 {
     return Factory::getBlockFactory()->getMagentoBundleAdminhtmlCatalogProductEditTabBundleOption($this->_rootElement->find($this->bundleOptionBlock . $blockNumber));
 }
Exemplo n.º 10
0
 /**
  * Get bundle options block
  *
  * @return \Magento\Bundle\Test\Block\Catalog\Product\View\Type\Bundle
  */
 public function getBundleBlock()
 {
     return Factory::getBlockFactory()->getMagentoBundleCatalogProductViewTypeBundle($this->_rootElement->find($this->bundleBlock));
 }
Exemplo n.º 11
0
 /**
  * Retrieve store configuration form group
  *
  * @param string $name
  * @return Form\Group
  */
 public function getGroup($name)
 {
     $blockFactory = Factory::getBlockFactory();
     $element = $this->_rootElement->find(sprintf($this->groupBlock, $name), Locator::SELECTOR_XPATH);
     return $blockFactory->getMagentoBackendSystemConfigFormGroup($element);
 }
Exemplo n.º 12
0
 /**
  * Get block price
  *
  * @return \Magento\Catalog\Test\Block\Product\Price
  */
 protected function getPriceBlock()
 {
     return Factory::getBlockFactory()->getMagentoCatalogProductPrice($this->_rootElement->find('.product-info-main .price-box'));
 }
Exemplo n.º 13
0
 /**
  * Get global messages block
  *
  * @return \Magento\Core\Test\Block\Messages
  */
 public function getMessagesBlock()
 {
     return Factory::getBlockFactory()->getMagentoCoreMessages($this->_browser->find($this->messagesBlock));
 }
Exemplo n.º 14
0
 /**
  * This method returns the price box block for the named product.
  *
  * @param string $productName String containing the name of the product to find.
  * @return Price
  */
 public function getProductPriceBlock($productName)
 {
     return Factory::getBlockFactory()->getMagentoCatalogProductPrice($this->getProductDetailsElement($productName)->find($this->priceBlockClass, Locator::SELECTOR_CLASS_NAME));
 }
Exemplo n.º 15
0
 /**
  * Get product row assigned to bundle option
  *
  * @param int $rowNumber
  * @param Element $context
  * @return \Magento\Bundle\Test\Block\Adminhtml\Catalog\Product\Edit\Tab\Bundle\Option\Selection
  */
 protected function getSelectionBlock($rowNumber, Element $context = null)
 {
     $element = $context !== null ? $context : $this->_rootElement;
     return Factory::getBlockFactory()->getMagentoBundleAdminhtmlCatalogProductEditTabBundleOptionSelection($element->find($this->selectionBlock . '_' . $rowNumber));
 }
Exemplo n.º 16
0
 /**
  * Get default addresses block
  *
  * @return \Magento\Customer\Test\Block\Account\AddressesDefault
  */
 public function getDefaultAddresses()
 {
     return Factory::getBlockFactory()->getMagentoCustomerAccountAddressesDefault($this->_browser->find($this->defaultAddressesSelector, Locator::SELECTOR_CSS));
 }
Exemplo n.º 17
0
 /**
  * Get customer login form
  *
  * @return \Magento\Customer\Test\Block\Form\Login
  */
 public function getLoginBlock()
 {
     return Factory::getBlockFactory()->getMagentoCustomerFormLogin($this->_browser->find($this->loginBlock, Locator::SELECTOR_CSS));
 }
Exemplo n.º 18
0
 /**
  * Get Category edit form
  *
  * @return \Magento\Catalog\Test\Block\Adminhtml\Category\Tab\ProductGrid
  */
 public function getCategoryProductsGrid()
 {
     return Factory::getBlockFactory()->getMagentoCatalogAdminhtmlCategoryTabProductGrid($this->_rootElement->find($this->productsGridBlock));
 }
Exemplo n.º 19
0
 /**
  * Get messages block
  *
  * @return \Magento\Core\Test\Block\Messages
  */
 protected function getMessagesBlock()
 {
     return Factory::getBlockFactory()->getMagentoCoreMessages($this->_rootElement->find($this->messagesSelector, Locator::SELECTOR_XPATH));
 }
Exemplo n.º 20
0
 /**
  * Get variations block
  *
  * @return \Magento\ConfigurableProduct\Test\Block\Adminhtml\Product\Edit\Tab\Super\Config
  */
 protected function getVariationsBlock()
 {
     return Factory::getBlockFactory()->getMagentoConfigurableProductAdminhtmlProductEditTabSuperConfig($this->browser->find($this->variationsWrapper));
 }
 /**
  * Get Customer Forgot Password form
  *
  * @return \Magento\Customer\Test\Block\Form\ForgotPassword
  */
 public function getForgotPasswordForm()
 {
     return Factory::getBlockFactory()->getMagentoCustomerFormForgotPassword($this->_browser->find($this->forgotPasswordForm, Locator::SELECTOR_CSS));
 }
Exemplo n.º 22
0
 /**
  * Get associated products list block
  *
  * @param Element $context
  * @return \Magento\Catalog\Test\Block\Product\Grouped\AssociatedProducts\ListAssociatedProducts
  */
 protected function getListAssociatedProductsBlock(Element $context = null)
 {
     $element = $context ?: $this->_rootElement;
     return Factory::getBlockFactory()->getMagentoCatalogProductGroupedAssociatedProductsListAssociatedProducts($element->find($this->associatedProductsBlock));
 }
 /**
  * Retrieve attributes form block
  *
  * @return \Magento\Catalog\Test\Block\Adminhtml\Product\Edit\Action\Attribute
  */
 public function getAttributesBlockForm()
 {
     return Factory::getBlockFactory()->getMagentoCatalogAdminhtmlProductEditActionAttribute($this->_browser->find($this->attributesFormBlock, Locator::SELECTOR_CSS));
 }
Exemplo n.º 24
0
 /**
  * Getting block products
  *
  * @param string $productId
  * @param Element $context
  * @return ListAssociatedProducts\Product
  */
 private function getProductBlock($productId, Element $context = null)
 {
     $element = $context ?: $this->_rootElement;
     return Factory::getBlockFactory()->getMagentoCatalogProductGroupedAssociatedProductsListAssociatedProductsProduct($element->find(sprintf("//tr[td/input[@data-role='id' and @value='%s']]", $productId), Locator::SELECTOR_XPATH));
 }
Exemplo n.º 25
0
 /**
  * Get proceed to checkout block
  *
  * @return Link
  */
 public function getOnepageLinkBlock()
 {
     return Factory::getBlockFactory()->getMagentoCheckoutOnepageLink($this->_rootElement->find($this->onepageLinkBlock, Locator::SELECTOR_CSS));
 }
Exemplo n.º 26
0
 /**
  * Get Customer Address Edit form
  *
  * @return \Magento\Customer\Test\Block\Address\Edit
  */
 public function getEditForm()
 {
     return Factory::getBlockFactory()->getMagentoCustomerAddressEdit($this->_browser->find($this->editForm, Locator::SELECTOR_CSS));
 }