當前位置: 首頁>>代碼示例>>PHP>>正文


PHP NodeElement::click方法代碼示例

本文整理匯總了PHP中Behat\Mink\Element\NodeElement::click方法的典型用法代碼示例。如果您正苦於以下問題:PHP NodeElement::click方法的具體用法?PHP NodeElement::click怎麽用?PHP NodeElement::click使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Behat\Mink\Element\NodeElement的用法示例。


在下文中一共展示了NodeElement::click方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: replyComment

 /**
  * @param NodeElement $comment
  * @param string      $message
  *
  * @throws \LogicException
  */
 public function replyComment(NodeElement $comment, $message)
 {
     $comment->click();
     $replyBox = $this->getElement('Comment threads')->find('css', 'li.reply-to-comment');
     if (!$replyBox) {
         throw new \LogicException('Comment reply box not found !');
     }
     $textarea = $replyBox->find('css', 'textarea');
     if (!$textarea) {
         throw new \LogicException('Comment reply textarea not found !');
     }
     $textarea->setValue($message);
     $this->spin(function () use($replyBox) {
         $replyBox->find('css', '.send-comment')->click();
         return true;
     });
 }
開發者ID:noglitchyo,項目名稱:pim-community-dev,代碼行數:23,代碼來源:Edit.php

示例2: replyComment

 /**
  * @param NodeElement $comment
  * @param string      $message
  *
  * @throws \LogicException
  */
 public function replyComment(NodeElement $comment, $message)
 {
     $comment->click();
     $replyBox = $this->getElement('Comment threads')->find('css', 'li.comment-reply-action.toggle-active');
     if (!$replyBox) {
         throw new \LogicException('Comment reply box not found !');
     }
     $textarea = $replyBox->find('css', 'textarea');
     if (!$textarea) {
         throw new \LogicException('Comment reply textarea not found !');
     }
     $textarea->setValue($message);
     $replyBox->pressButton('Reply');
 }
開發者ID:ashutosh-srijan,項目名稱:findit_akeneo,代碼行數:20,代碼來源:Edit.php

示例3: testClick

 public function testClick()
 {
     $node = new NodeElement('link_or_button', $this->session);
     $this->driver->expects($this->once())->method('click')->with('link_or_button');
     $node->click();
 }
開發者ID:jordi12100,項目名稱:Mink,代碼行數:6,代碼來源:NodeElementTest.php

示例4: interactWithElement

 /**
  * Applies a specific action to an element
  *
  * @param NodeElement $element Element to act on
  * @param string $action Action, which may be one of 'hover', 'double click', 'right click', or 'left click'
  * The default 'click' behaves the same as left click
  */
 protected function interactWithElement($element, $action = 'click')
 {
     switch ($action) {
         case 'hover':
             $element->mouseOver();
             break;
         case 'double click':
             $element->doubleClick();
             break;
         case 'right click':
             $element->rightClick();
             break;
         case 'left click':
         case 'click':
         default:
             $element->click();
             break;
     }
 }
開發者ID:aaronleslie,項目名稱:aaronunix,代碼行數:26,代碼來源:CmsUiContext.php

示例5: toggleResource

 /**
  * @param NodeElement $resource
  */
 public function toggleResource(NodeElement $resource)
 {
     $groupTitleElement = $this->spin(function () use($resource) {
         return $resource->getParent()->getParent()->getParent()->find('css', 'h3');
     }, 'Group title not found for resource.');
     $groupTitle = $groupTitleElement->getHtml();
     $this->navigateToGroup($groupTitle);
     $this->spin(function () use($resource) {
         return $resource->isVisible();
     }, sprintf('Resource is not visible on the group %s.', $groupTitle));
     $resource->click();
 }
開發者ID:a2xchip,項目名稱:pim-community-dev,代碼行數:15,代碼來源:PermissionDecorator.php


注:本文中的Behat\Mink\Element\NodeElement::click方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。