You are here

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

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.5 tests/features/bootstrap/VarbaseContext.php \VarbaseContext::iExpandTheSelectList()
  4. 8.6 tests/features/bootstrap/VarbaseContext.php \VarbaseContext::iExpandTheSelectList()
  5. 8.7 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 1488

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