You are here

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

Same name and namespace in other branches
  1. 8.8 tests/features/bootstrap/VarbaseContext.php \VarbaseContext::iExpandTheSelectList()
  2. 8.4 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()

#varbase: To expand a select list by it's class attribute.

Example #1: I expand the "1" select list "dropbutton-multiple"

@When I expand the :nth select list :arg1

File

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

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);
}