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

Breadcrumb

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

function Selenium2Driver::withSyn

Makes sure that the Syn event library has been injected into the current page, and return $this for a fluid interface,

$this->withSyn()->executeJsOnXpath($xpath, $script);

Return value

Selenium2Driver

Throws

DriverException

File

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

Class

Selenium2Driver
Selenium2 driver.

Namespace

Behat\Mink\Driver

Code

protected function withSyn() {
    $hasSyn = $this->getWebDriverSession()
        ->execute(array(
        'script' => 'return window.syn !== undefined && window.syn.trigger !== undefined',
        'args' => array(),
    ));
    if (!$hasSyn) {
        $synJs = file_get_contents(__DIR__ . '/Resources/syn.js');
        \assert($synJs !== false);
        $this->getWebDriverSession()
            ->execute(array(
            'script' => $synJs,
            'args' => array(),
        ));
    }
    return $this;
}

API Navigation

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