File tree Expand file tree Collapse file tree 2 files changed +26
-1
lines changed Expand file tree Collapse file tree 2 files changed +26
-1
lines changed Original file line number Diff line number Diff line change @@ -33,7 +33,8 @@ In between the available functions you can find:
3333 * do frontend login
3434* ADMINISTRATOR USER INTERFACE:
3535 * select option in chosen
36- * selectOptionInRadioField
36+ * select Option In Radio Field
37+ * select Multiple Options In Chosen
3738* OTHERS:
3839 * check for php notices or warnings
3940
Original file line number Diff line number Diff line change @@ -345,6 +345,30 @@ public function selectOptionInChosen($label, $option)
345345 $ I ->wait (1 ); // Gives time to chosen to close
346346 }
347347
348+ /**
349+ * Selects one or more options in a Chosen Multiple Select based on its label
350+ *
351+ * @param string $label Label of the select field
352+ * @param array $options Array of options to be selected
353+ *
354+ * @return void
355+ */
356+ public function selectMultipleOptionsInChosen ($ label , $ options )
357+ {
358+ $ select = $ this ->findField ($ label );
359+ $ selectID = $ select ->getAttribute ('id ' );
360+ $ chosenSelectID = $ selectID . '_chzn ' ;
361+ $ I = $ this ;
362+ foreach ($ options as $ option )
363+ {
364+ $ this ->debug ("I open the $ label chosen selector " );
365+ $ I ->click (['xpath ' => "//div[@id=' $ chosenSelectID']/ul " ]);
366+ $ this ->debug ("I select $ option " );
367+ $ I ->click (['xpath ' => "//div[@id=' $ chosenSelectID']//li[contains(text()[normalize-space()], ' $ option')] " ]);
368+ $ I ->wait (1 ); // Gives time to chosen to close
369+ }
370+ }
371+
348372 /**
349373 * Function to Logout from Administrator Panel in Joomla!
350374 *
You can’t perform that action at this time.
0 commit comments