From 1795fd7c711a6fc83e2522ac2740e4d664456315 Mon Sep 17 00:00:00 2001 From: javier gomez Date: Mon, 8 Feb 2016 17:56:01 +0100 Subject: [PATCH] Revert "Adding a tool bar logic for smaller screen resolutions " --- src/JoomlaBrowser.php | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/src/JoomlaBrowser.php b/src/JoomlaBrowser.php index a97e22f..46570cb 100644 --- a/src/JoomlaBrowser.php +++ b/src/JoomlaBrowser.php @@ -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']); @@ -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']); } @@ -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']); } @@ -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']); } @@ -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']); } @@ -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": @@ -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); @@ -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']); }