File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -217,4 +217,24 @@ public function checkForPhpNoticesOrWarnings($page = null)
217217 $ I ->dontSeeInPageSource ('Notice: ' );
218218 $ I ->dontSeeInPageSource ('Warning: ' );
219219 }
220+
221+ /**
222+ * Selects an option in a Chosen Selector based on its label
223+ *
224+ * @return void
225+ */
226+ public function selectOptionInChosen ($ label , $ option )
227+ {
228+ $ select = $ this ->findField ($ label );
229+ $ this ->debug ($ select );
230+ $ selectID = $ select ->getAttribute ('id ' );
231+ $ this ->debug ($ selectID );
232+ $ chosenSelectID = $ selectID . '_chzn ' ;
233+ $ this ->debug ($ chosenSelectID );
234+ $ I = $ this ;
235+ $ this ->debug ("I open the $ label chosen selector " );
236+ $ I ->click (['xpath ' => "//div[@id=' $ chosenSelectID']/a/div/b " ]);
237+ $ this ->debug ("I select $ option " );
238+ $ I ->click (['xpath ' => "//div[@id=' $ chosenSelectID']//li[text()=' $ option'] " ]);
239+ }
220240}
You can’t perform that action at this time.
0 commit comments