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
19 changes: 7 additions & 12 deletions src/JoomlaBrowser.php
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ public function setErrorReportingToDevelopment()
$this->debug('I wait for error reporting dropdown');
$I->selectOptionInChosen('Error Reporting', 'Development');
$this->debug('I click on save');
$I->clickToolbarButton('save');
$I->click(['xpath' => "//button[@onclick=\"Joomla.submitbutton('config.save.application.apply')\"]"]);
$this->debug('I wait for global configuration being saved');
$I->waitForText('Global Configuration',60,['css' => '.page-title']);
$I->see('Configuration successfully saved.',['id' => 'system-message-container']);
Expand Down Expand Up @@ -505,7 +505,7 @@ public function enablePlugin($pluginName)
$I->waitForElement($this->searchResultPluginName($pluginName), 30);
$I->checkExistenceOf($pluginName);
$I->click(['xpath' => "//input[@id='cb0']"]);
$I->clickToolbarButton('publish');
$I->click(['xpath' => "//div[@id='toolbar-publish']/button"]);
$I->see('successfully enabled', ['id' => 'system-message-container']);
}

Expand Down Expand Up @@ -653,7 +653,7 @@ public function setModulePosition($module, $position = 'position-7')
$I->click(['link' => $module]);
$I->waitForText($module, 30, ['css' => 'H3']);
$I->selectOptionInChosen('Position', $position);
$I->clickToolbarButton('save');
$I->click(['xpath' => "//div[@id='toolbar-apply']/button"]);
$I->waitForText('Module successfully saved',30,['id' => 'system-message-container']);
}

Expand All @@ -668,7 +668,7 @@ public function publishModule($module)
$I->amOnPage('administrator/index.php?option=com_modules');
$I->searchForItem($module);
$I->checkAllResults();
$I->clickToolbarButton('publish');
$I->click(['xpath' => "//div[@id='toolbar-publish']/button"]);
$I->waitForText('1 module successfully published.',30,['id' => 'system-message-container']);
}

Expand All @@ -688,7 +688,7 @@ public function displayModuleOnAllPages($module)
$I->waitForElement(['id' => 'jform_menus-lbl'], 30);
$I->click(['id' => 'jform_assignment_chzn']);
$I->click(['xpath' => "//li[@data-option-array-index='0']"]);
$I->clickToolbarButton('save');
$I->click(['xpath' => "//div[@id='toolbar-apply']/button"]);
$I->waitForText('Module successfully saved',30,['id' => 'system-message-container']);
}

Expand All @@ -702,11 +702,6 @@ public function clickToolbarButton($button)
$I = $this;
$input = strtolower($button);

$element = $this->webDriver->findElements(WebDriverBy::linkText("Toolbar"));
if(!empty($element) && $element[0]->isDisplayed())
{
$I->click('Toolbar');
}
switch($input)
{
case "new":
Expand Down Expand Up @@ -781,7 +776,7 @@ public function createMenuItem($menuTitle, $menuCategory, $menuItem, $menu = 'Ma
$this->checkForPhpNoticesOrWarnings();

$I->debug("I click new");
$I->clickToolbarButton('new');
$I->click("New");
$I->waitForText('Menus: New Item', '60', ['css' => 'h1']);
$this->checkForPhpNoticesOrWarnings();
$I->fillField(['id' => 'jform_title'], $menuTitle);
Expand All @@ -808,7 +803,7 @@ public function createMenuItem($menuTitle, $menuCategory, $menuItem, $menu = 'Ma
$I->selectOptionInChosen('Language', $language);
$I->waitForText('Menus: New Item','30', ['css' => 'h1']);
$I->debug('I save the menu');
$I->clickToolbarButton('save');
$I->click("Save");

$I->waitForText('Menu item successfully saved', '60', ['id' => 'system-message-container']);
}
Expand Down