diff --git a/src/JoomlaBrowser.php b/src/JoomlaBrowser.php index 011fdff..b7825d4 100644 --- a/src/JoomlaBrowser.php +++ b/src/JoomlaBrowser.php @@ -741,6 +741,28 @@ private function searchResultPluginName($pluginName) return $path; } + /** + * Function to Disable a Plugin + * + * @param String $pluginName Name of the Plugin + * + * @return void + * + * @since 3.0.0 + */ + public function disablePlugin($pluginName) + { + $this->amOnPage('/administrator/index.php?option=com_plugins'); + $this->debug('I check for Notices and Warnings'); + $this->checkForPhpNoticesOrWarnings(); + $this->searchForItem($pluginName); + $this->waitForElement($this->searchResultPluginName($pluginName), 30); + $this->checkExistenceOf($pluginName); + $this->click(['xpath' => "//input[@id='cb0']"]); + $this->click(['xpath' => "//div[@id='toolbar-unpublish']/button"]); + $this->see(' disabled', ['id' => 'system-message-container']); + } + /** * Uninstall Extension based on a name *