You are here

public function VarbaseContext::iExpandTheSelectList in Varbase: The Ultimate Drupal CMS Starter Kit (Bootstrap Ready) 8.8

Same name and namespace in other branches
  1. 8.4 tests/features/bootstrap/VarbaseContext.php \VarbaseContext::iExpandTheSelectList()
  2. 8.5 tests/features/bootstrap/VarbaseContext.php \VarbaseContext::iExpandTheSelectList()
  3. 8.6 tests/features/bootstrap/VarbaseContext.php \VarbaseContext::iExpandTheSelectList()
  4. 8.7 tests/features/bootstrap/VarbaseContext.php \VarbaseContext::iExpandTheSelectList()
  5. 9.0.x tests/features/bootstrap/VarbaseContext.php \VarbaseContext::iExpandTheSelectList()

Expand a select list by it's class attribute.

Varbase Context #varbase.

Example #1: When I expand the "1" select list "dropbutton-multiple" Example #2: And I expand the "2" select list "Editor Styling options"

@When I expand the :nth select list :arg1

File

tests/features/bootstrap/VarbaseContext.php, line 1480

Class

VarbaseContext
Defines application features from the specific context.

Code

public function iExpandTheSelectList($index, $listClassName) {
  $js = <<<JS
    var group = document.getElementsByClassName("{<span class="php-variable">$listClassName</span>}")[{<span class="php-variable">$index</span>}];
    group.className += "open";
JS;
  $this
    ->getSession()
    ->executeScript($js);
}