Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ In between the available functions you can find:
* do frontend login
* ADMINISTRATOR USER INTERFACE:
* select option in chosen
* selectOptionInRadioField
* select Option In Radio Field
* select Multiple Options In Chosen
* OTHERS:
* check for php notices or warnings

Expand Down
24 changes: 24 additions & 0 deletions src/JoomlaBrowser.php
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,30 @@ public function selectOptionInChosen($label, $option)
$I->wait(1); // Gives time to chosen to close
}

/**
* Selects one or more options in a Chosen Multiple Select based on its label
*
* @param string $label Label of the select field
* @param array $options Array of options to be selected
*
* @return void
*/
public function selectMultipleOptionsInChosen($label, $options)
{
$select = $this->findField($label);
$selectID = $select->getAttribute('id');
$chosenSelectID = $selectID . '_chzn';
$I = $this;
foreach ($options as $option)
{
$this->debug("I open the $label chosen selector");
$I->click(['xpath' => "//div[@id='$chosenSelectID']/ul"]);
$this->debug("I select $option");
$I->click(['xpath' => "//div[@id='$chosenSelectID']//li[contains(text()[normalize-space()], '$option')]"]);
$I->wait(1); // Gives time to chosen to close
}
}

/**
* Function to Logout from Administrator Panel in Joomla!
*
Expand Down