class AjaxFormImageButtonTest
Same name and namespace in other branches
- 11.x core/tests/Drupal/FunctionalJavascriptTests/Ajax/AjaxFormImageButtonTest.php \Drupal\FunctionalJavascriptTests\Ajax\AjaxFormImageButtonTest
Tests the Ajax image buttons work with key press events.
@group Ajax
Hierarchy
- class \Drupal\Tests\BrowserTestBase uses \Drupal\Core\Test\FunctionalTestSetupTrait, \Drupal\Tests\UiHelperTrait, \Drupal\Core\Test\TestSetupTrait, \Drupal\Tests\block\Traits\BlockCreationTrait, \Drupal\FunctionalTests\AssertLegacyTrait, \Drupal\Tests\RandomGeneratorTrait, \Drupal\Tests\node\Traits\NodeCreationTrait, \Drupal\Tests\node\Traits\ContentTypeCreationTrait, \Drupal\Tests\ConfigTestTrait, \Drupal\Tests\TestRequirementsTrait, \Drupal\Tests\user\Traits\UserCreationTrait, \Drupal\Tests\XdebugRequestTrait, \Drupal\Tests\Traits\PhpUnitWarnings, \Drupal\Tests\PhpUnitCompatibilityTrait, \Symfony\Bridge\PhpUnit\ExpectDeprecationTrait, \Drupal\Tests\ExtensionListTestTrait implements \PHPUnit\Framework\TestCase
- class \Drupal\FunctionalJavascriptTests\WebDriverTestBase implements \Drupal\Tests\BrowserTestBase
- class \Drupal\FunctionalJavascriptTests\Ajax\AjaxFormImageButtonTest implements \Drupal\FunctionalJavascriptTests\WebDriverTestBase
- class \Drupal\FunctionalJavascriptTests\WebDriverTestBase implements \Drupal\Tests\BrowserTestBase
Expanded class hierarchy of AjaxFormImageButtonTest
File
-
core/
tests/ Drupal/ FunctionalJavascriptTests/ Ajax/ AjaxFormImageButtonTest.php, line 12
Namespace
Drupal\FunctionalJavascriptTests\AjaxView source
class AjaxFormImageButtonTest extends WebDriverTestBase {
/**
* {@inheritdoc}
*/
protected static $modules = [
'ajax_forms_test',
];
/**
* {@inheritdoc}
*/
protected $defaultTheme = 'stark';
/**
* 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();
$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.