You are here

public function ThunderJavascriptTestBase::expandAllTabs in Thunder 6.0.x

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

Expand all tabs on page.

It goes up to level 3 by default.

Parameters

int $maxLevel: Max depth of nested collapsed tabs.

9 calls to ThunderJavascriptTestBase::expandAllTabs()
AccessUnpublishedTest::testAccessUnpublished in tests/src/FunctionalJavascript/Integration/AccessUnpublishedTest.php
Testing integration of "access_unpublished" module.
ArticleSchedulerIntegration::testSchedulerAccess in tests/src/FunctionalJavascript/ArticleSchedulerIntegration.php
Test Creation of Article.
AutosaveFormTest::makeFormChanges in tests/src/FunctionalJavascript/Integration/AutosaveFormTest.php
Make some changes to the article.
LiveblogTest::testWithPusher in tests/src/FunctionalJavascript/Integration/LiveblogTest.php
Testing of module integration.
MetaInformationTest::checkSavedConfiguration in tests/src/FunctionalJavascript/MetaInformationTest.php
Check saved configuration on meta tag overview page.

... See full list

File

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

Class

ThunderJavascriptTestBase
Base class for Thunder Javascript functional tests.

Namespace

Drupal\Tests\thunder\FunctionalJavascript

Code

public function expandAllTabs($maxLevel = 3) {
  $jsScript = 'jQuery(\'details.js-form-wrapper.form-wrapper:not([open]) > summary\').click().length';
  $numOfOpen = $this
    ->getSession()
    ->evaluateScript($jsScript);
  $this
    ->assertSession()
    ->assertWaitOnAjaxRequest();
  for ($i = 0; $i < $maxLevel && $numOfOpen > 0; $i++) {
    $numOfOpen = $this
      ->getSession()
      ->evaluateScript($jsScript);
    $this
      ->assertSession()
      ->assertWaitOnAjaxRequest();
  }
}