weblinks/tests/_support/Step/Acceptance/Category.php

63 lines
1.7 KiB
PHP
Raw Normal View History

<?php
/**
* Class category
*
* Step Object to interact with a category
*
* @todo: this class should grow until being able to execute generic operations over a category: change status, add to category...
*
* @package Step\Acceptance
2017-04-21 17:25:47 +00:00
* @link http://codeception.com/docs/06-ReusingTestCode#StepObjects
*/
namespace Step\Acceptance;
/**
* Class AdministratorCategoriesStep
*
* @package AcceptanceTester
*
* @since 1.4
*/
2019-08-13 19:35:30 +00:00
class Category extends \AcceptanceTester
{
/**
2015-10-30 12:05:54 +00:00
* Function to Trash a Category in Joomla!
*
2019-08-13 02:18:48 +00:00
* @param String $categoryName Name of the category which is to be trashed
*
* @return void
2019-08-13 02:18:48 +00:00
* @throws \Exception
*/
public function trashCategory($categoryName)
{
$I = $this;
$I->amOnPage('administrator/index.php?option=com_categories&extension=com_weblinks');
$I->waitForText('Weblinks: Categories', '30', ['css' => 'h1']);
$I->searchForItem($categoryName);
$I->amGoingTo('Select the weblink result');
$I->checkAllResults();
$I->clickToolbarButton("Trash");
$I->see('category successfully trashed.', ['id' => 'system-message-container']);
}
2015-10-30 12:05:54 +00:00
/**
* Function to Delete a Category in Joomla!
*
2019-08-13 02:18:48 +00:00
* @param String $categoryName Name of the category which is to be deleted
2015-10-30 12:05:54 +00:00
*
* @return void
2019-08-13 02:18:48 +00:00
* @throws \Exception
2015-10-30 12:05:54 +00:00
*/
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']);
}
}