function JSInteractionTest::testElementsInteraction

Same name and namespace in other branches
  1. 10 core/tests/Drupal/FunctionalJavascriptTests/Tests/JSInteractionTest.php \Drupal\FunctionalJavascriptTests\Tests\JSInteractionTest::testElementsInteraction()
  2. 11.x core/tests/Drupal/FunctionalJavascriptTests/Tests/JSInteractionTest.php \Drupal\FunctionalJavascriptTests\Tests\JSInteractionTest::testElementsInteraction()

Assert no exception is thrown when elements become interactive.

File

core/tests/Drupal/FunctionalJavascriptTests/Tests/JSInteractionTest.php, line 48

Class

JSInteractionTest
Tests fault tolerant interactions.

Namespace

Drupal\FunctionalJavascriptTests\Tests

Code

public function testElementsInteraction() {
    $this->drupalGet('/js_interaction_test');
    // Remove blocking element after 100 ms.
    $this->clickLink('Remove Blocker Trigger');
    $this->clickLink('Target link');
    // Enable field after 100 ms.
    $this->clickLink('Enable Field Trigger');
    $this->assertSession()
        ->fieldExists('target_field')
        ->setValue('Test');
    $this->assertSession()
        ->fieldValueEquals('target_field', 'Test');
}

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