Skip to content

Commit 6bbe8ab

Browse files
committed
Updating some more functions
1 parent 3edd645 commit 6bbe8ab

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/JoomlaBrowser.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ public function setErrorReportingToDevelopment()
289289
$this->debug('I wait for error reporting dropdown');
290290
$I->selectOptionInChosen('Error Reporting', 'Development');
291291
$this->debug('I click on save');
292-
$I->click(['xpath' => "//button[@onclick=\"Joomla.submitbutton('config.save.application.apply')\"]"]);
292+
$I->clickToolbarButton('save');
293293
$this->debug('I wait for global configuration being saved');
294294
$I->waitForText('Global Configuration',60,['css' => '.page-title']);
295295
$I->see('Configuration successfully saved.',['id' => 'system-message-container']);
@@ -481,7 +481,7 @@ public function enablePlugin($pluginName)
481481
$I->waitForElement($this->searchResultPluginName($pluginName), 30);
482482
$I->checkExistenceOf($pluginName);
483483
$I->click(['xpath' => "//input[@id='cb0']"]);
484-
$I->click(['xpath' => "//div[@id='toolbar-publish']/button"]);
484+
$I->clickToolbarButton('publish');
485485
$I->see('successfully enabled', ['id' => 'system-message-container']);
486486
}
487487

@@ -629,7 +629,7 @@ public function setModulePosition($module, $position = 'position-7')
629629
$I->click(['link' => $module]);
630630
$I->waitForText($module, 30, ['css' => 'H3']);
631631
$I->selectOptionInChosen('Position', $position);
632-
$I->click(['xpath' => "//div[@id='toolbar-apply']/button"]);
632+
$I->clickToolbarButton('save');
633633
$I->waitForText('Module successfully saved',30,['id' => 'system-message-container']);
634634
}
635635

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

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

@@ -757,7 +757,7 @@ public function createMenuItem($menuTitle, $menuCategory, $menuItem, $menu = 'Ma
757757
$this->checkForPhpNoticesOrWarnings();
758758

759759
$I->debug("I click new");
760-
$I->click("New");
760+
$I->clickToolbarButton('new');
761761
$I->waitForText('Menus: New Item', '60', ['css' => 'h1']);
762762
$this->checkForPhpNoticesOrWarnings();
763763
$I->fillField(['id' => 'jform_title'], $menuTitle);
@@ -784,7 +784,7 @@ public function createMenuItem($menuTitle, $menuCategory, $menuItem, $menu = 'Ma
784784
$I->selectOptionInChosen('Language', $language);
785785
$I->waitForText('Menus: New Item','30', ['css' => 'h1']);
786786
$I->debug('I save the menu');
787-
$I->click("Save");
787+
$I->clickToolbarButton('save');
788788

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

0 commit comments

Comments
 (0)