Skip to content
Merged
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
51 changes: 51 additions & 0 deletions src/JoomlaBrowser.php
Original file line number Diff line number Diff line change
Expand Up @@ -571,4 +571,55 @@ private function searchResultLanguageName($languageName)

return $xpath;
}

/**
* Publishes a module on all frontend pages
*
* @param string $module The full name of the module
* @param string $position The template position of a module. Right position by default
*/
public function setModulePosition($module, $position = 'position-7')
{
$I = $this;
$I->amOnPage('administrator/index.php?option=com_modules');
$I->searchForItem($module);
$I->click(['link' => $module]);
$I->selectOptionInChosen('Position', $position);
$I->click(['xpath' => "//div[@id='toolbar-apply']/button"]);
$I->waitForText('Module successfully saved',30,['id' => 'system-message-container']);
}

/**
* Publishes a module on all frontend pages
*
* @param string $module The full name of the module
*/
public function publishModule($module)
{
$I = $this;
$I->amOnPage('administrator/index.php?option=com_modules');
$I->searchForItem($module);
$I->checkAllResults();
$I->click(['xpath' => "//div[@id='toolbar-publish']/button"]);
$I->waitForText('1 module successfully published.',30,['id' => 'system-message-container']);
}

/**
* Changes the module Menu assignment to be shown on all the pages of the website
*
* @param string $module The full name of the module
*/
public function displayModuleOnAllPages($module)
{
$I = $this;
$I->amOnPage('administrator/index.php?option=com_modules');
$I->searchForItem($module);
$I->click(['link' => $module]);
$I->click(['link' => 'Menu Assignment']);
$I->waitForElement(['id' => 'jform_menus-lbl'], 30);
$I->click(['id' => 'jform_assignment_chzn']);
$I->click(['xpath' => "//li[@data-option-array-index='0']"]);
$I->click(['xpath' => "//div[@id='toolbar-apply']/button"]);
$I->waitForText('Module successfully saved',30,['id' => 'system-message-container']);
}
}