File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -571,4 +571,28 @@ private function searchResultLanguageName($languageName)
571571
572572 return $ xpath ;
573573 }
574+
575+ /**
576+ * Publishes a module on all frontend pages
577+ *
578+ * @param string $module The name of the module
579+ * @param string $position The template position where to publish the module. Right position by default
580+ */
581+ public function publishModuleOnAllPages ($ module , $ position = 'position-7 ' )
582+ {
583+ $ I = $ this ;
584+ $ I ->amOnPage ('administrator/index.php?option=com_modules ' );
585+ $ I ->searchForItem ($ module );
586+ $ I ->checkAllResults ();
587+ $ I ->click (['xpath ' => "//div[@id='toolbar-publish']/button " ]);
588+ $ I ->waitForText ('1 module successfully published. ' ,30 ,['id ' => 'system-message-container ' ]);
589+ $ I ->click (['link ' => $ module ]);
590+ $ I ->selectOptionInChosen ('Position ' , $ position );
591+ $ I ->click (['link ' => 'Menu Assignment ' ]);
592+ $ I ->waitForElement (['id ' => 'jform_menus-lbl ' ], 30 );
593+ $ I ->click (['id ' => 'jform_assignment_chzn ' ]);
594+ $ I ->click (['xpath ' => "//li[@data-option-array-index='0'] " ]);
595+ $ I ->click (['xpath ' => "//div[@id='toolbar-apply']/button " ]);
596+ $ I ->waitForText ('Module successfully saved ' ,30 ,['id ' => 'system-message-container ' ]);
597+ }
574598}
You can’t perform that action at this time.
0 commit comments