当前位置: 首页>>代码示例>>PHP>>正文


PHP Element\SimpleElement类代码示例

本文整理汇总了PHP中Magento\Mtf\Client\Element\SimpleElement的典型用法代码示例。如果您正苦于以下问题:PHP SimpleElement类的具体用法?PHP SimpleElement怎么用?PHP SimpleElement使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了SimpleElement类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: fillFormTab

 /**
  * Fill condition options
  *
  * @param array $fields
  * @param SimpleElement|null $element
  * @return void
  */
 public function fillFormTab(array $fields, SimpleElement $element = null)
 {
     $data = $this->dataMapping($fields);
     $conditionsBlock = Factory::getBlockFactory()->getMagentoCatalogRuleConditions($element->find($this->ruleConditions));
     $conditionsBlock->clickAddNew();
     $conditionsBlock->selectCondition($data['condition_type']['value']);
     $conditionsBlock->clickEllipsis();
     $conditionsBlock->selectConditionValue($data['condition_value']['value']);
 }
开发者ID:shabbirvividads,项目名称:magento2,代码行数:16,代码来源:Conditions.php

示例2: getDataOptions

 /**
  * Get data options from 'Tier price' form.
  *
  * @param array $fields
  * @param SimpleElement|null $element
  * @return array
  */
 public function getDataOptions(array $fields = null, SimpleElement $element = null)
 {
     $data = [];
     if (isset($fields['value']) && is_array($fields['value'])) {
         foreach ($fields['value'] as $key => $option) {
             $data[$key++] = parent::getDataOptions($option, $element->find('tbody tr:nth-child(' . $key . ')'));
         }
     }
     return $data;
 }
开发者ID:Doability,项目名称:magento2dev,代码行数:17,代码来源:OptionTier.php

示例3: getRatingVote

 /**
  * Get rating vote
  *
  * @param SimpleElement $rating
  * @return int
  */
 protected function getRatingVote(SimpleElement $rating)
 {
     $ratingVote = 5;
     $ratingVoteElement = $rating->find(sprintf($this->checkedRating, $ratingVote));
     while (!$ratingVoteElement->isVisible() && $ratingVote) {
         --$ratingVote;
         $ratingVoteElement = $rating->find(sprintf($this->checkedRating, $ratingVote));
     }
     return $ratingVote;
 }
开发者ID:andrewhowdencom,项目名称:m2onk8s,代码行数:16,代码来源:RatingElement.php

示例4: fillFormTab

 /**
  * Fill data to fields on tab
  *
  * @param array $fields
  * @param SimpleElement|null $element
  * @return $this
  */
 public function fillFormTab(array $fields, SimpleElement $element = null)
 {
     if (isset($fields['grouped_products'])) {
         foreach ($fields['grouped_products']['value'] as $groupedProduct) {
             $element->find($this->addNewOption)->click();
             $searchBlock = $this->getSearchGridBlock();
             $searchBlock->searchAndSelect($groupedProduct['search_data']);
             $searchBlock->addProducts();
             $this->getListAssociatedProductsBlock()->fillProductOptions($groupedProduct['data']);
         }
     }
     return $this;
 }
开发者ID:andrewhowdencom,项目名称:m2onk8s,代码行数:20,代码来源:AssociatedProducts.php

示例5: fillFormTab

 /**
  * Fill data to fields on tab
  *
  * @param array $fields
  * @param SimpleElement|null $element
  * @return $this
  */
 public function fillFormTab(array $fields, SimpleElement $element = null)
 {
     if (isset($fields['associated'])) {
         $options = $this->_rootElement->getElements($this->deleteButton);
         if (count($options)) {
             foreach (array_reverse($options) as $option) {
                 $option->click();
             }
         }
         foreach ($fields['associated']['value']['assigned_products'] as $key => $groupedProduct) {
             $element->find($this->addNewOption)->click();
             $searchBlock = $this->getSearchGridBlock();
             $searchBlock->searchAndSelect(['name' => $groupedProduct['name']]);
             $searchBlock->addProducts();
             $this->getListAssociatedProductsBlock()->fillProductOptions($groupedProduct, $key + 1);
         }
     }
     return $this;
 }
开发者ID:kid17,项目名称:magento2,代码行数:26,代码来源:AssociatedProducts.php

示例6: getRequestDetails

 /**
  * Return request details.
  *
  * @param SimpleElement $context
  * @return array
  */
 protected function getRequestDetails(SimpleElement $context)
 {
     $mapping = $this->dataMapping();
     $mappingDetails = $mapping['details']['value'];
     $data = [];
     unset($mappingDetails['composite']);
     foreach ($mappingDetails as $fieldName => $locator) {
         $element = $context->find($locator['selector'], $locator['strategy']);
         if ($element->isVisible()) {
             $data[$fieldName] = trim($element->getText());
         }
     }
     if (isset($data['entity_id'])) {
         $data['entity_id'] = str_replace('#', '', $data['entity_id']);
     }
     if (isset($data['order_id'])) {
         $data['order_id'] = str_replace('#', '', $data['order_id']);
     }
     return $data;
 }
开发者ID:hientruong90,项目名称:ee_14_installer,代码行数:26,代码来源:General.php

示例7: fillFormTab

 /**
  * Fill data to content fields on content tab.
  *
  * @param array $fields
  * @param SimpleElement|null $element
  * @return $this
  */
 public function fillFormTab(array $fields, SimpleElement $element = null)
 {
     $element->find($this->content)->setValue($fields['content']['value']['content']);
     if (isset($fields['content_heading']['value'])) {
         $element->find($this->contentHeading)->setValue($fields['content_heading']['value']);
     }
     if (isset($fields['content']['value']['widget']['dataset'])) {
         foreach ($fields['content']['value']['widget']['dataset'] as $widget) {
             $this->clickInsertWidget();
             $this->getWidgetBlock()->addWidget($widget);
         }
     }
     if (isset($fields['content']['value']['variable'])) {
         $this->clickInsertVariable();
         $config = $this->getWysiwygConfig();
         $config->selectVariableByName($fields['content']['value']['variable']);
     }
     return $this;
 }
开发者ID:nja78,项目名称:magento2,代码行数:26,代码来源:Content.php

示例8: clickPayNow

 /**
  * Click "Pay Now" button.
  *
  * @param SimpleElement $element
  * @return void
  */
 public function clickPayNow(SimpleElement $element)
 {
     $element->find($this->continue)->click();
     $this->browser->selectWindow();
 }
开发者ID:hientruong90,项目名称:ee_14_installer,代码行数:11,代码来源:Form.php

示例9: assignProduct

 /**
  * Assign product to variation matrix
  *
  * @param SimpleElement $variationRow
  * @param int $productId
  * @return void
  */
 protected function assignProduct(SimpleElement $variationRow, $productId)
 {
     $variationRow->find($this->configurableAttribute)->click();
     $this->getTemplateBlock()->waitLoader();
     $this->_rootElement->find(sprintf($this->selectAssociatedProduct, $productId), Locator::SELECTOR_XPATH)->click();
 }
开发者ID:shabbirvividads,项目名称:magento2,代码行数:13,代码来源:Matrix.php

示例10: getOptionalFields

 /**
  * Get optional fields
  *
  * @param SimpleElement $context
  * @param array $fields
  * @return array
  */
 protected function getOptionalFields(SimpleElement $context, array $fields = [])
 {
     $data = [];
     $fields = empty($fields) ? $this->mappingGetFields : $fields;
     foreach ($fields as $name => $params) {
         $data[$name] = $context->find($params['selector'], $params['strategy'])->getText();
     }
     return $data;
 }
开发者ID:koliaGI,项目名称:magento2,代码行数:16,代码来源:Attribute.php

示例11: checkHtmlTagStructure

 /**
  * Find <tag1><tag2><tagN> ... </tagN></tag2></tag1> tag structure in element.
  *
  * @param SimpleElement $element
  * @param string $selector
  * @return SimpleElement
  */
 protected function checkHtmlTagStructure(SimpleElement $element, $selector)
 {
     return $element->find($selector);
 }
开发者ID:kidaa30,项目名称:magento2-platformsh,代码行数:11,代码来源:Additional.php

示例12: getPriceFromPage

 /**
  * Get price from page.
  *
  * @param SimpleElement $infoBlock
  * @param string $currency
  * @param string $selector
  * @return string
  */
 protected function getPriceFromPage(SimpleElement $infoBlock, $currency, $selector)
 {
     return $this->preparePrice($infoBlock->find($selector, Locator::SELECTOR_XPATH)->getText(), $currency);
 }
开发者ID:hientruong90,项目名称:ee_14_installer,代码行数:12,代码来源:ListCompare.php

示例13: clickAddNewButton

 /**
  * Click 'Add New' button.
  *
  * @param SimpleElement $element
  * @return void
  */
 protected function clickAddNewButton(SimpleElement $element)
 {
     $element->waitUntil(function () use($element) {
         return $element->find($this->addNewButton)->isVisible() ? true : null;
     });
     $element->find($this->addNewButton)->click();
 }
开发者ID:andrewhowdencom,项目名称:m2onk8s,代码行数:13,代码来源:Form.php

示例14: fillFormTab

 /**
  * Fill data to labels fields on labels tab.
  *
  * @param array $fields
  * @param Element|null $element
  * @return $this
  */
 public function fillFormTab(array $fields, Element $element = null)
 {
     if (isset($fields['store_labels'])) {
         $count = 0;
         foreach ($fields['store_labels']['value'] as $storeLabel) {
             $element->find(sprintf(self::STORE_LABEL_NAME, $count))->setValue($storeLabel);
             ++$count;
         }
     }
     return $this;
 }
开发者ID:hientruong90,项目名称:ee_14_installer,代码行数:18,代码来源:Labels.php

示例15: __construct

 /**
  * @constructor
  * @param DriverInterface $driver
  * @param EventManagerInterface $eventManager
  * @param Locator $locator
  * @param ElementInterface $context
  */
 public function __construct(DriverInterface $driver, EventManagerInterface $eventManager, Locator $locator, ElementInterface $context = null)
 {
     parent::__construct($driver, $eventManager, $locator, $context);
     $this->attributeLabel = $this->getAttributeLabelFromPage();
 }
开发者ID:chucky515,项目名称:Magento-CE-Mirror,代码行数:12,代码来源:CustomAttribute.php


注:本文中的Magento\Mtf\Client\Element\SimpleElement类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。