@@ -153,14 +153,14 @@ public function installJoomla()
153153 $ I ->debug ('I select dk-DK as installation language ' );
154154
155155 // Select a random language to force reloading of the lang strings after selecting English
156- $ I ->selectOptionInChosen ('#jform_language ' , 'Danish (DK ) ' );
157- $ I ->waitForText ('Generel konfiguration ' , 60 , 'h3 ' );
156+ $ I ->selectOptionInChosenWithTextField ('#jform_language ' , 'Spanish (Español ) ' );
157+ $ I ->waitForText ('Configuración principal ' , 60 , 'h3 ' );
158158
159159 // Wait for chosen to render the field
160160 $ I ->debug ('I select en-GB as installation language ' );
161161 $ I ->debug ('Wait for chosen to render the Languages list field ' );
162162 $ I ->wait (2 );
163- $ I ->selectOptionInChosen ('#jform_language ' , 'English (United Kingdom) ' );
163+ $ I ->selectOptionInChosenWithTextField ('#jform_language ' , 'English (United Kingdom) ' );
164164 $ I ->waitForText ('Main Configuration ' , 60 , 'h3 ' );
165165 $ this ->debug ('I fill Site Name ' );
166166 $ I ->fillField (['id ' => 'jform_site_name ' ], 'Joomla CMS test ' );
@@ -309,7 +309,8 @@ public function setErrorReportingToDevelopment()
309309 $ this ->debug ('I wait for error reporting dropdown ' );
310310 $ I ->selectOptionInChosen ('Error Reporting ' , 'Development ' );
311311 $ this ->debug ('I click on save ' );
312- $ this ->clickToolbarButton ('save ' );
312+ //$this->clickToolbarButton('save');
313+ $ I ->click (['xpath ' => "//div[@id='toolbar-apply']//button " ]);
313314 $ this ->debug ('I wait for global configuration being saved ' );
314315 $ I ->waitForText ('Global Configuration ' , 60 , ['css ' => '.page-title ' ]);
315316 $ I ->see ('Configuration successfully saved. ' , ['id ' => 'system-message-container ' ]);
@@ -438,7 +439,7 @@ public function selectOptionInRadioField($label, $option)
438439 $ I ->click ("//fieldset[@id=' $ radioId']/label[contains(normalize-space(string(.)), ' $ option')] " );
439440 }
440441
441- /**
442+ /**
442443 * Selects an option in a Chosen Selector based on its label
443444 *
444445 * @param string $label The text in the <label> with for attribute that links to the <select> element
@@ -456,6 +457,29 @@ public function selectOptionInChosen($label, $option)
456457 $ I ->click (['xpath ' => "//div[@id=' $ chosenSelectID']/a/div/b " ]);
457458 $ this ->debug ("I select $ option " );
458459 $ I ->click (['xpath ' => "//div[@id=' $ chosenSelectID']//li[text()=' $ option'] " ]);
460+ // Gives time to chosen to close
461+ $ I ->wait (1 );
462+ }
463+
464+ /**
465+ * Selects an option in a Chosen Selector based on its label with filling the textfield
466+ *
467+ * @param string $label The text in the <label> with for attribute that links to the <select> element
468+ * @param string $option The text in the <option> to be selected in the chosen selector
469+ *
470+ * @return void
471+ */
472+ public function selectOptionInChosenWithTextField ($ label , $ option )
473+ {
474+ $ select = $ this ->findField ($ label );
475+ $ selectID = $ select ->getAttribute ('id ' );
476+ $ chosenSelectID = $ selectID . '_chzn ' ;
477+ $ I = $ this ;
478+ $ this ->debug ("I open the $ label chosen selector " );
479+ $ I ->click (['css ' => 'div# ' .$ chosenSelectID ]);
480+ $ this ->debug ("I select $ option " );
481+ $ I ->fillField (['xpath ' => "//div[@id=' $ chosenSelectID']/div/div/input " ], $ option );
482+ $ I ->click (['xpath ' => "//div[@id=' $ chosenSelectID']/div/ul/li[1] " ]);
459483
460484 // Gives time to chosen to close
461485 $ I ->wait (1 );
0 commit comments