public function ThunderJavascriptTestBase::clickAjaxButtonCssSelector in Thunder 8.3
Same name and namespace in other branches
- 8.5 tests/src/FunctionalJavascript/ThunderJavascriptTestBase.php \Drupal\Tests\thunder\FunctionalJavascript\ThunderJavascriptTestBase::clickAjaxButtonCssSelector()
- 8.2 tests/src/FunctionalJavascript/ThunderJavascriptTestBase.php \Drupal\Tests\thunder\FunctionalJavascript\ThunderJavascriptTestBase::clickAjaxButtonCssSelector()
- 8.4 tests/src/FunctionalJavascript/ThunderJavascriptTestBase.php \Drupal\Tests\thunder\FunctionalJavascript\ThunderJavascriptTestBase::clickAjaxButtonCssSelector()
- 6.2.x tests/src/FunctionalJavascript/ThunderJavascriptTestBase.php \Drupal\Tests\thunder\FunctionalJavascript\ThunderJavascriptTestBase::clickAjaxButtonCssSelector()
- 6.0.x tests/src/FunctionalJavascript/ThunderJavascriptTestBase.php \Drupal\Tests\thunder\FunctionalJavascript\ThunderJavascriptTestBase::clickAjaxButtonCssSelector()
- 6.1.x tests/src/FunctionalJavascript/ThunderJavascriptTestBase.php \Drupal\Tests\thunder\FunctionalJavascript\ThunderJavascriptTestBase::clickAjaxButtonCssSelector()
Click on Ajax Button based on CSS selector.
Ajax buttons handler is triggered on "mousedown" event, so it has to be triggered over JavaScript.
Parameters
string $cssSelector: CSS selector.
bool $waitAfterAction: Flag to wait for AJAX request to finish after click.
2 calls to ThunderJavascriptTestBase::clickAjaxButtonCssSelector()
- MediaGalleryModifyTest::testAddRemove in tests/
src/ FunctionalJavascript/ MediaGalleryModifyTest.php - Test add/remove Images in Gallery.
- MediaImageModifyTest::testRemoveAdd in tests/
src/ FunctionalJavascript/ MediaImageModifyTest.php - Test add/remove image in image paragraph.
File
- tests/
src/ FunctionalJavascript/ ThunderJavascriptTestBase.php, line 224
Class
- ThunderJavascriptTestBase
- Base class for Thunder Javascript functional tests.
Namespace
Drupal\Tests\thunder\FunctionalJavascriptCode
public function clickAjaxButtonCssSelector($cssSelector, $waitAfterAction = TRUE) {
$this
->scrollElementInView($cssSelector);
$this
->getSession()
->executeScript("jQuery('{$cssSelector}').trigger('mousedown');");
if ($waitAfterAction) {
$this
->assertSession()
->assertWaitOnAjaxRequest();
}
}