本文整理汇总了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']);
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例8: clickPayNow
/**
* Click "Pay Now" button.
*
* @param SimpleElement $element
* @return void
*/
public function clickPayNow(SimpleElement $element)
{
$element->find($this->continue)->click();
$this->browser->selectWindow();
}
示例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();
}
示例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;
}
示例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);
}
示例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);
}
示例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();
}
示例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;
}
示例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();
}