Adding a function to delete a category

This commit is contained in:
puneet0191 2015-10-30 17:35:54 +05:30
parent d42948bd48
commit 15887b9bf0
1 changed files with 22 additions and 2 deletions

View File

@ -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']);
}
}