From 3cf4a10300f8ba98fcd6e2a3697340fbf0ac92fe Mon Sep 17 00:00:00 2001 From: Puneet Kala Date: Thu, 1 Mar 2018 09:35:40 +0530 Subject: [PATCH] Adding a Plugin Disable Function --- src/JoomlaBrowser.php | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) 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 *