You are here

public function ThunderJavascriptTestBase::clickButtonCssSelector in Thunder 6.2.x

Same name and namespace in other branches
  1. 8.5 tests/src/FunctionalJavascript/ThunderJavascriptTestBase.php \Drupal\Tests\thunder\FunctionalJavascript\ThunderJavascriptTestBase::clickButtonCssSelector()
  2. 8.2 tests/src/FunctionalJavascript/ThunderJavascriptTestBase.php \Drupal\Tests\thunder\FunctionalJavascript\ThunderJavascriptTestBase::clickButtonCssSelector()
  3. 8.3 tests/src/FunctionalJavascript/ThunderJavascriptTestBase.php \Drupal\Tests\thunder\FunctionalJavascript\ThunderJavascriptTestBase::clickButtonCssSelector()
  4. 8.4 tests/src/FunctionalJavascript/ThunderJavascriptTestBase.php \Drupal\Tests\thunder\FunctionalJavascript\ThunderJavascriptTestBase::clickButtonCssSelector()
  5. 6.0.x tests/src/FunctionalJavascript/ThunderJavascriptTestBase.php \Drupal\Tests\thunder\FunctionalJavascript\ThunderJavascriptTestBase::clickButtonCssSelector()
  6. 6.1.x tests/src/FunctionalJavascript/ThunderJavascriptTestBase.php \Drupal\Tests\thunder\FunctionalJavascript\ThunderJavascriptTestBase::clickButtonCssSelector()

Click on Button based on Drupal selector (data-drupal-selector).

Parameters

\Behat\Mink\Element\DocumentElement $page: Current active page.

string $cssSelector: Drupal selector.

bool $waitAfterAction: Flag to wait for AJAX request to finish after click.

5 calls to ThunderJavascriptTestBase::clickButtonCssSelector()
InlineEntityFormTest::testGalleryCollapse in tests/src/FunctionalJavascript/Integration/InlineEntityFormTest.php
Test saving collapsed gallery paragraph.
MediaGalleryModifyTest::testAddRemove in tests/src/FunctionalJavascript/MediaGalleryModifyTest.php
Test add/remove Images in Gallery.
MediaGalleryModifyTest::testOrderChange in tests/src/FunctionalJavascript/MediaGalleryModifyTest.php
Test order change for Gallery.
MediaImageModifyTest::testRemoveAdd in tests/src/FunctionalJavascript/MediaImageModifyTest.php
Test add/remove image in image paragraph.
ThunderJavascriptTestBase::clickButtonDrupalSelector in tests/src/FunctionalJavascript/ThunderJavascriptTestBase.php
Click on Button based on Drupal selector (data-drupal-selector).

File

tests/src/FunctionalJavascript/ThunderJavascriptTestBase.php, line 210

Class

ThunderJavascriptTestBase
Base class for Thunder Javascript functional tests.

Namespace

Drupal\Tests\thunder\FunctionalJavascript

Code

public function clickButtonCssSelector(DocumentElement $page, $cssSelector, $waitAfterAction = TRUE) {
  $this
    ->scrollElementInView($cssSelector);
  $editButton = $page
    ->find('css', $cssSelector);
  $editButton
    ->click();
  if ($waitAfterAction) {
    $this
      ->assertWaitOnAjaxRequest();
  }
}