本文整理汇总了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;
});
}
示例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');
}
示例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();
}
示例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;
}
}
示例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();
}