
| Current Path : /var/www/html/12park/web/modules/contrib/webform/tests/src/Traits/ |
Linux ift1.ift-informatik.de 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64 |
| Current File : /var/www/html/12park/web/modules/contrib/webform/tests/src/Traits/WebformWebDriverTestTrait.php |
<?php
namespace Drupal\Tests\webform\Traits;
use Drupal\Component\Serialization\Json;
/**
* Provides convenience methods for webform assertions in browser tests.
*/
trait WebformWebDriverTestTrait {
/**
* Execute jQuery event.
*
* @param string $selector
* Selector to trigger the event on.
* @param string $event_type
* The event type.
* @param array $event_options
* The event options.
*/
public function executeJqueryEvent($selector, $event_type, array $event_options = []) {
$event_options = Json::encode($event_options);
$script = "jQuery('$selector').trigger(jQuery.Event('$event_type', $event_options));";
$this->getSession()->executeScript($script);
}
}