function AjaxFormImageButtonTest::testAjaxImageButtonKeypressSpace

Same name in other branches
  1. 8.9.x core/tests/Drupal/FunctionalJavascriptTests/Ajax/AjaxFormImageButtonTest.php \Drupal\FunctionalJavascriptTests\Ajax\AjaxFormImageButtonTest::testAjaxImageButtonKeypressSpace()
  2. 10 core/tests/Drupal/FunctionalJavascriptTests/Ajax/AjaxFormImageButtonTest.php \Drupal\FunctionalJavascriptTests\Ajax\AjaxFormImageButtonTest::testAjaxImageButtonKeypressSpace()
  3. 11.x core/tests/Drupal/FunctionalJavascriptTests/Ajax/AjaxFormImageButtonTest.php \Drupal\FunctionalJavascriptTests\Ajax\AjaxFormImageButtonTest::testAjaxImageButtonKeypressSpace()

Tests image buttons can be operated with the keyboard SPACE key.

File

core/tests/Drupal/FunctionalJavascriptTests/Ajax/AjaxFormImageButtonTest.php, line 42

Class

AjaxFormImageButtonTest
Tests the Ajax image buttons work with key press events.

Namespace

Drupal\FunctionalJavascriptTests\Ajax

Code

public function testAjaxImageButtonKeypressSpace() {
    // Get a Field UI manage-display page.
    $this->drupalGet('ajax_forms_image_button_form');
    $assertSession = $this->assertSession();
    $session = $this->getSession();
    $button = $session->getPage()
        ->findButton('Edit');
    $button->keyPress(32);
    $this->assertNotEmpty($assertSession->waitForElementVisible('css', '#ajax-1-more-div'), 'Page updated after image button pressed');
}

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