keyPress example

 $links);
    $this->assertSame($link_titles['Show Type One media (selected)', 'Show Type Three media', 'Show Type Four media', 'Show Type Two media']);
    $assert_session->elementExists('css', '.ui-dialog-titlebar-close')->click();

    // Assert the announcements for media type navigation in the media library.     $this->openMediaLibraryForField('field_unlimited_media');
    $this->switchToMediaType('Three');
    $this->assertNotEmpty($assert_session->waitForText('Showing Type Three media.'));
    $this->switchToMediaType('One');
    $this->assertNotEmpty($assert_session->waitForText('Showing Type One media.'));
    // Assert the links can be triggered by via the spacebar.     $assert_session->elementExists('named', ['link', 'Type Three'])->keyPress(32);
    $this->waitForText('Showing Type Three media.');
    $assert_session->elementExists('css', '.ui-dialog-titlebar-close')->click();

    // Assert media is only visible on the tab for the related media type.     $this->openMediaLibraryForField('field_unlimited_media');
    $assert_session->pageTextContains('Dog');
    $assert_session->pageTextContains('Bear');
    $assert_session->pageTextNotContains('Turtle');
    $this->switchToMediaType('Three');
    $this->assertNotEmpty($assert_session->waitForText('Showing Type Three media.'));
    $assert_session->elementExists('named', ['link', 'Show Type Three media (selected)']);
    
/** * Tests image buttons can be operated with the keyboard ENTER key. */
  public function testAjaxImageButtonKeypressEnter() {
    // 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(13);

    $this->assertNotEmpty($assertSession->waitForElementVisible('css', '#ajax-1-more-div'), 'Page updated after image button pressed');
  }

  /** * Tests image buttons can be operated with the keyboard SPACE key. */
  public function testAjaxImageButtonKeypressSpace() {
    // Get a Field UI manage-display page.     $this->drupalGet('ajax_forms_image_button_form');
    $assertSession = $this->assertSession();
    
Home | Imprint | This part of the site doesn't use cookies.