Same filename and directory in other branches
- 8.9.x core/tests/Drupal/FunctionalJavascriptTests/Ajax/AjaxFormImageButtonTest.php
- 9 core/tests/Drupal/FunctionalJavascriptTests/Ajax/AjaxFormImageButtonTest.php
Namespace
Drupal\FunctionalJavascriptTests\Ajax
File
core/tests/Drupal/FunctionalJavascriptTests/Ajax/AjaxFormImageButtonTest.php
View source
<?php
declare (strict_types=1);
namespace Drupal\FunctionalJavascriptTests\Ajax;
use Drupal\FunctionalJavascriptTests\WebDriverTestBase;
class AjaxFormImageButtonTest extends WebDriverTestBase {
protected static $modules = [
'ajax_forms_test',
];
protected $defaultTheme = 'stark';
public function testAjaxImageButtonKeypressEnter() {
$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');
}
public function testAjaxImageButtonKeypressSpace() {
$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');
}
}
Classes