function JSInteractionTest::testFieldValueNotSettable

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

Assert an exception is thrown when the field is never enabled.

File

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

Class

JSInteractionTest
Tests fault tolerant interactions.

Namespace

Drupal\FunctionalJavascriptTests\Tests

Code

public function testFieldValueNotSettable() {
    $this->expectException(Exception::class);
    $this->drupalGet('/js_interaction_test');
    $this->assertSession()
        ->fieldExists('target_field')
        ->setValue('Test');
}

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