Issue #2996404 by andrewmacpherson, Krzysztof Domański: Replace old keypress workaround in AjaxFormImageButtonTest
parent
b6a04ed1f8
commit
944b157e5b
|
@ -19,22 +19,14 @@ class AjaxFormImageButtonTest extends WebDriverTestBase {
|
|||
/**
|
||||
* Tests image buttons can be operated with the keyboard ENTER key.
|
||||
*/
|
||||
public function testAjaxImageButton() {
|
||||
public function testAjaxImageButtonKeypressEnter() {
|
||||
// Get a Field UI manage-display page.
|
||||
$this->drupalGet('ajax_forms_image_button_form');
|
||||
$assertSession = $this->assertSession();
|
||||
$session = $this->getSession();
|
||||
|
||||
$enter_key_event = <<<JS
|
||||
jQuery('#edit-image-button')
|
||||
.trigger(jQuery.Event('keypress', {
|
||||
which: 13
|
||||
}));
|
||||
JS;
|
||||
// PhantomJS driver has buggy behavior with key events, we send a JavaScript
|
||||
// key event instead.
|
||||
// @todo: use WebDriver event when we remove PhantomJS driver.
|
||||
$session->executeScript($enter_key_event);
|
||||
$button = $session->getPage()->findButton('Edit');
|
||||
$button->keyPress(13);
|
||||
|
||||
$this->assertNotEmpty($assertSession->waitForElementVisible('css', '#ajax-1-more-div'), 'Page updated after image button pressed');
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue