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


PHP NodeElement::getXpath方法代码示例

本文整理汇总了PHP中Behat\Mink\Element\NodeElement::getXpath方法的典型用法代码示例。如果您正苦于以下问题:PHP NodeElement::getXpath方法的具体用法?PHP NodeElement::getXpath怎么用?PHP NodeElement::getXpath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Behat\Mink\Element\NodeElement的用法示例。


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

示例1: __construct

 public function __construct(NodeElement $node, Session $session)
 {
     if (!$node->hasClass(self::NOTICE_CLASS)) {
         throw new \InvalidArgumentException(sprintf('Provided node does not have class %s', self::NOTICE_CLASS));
     }
     parent::__construct($node->getXpath(), $session);
 }
开发者ID:stephenharris,项目名称:WordPressBehatExtension,代码行数:7,代码来源:Notice.php

示例2: fromNodeElement

 /**
  * Creates Element instance based on existing NodeElement instance.
  *
  * @param NodeElement  $node_element Node element.
  * @param IPageFactory $page_factory Page factory.
  *
  * @return static
  * @throws ElementException When page factory is missing.
  */
 public static function fromNodeElement(NodeElement $node_element, IPageFactory $page_factory = null)
 {
     if (!isset($page_factory)) {
         throw new ElementException('Page factory is required to create this element', ElementException::TYPE_PAGE_FACTORY_REQUIRED);
     }
     $selenium_selector = array(How::XPATH => $node_element->getXpath());
     return new static($selenium_selector, $page_factory);
 }
开发者ID:eltonoliveira,项目名称:qa-tools,代码行数:17,代码来源:AbstractElementContainer.php

示例3: setNode

 /**
  * @param NodeElement $node
  */
 public function setNode(NodeElement $node)
 {
     $this->node = $node;
     $this->setXpath($node->getXpath());
     $this->visible = $node->isVisible();
     $id = $node->getAttribute('id');
     if ($id) {
         $this->setId($id);
     }
     $classes = $node->getAttribute('class');
     if ($classes) {
         $this->classes = explode(' ', $classes);
     }
     $this->attributes = self::parseAttribs($node);
 }
开发者ID:dafik,项目名称:cc-tests-reverse,代码行数:18,代码来源:Element.php

示例4: testGetXpath

 public function testGetXpath()
 {
     $node = new NodeElement('some custom xpath', $this->session);
     $this->assertEquals('some custom xpath', $node->getXpath());
     $this->assertNotEquals('not some custom xpath', $node->getXpath());
 }
开发者ID:jordi12100,项目名称:Mink,代码行数:6,代码来源:NodeElementTest.php

示例5: fromNodeElement

 /**
  * Creates Element instance based on existing NodeElement instance.
  *
  * @param NodeElement  $node_element Node element.
  * @param IPageFactory $page_factory Page factory.
  *
  * @return static
  */
 public static function fromNodeElement(NodeElement $node_element, IPageFactory $page_factory = null)
 {
     $selenium_selector = array(How::XPATH => $node_element->getXpath());
     return new static($selenium_selector, $node_element->getSession());
 }
开发者ID:eltonoliveira,项目名称:qa-tools,代码行数:13,代码来源:WebElement.php

示例6: dragElementTo

 /**
  * Drags an element on another one.
  * Works better than the standard dragTo.
  *
  * @param NodeElement $element
  * @param NodeElement $dropZone
  */
 public function dragElementTo(NodeElement $element, NodeElement $dropZone)
 {
     $session = $this->getSession()->getDriver()->getWebDriverSession();
     $from = $session->element('xpath', $element->getXpath());
     $to = $session->element('xpath', $dropZone->getXpath());
     $session->moveto(['element' => $from->getID()]);
     $session->buttondown('');
     $session->moveto(['element' => $to->getID()]);
     $session->buttonup('');
 }
开发者ID:aml-bendall,项目名称:ExpandAkeneoApi,代码行数:17,代码来源:Base.php

示例7: __construct

 /**
  * A bit of a hack, we require the Session to create instances of WPTableRow, so we store it here
  * @param NodeElement $node
  * @param Session $session
  */
 public function __construct(NodeElement $node, Session $session)
 {
     parent::__construct($node->getXpath(), $session);
     $this->session = $session;
 }
开发者ID:stephenharris,项目名称:WordPressBehatExtension,代码行数:10,代码来源:WPTableRow.php

示例8: executeJsOnElement

 /**
  * @param NodeElement $element
  * @param string $script
  *
  * @example
  * $this->executeJsOnElement($this->element('*', 'Meta tags'), 'return jQuery({{ELEMENT}}).text();');
  * $this->executeJsOnElement($this->element('*', '#menu'), '{{ELEMENT}}.focus();');
  *
  * @throws \Exception
  *
  * @return mixed
  */
 public function executeJsOnElement(NodeElement $element, $script)
 {
     $session = $this->getWebDriverSession();
     // We need to trigger something with "withSyn" method, because, otherwise an element won't be found.
     $element->focus();
     $this->processJavaScript($script)->debug([$script]);
     return $session->execute(['script' => str_replace('{{ELEMENT}}', 'arguments[0]', $script), 'args' => [['ELEMENT' => $session->element('xpath', $element->getXpath())->getID()]]]);
 }
开发者ID:arrrtem,项目名称:TqExtension,代码行数:20,代码来源:RawTqContext.php


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