Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Selenium2Driver.php

function Selenium2Driver::doMouseOver

2 calls to Selenium2Driver::doMouseOver()
Selenium2Driver::clickOnElement in vendor/lullabot/mink-selenium2-driver/src/Selenium2Driver.php
Selenium2Driver::mouseOver in vendor/lullabot/mink-selenium2-driver/src/Selenium2Driver.php
Simulates a mouse over on the element.

File

vendor/lullabot/mink-selenium2-driver/src/Selenium2Driver.php, line 964

Class

Selenium2Driver
Selenium2 driver.

Namespace

Behat\Mink\Driver

Code

private function doMouseOver(Element $element) : void {
    if ($this->isW3C()) {
        // Firefox needs the element in view in order to move the pointer to
        // it.
        $this->scrollElementIntoView($element);
        $actions = array(
            'actions' => [
                [
                    'type' => 'pointer',
                    'id' => 'mouse1',
                    'parameters' => [
                        'pointerType' => 'mouse',
                    ],
                    'actions' => [
                        [
                            'type' => 'pointerMove',
                            'duration' => 0,
                            'origin' => [
                                Element::WEB_ELEMENT_ID => $element->getID(),
                            ],
                            'x' => 0,
                            'y' => 0,
                        ],
                    ],
                ],
            ],
        );
        $this->getWebDriverSession()
            ->postActions($actions);
        $this->getWebDriverSession()
            ->deleteActions();
    }
    else {
        $this->getWebDriverSession()
            ->moveto(array(
            'element' => $element->getID(),
        ));
    }
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal