function DrupalSelenium2Driver::dragTo

Same name in other branches
  1. 10 core/tests/Drupal/FunctionalJavascriptTests/DrupalSelenium2Driver.php \Drupal\FunctionalJavascriptTests\DrupalSelenium2Driver::dragTo()
  2. 11.x core/tests/Drupal/FunctionalJavascriptTests/DrupalSelenium2Driver.php \Drupal\FunctionalJavascriptTests\DrupalSelenium2Driver::dragTo()

File

core/tests/Drupal/FunctionalJavascriptTests/DrupalSelenium2Driver.php, line 215

Class

DrupalSelenium2Driver
Provides a driver for Selenium testing.

Namespace

Drupal\FunctionalJavascriptTests

Code

public function dragTo($sourceXpath, $destinationXpath) {
    // Ensure both the source and destination exist at this point.
    $this->getWebDriverSession()
        ->element('xpath', $sourceXpath);
    $this->getWebDriverSession()
        ->element('xpath', $destinationXpath);
    try {
        parent::dragTo($sourceXpath, $destinationXpath);
    } catch (Exception $e) {
        // Do not care if this fails for any reason. It is a source of random
        // fails. The calling code should be doing assertions on the results of
        // dragging anyway. See upstream issues:
        // - https://github.com/minkphp/MinkSelenium2Driver/issues/97
        // - https://github.com/minkphp/MinkSelenium2Driver/issues/51
    }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.