From 15887b9bf0504c836cafbf49b91df2c5b19006fe Mon Sep 17 00:00:00 2001 From: puneet0191 Date: Fri, 30 Oct 2015 17:35:54 +0530 Subject: [PATCH] Adding a function to delete a category --- tests/_support/Step/Acceptance/category.php | 24 +++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/tests/_support/Step/Acceptance/category.php b/tests/_support/Step/Acceptance/category.php index 2e7c44d..5025925 100644 --- a/tests/_support/Step/Acceptance/category.php +++ b/tests/_support/Step/Acceptance/category.php @@ -45,9 +45,9 @@ class category extends \AcceptanceTester } /** - * Function to Delete a Category in Joomla! + * Function to Trash a Category in Joomla! * - * @param String $categoryName Name of the category which is to be deleted + * @param String $categoryName Name of the category which is to be Trashed * * @return void */ @@ -62,4 +62,24 @@ class category extends \AcceptanceTester $I->clickToolbarButton("Trash"); $I->see('category successfully trashed.', ['id' => 'system-message-container']); } + + /** + * Function to Delete a Category in Joomla! + * + * @param String $categoryName Name of the category which is to be deleted + * + * @return void + */ + public function deleteCategory($categoryName) + { + $I = $this; + $I->amOnPage('administrator/index.php?option=com_categories&extension=com_weblinks'); + $I->waitForText('Weblinks: Categories', '30', ['css' => 'h1']); + $I->setFilter('select status', 'Trashed'); + $I->searchForItem($categoryName); + $I->amGoingTo('Select the weblink result'); + $I->checkAllResults(); + $I->clickToolbarButton("empty trash"); + $I->see('category successfully deleted.', ['id' => 'system-message-container']); + } }