function JSInteractionTest::testNotClickable

Same name in other branches
  1. 9 core/tests/Drupal/FunctionalJavascriptTests/Tests/JSInteractionTest.php \Drupal\FunctionalJavascriptTests\Tests\JSInteractionTest::testNotClickable()
  2. 11.x core/tests/Drupal/FunctionalJavascriptTests/Tests/JSInteractionTest.php \Drupal\FunctionalJavascriptTests\Tests\JSInteractionTest::testNotClickable()

Assert an exception is thrown when the blocker element is never removed.

File

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

Class

JSInteractionTest
Tests fault tolerant interactions.

Namespace

Drupal\FunctionalJavascriptTests\Tests

Code

public function testNotClickable() : void {
    $this->expectException(Exception::class);
    $this->drupalGet('/js_interaction_test');
    $this->assertSession()
        ->elementExists('named', [
        'link',
        'Target link',
    ])
        ->click();
}

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