32
1
mirror of https://github.com/joomla-extensions/weblinks.git synced 2024-12-27 02:12:50 +00:00

Merge remote-tracking branch 'origin/master' into pr/146

# Conflicts:
#	RoboFile.php
This commit is contained in:
javier gomez 2015-11-01 16:17:37 +01:00
commit cf95385242
19 changed files with 344 additions and 156 deletions

View File

@ -3,6 +3,8 @@
This repo is meant to hold the decoupled com_weblinks component and related code. This repo is meant to hold the decoupled com_weblinks component and related code.
# Tests # Tests
The tests in Weblinks Extension use Codeception Testing Framework, if you want to know more about the technology used for testing please check: [Testing Joomla Extensions with Codeception](https://docs.joomla.org/Testing_Joomla_Extensions_with_Codeception).
To prepare the system tests (Selenium) to be run in your local machine you are asked to rename the file `tests/acceptance.suite.dist.yml` to `tests/acceptance.suite.yml`. Afterwards, please edit the file according to your system needs. To prepare the system tests (Selenium) to be run in your local machine you are asked to rename the file `tests/acceptance.suite.dist.yml` to `tests/acceptance.suite.yml`. Afterwards, please edit the file according to your system needs.
## Optional: extra configuration for RoboFile ## Optional: extra configuration for RoboFile

View File

@ -15,10 +15,25 @@ class RoboFile extends \Robo\Tasks
// Load tasks from composer, see composer.json // Load tasks from composer, see composer.json
use \joomla_projects\robo\loadTasks; use \joomla_projects\robo\loadTasks;
private $extension = ''; /**
* File extension for executables
*
* @var string
*/
private $executableExtension = '';
/**
* Local configuration parameters
*
* @var array
*/
private $configuration = array(); private $configuration = array();
/**
* Path to the local CMS root
*
* @var string
*/
private $cmsPath = ''; private $cmsPath = '';
/** /**
@ -30,21 +45,22 @@ class RoboFile extends \Robo\Tasks
$this->cmsPath = $this->getCmsPath(); $this->cmsPath = $this->getCmsPath();
// TODO make this coherent with the above initializations $this->executableExtension = $this->getExecutableExtension();
$this->setExecExtension();
} }
/** /**
* Set the Execute extension for Windows Operating System * Get the executable extension according to Operating System
* *
* @return void * @return void
*/ */
private function setExecExtension() private function getExecutableExtension()
{ {
if ($this->isWindows()) if ($this->isWindows())
{ {
$this->extension = '.exe'; return '.exe';
} }
return '';
} }
/** /**
@ -299,8 +315,8 @@ class RoboFile extends \Robo\Tasks
// Optionally uses Joomla default htaccess file. Used by TravisCI // Optionally uses Joomla default htaccess file. Used by TravisCI
if ($use_htaccess == true) if ($use_htaccess == true)
{ {
$this->_copy('/tests/joomla-cms3/htaccess.txt', 'tests/joomla-cms3/.htaccess'); $this->_copy('./tests/joomla-cms3/htaccess.txt', './tests/joomla-cms3/.htaccess');
$this->_exec('sed -e "s,# RewriteBase /,RewriteBase /tests/joomla-cms3/,g" --in-place tests/joomla-cms3/.htaccess'); $this->_exec('sed -e "s,# RewriteBase /,RewriteBase /tests/joomla-cms3/,g" -in-place tests/joomla-cms3/.htaccess');
} }
} }
@ -338,7 +354,7 @@ class RoboFile extends \Robo\Tasks
{ {
$branch = empty($this->configuration->branch) ? 'staging' : $this->configuration->branch; $branch = empty($this->configuration->branch) ? 'staging' : $this->configuration->branch;
return "git" . $this->extension . " clone -b $branch --single-branch --depth 1 https://github.com/joomla/joomla-cms.git tests/cache"; return "git" . $this->executableExtension . " clone -b $branch --single-branch --depth 1 https://github.com/joomla/joomla-cms.git tests/cache";
} }
/** /**

View File

@ -43,6 +43,10 @@ class Com_WeblinksInstallerScript
$category->metadata = '{"author":"","robots":""}'; $category->metadata = '{"author":"","robots":""}';
$category->language = '*'; $category->language = '*';
$category->checked_out_time = JFactory::getDbo()->getNullDate(); $category->checked_out_time = JFactory::getDbo()->getNullDate();
$category->version = 1;
$category->hits = 0;
$category->modified_user_id = 0;
$category->checked_out = 0;
// Set the location in the tree // Set the location in the tree
$category->setLocation(1, 'last-child'); $category->setLocation(1, 'last-child');

View File

@ -38,7 +38,7 @@ $listDirn = $this->escape($this->state->get('list.direction'));
<fieldset class="filters btn-toolbar"> <fieldset class="filters btn-toolbar">
<?php if ($this->params->get('filter_field') != 'hide') :?> <?php if ($this->params->get('filter_field') != 'hide') :?>
<div class="btn-group"> <div class="btn-group">
<label class="filter-search-lbl element-invisible" for="filter-search"><span class="label label-warning"><?php echo JText::_('JUNPUBLISHED'); ?></span><?php echo JText::_('COM_WEBLINKS_FILTER_LABEL') . '&#160;'; ?></label> <label class="filter-search-lbl element-invisible" for="filter-search"><?php echo JText::_('COM_WEBLINKS_FILTER_LABEL') . '&#160;'; ?></label>
<input type="text" name="filter-search" id="filter-search" value="<?php echo $this->escape($this->state->get('list.filter')); ?>" class="inputbox" onchange="document.adminForm.submit();" title="<?php echo JText::_('COM_WEBLINKS_FILTER_SEARCH_DESC'); ?>" placeholder="<?php echo JText::_('COM_WEBLINKS_FILTER_SEARCH_DESC'); ?>" /> <input type="text" name="filter-search" id="filter-search" value="<?php echo $this->escape($this->state->get('list.filter')); ?>" class="inputbox" onchange="document.adminForm.submit();" title="<?php echo JText::_('COM_WEBLINKS_FILTER_SEARCH_DESC'); ?>" placeholder="<?php echo JText::_('COM_WEBLINKS_FILTER_SEARCH_DESC'); ?>" />
</div> </div>
<?php endif; ?> <?php endif; ?>
@ -96,7 +96,7 @@ $listDirn = $this->escape($this->state->get('list.direction'));
$height = 500; $height = 500;
} }
if ($this->items[$i]->state == 0) : ?> if ($this->items[$i]->state == 0) : ?>
<span class="label label-warning">Unpublished</span> <span class="label label-warning"><?php echo JText::_('JUNPUBLISHED'); ?></span>
<?php endif; ?> <?php endif; ?>
<?php switch ($item->params->get('target', $this->params->get('target'))) <?php switch ($item->params->get('target', $this->params->get('target')))

View File

@ -33,7 +33,7 @@ class WeblinksViewCategory extends JViewCategory
{ {
$item->slug = $item->alias ? ($item->id . ':' . $item->alias) : $item->id; $item->slug = $item->alias ? ($item->id . ':' . $item->alias) : $item->id;
if ($item->params->get('count_clicks', $this->params->get('count_clicks')) == 1) if ($item->params->get('count_clicks', $this->params->get('count_clicks', 1)) == 1)
{ {
$item->link = JRoute::_('index.php?option=com_weblinks&task=weblink.go&id=' . $item->id); $item->link = JRoute::_('index.php?option=com_weblinks&task=weblink.go&id=' . $item->id);
} }

View File

@ -1,10 +0,0 @@
I WANT TO INSTALL WEBLINKS
I am 'Administrator'
I install joomla
I do administrator login
I set error reporting to development
I comment('get weblinks repository folder from acceptance.suite.yml "see _support/AcceptanceHelper.php)'
I get configuration 'repo_folder'
I install extension from directory "$path . 'src/com_weblinks/'
I do administrator logout

View File

@ -0,0 +1,15 @@
I WANT TO TEST ARCHIVING A CATEGORY IN /ADMINISTRATOR/
I am "Administrator"
I do administrator login ""
I am going to "Navigate to Categories page in /administrator/"
I am on page "administrator/index.php?option=com_categories&extension=com_weblinks"
I wait for text "Weblinks: Categories"," '60"," ['css' => 'h1']"
I search for item "$this->categoryTitle"
I check all results ""
I am going to "try to archive a weblink category"
I click toolbar button "archive"
I wait for element "['id' => 'system-message-container']"," '60"
I expect to "see a success message after Archiving the category"
I see "1 category successfully archived."," ['id' => 'system-message-container']"

View File

@ -0,0 +1,17 @@
I WANT TO TEST CREATE A CATEGORY IN /ADMINISTRATOR/
I am "Administrator"
I do administrator login ""
I am going to "Navigate to Categories page in /administrator/ and create a Category"
I am on page "administrator/index.php?option=com_categories&extension=com_weblinks"
I wait for text "Weblinks: Categories"," '60"," ['css' => 'h1']"
I expect to "see categories page"
I check for php notices or warnings ""
I am going to "try to save a category with a filled title"
I click toolbar button "New"
I wait for text "Category Manager: Add A New Weblinks Category"," '60"," ['css' => 'h1']"
I fill field "['id' => 'jform_title']"," $this->categoryTitle"
I click toolbar button "Save & Close"
I expect to "see a success message after saving the category"
I see "Category successfully saved"," ['id' => 'system-message-container']"

View File

@ -0,0 +1,15 @@
I WANT TO TEST CATEGORY CREATION IN /ADMINISTRATOR/ WITHOUT TITLE FAILS
I am "Administrator"
I do administrator login ""
I am going to "Navigate to Categories page in /administrator/"
I am on page "administrator/index.php?option=com_categories&extension=com_weblinks"
I wait for text "Weblinks: Categories"," '60"," ['css' => 'h1']"
I expect to "see categories page"
I am going to "try to save a category with empty title and it should fail"
I click toolbar button "new"
I wait for text "Category Manager: Add A New Weblinks Category"," '60"," ['css' => 'h1']"
I click toolbar button "save"
I expect to "see an error when trying to save a category without title"
I see "Invalid field: Title"," ['id' => 'system-message-container']"

View File

@ -0,0 +1,16 @@
I WANT TO TEST DELETING A CATEGORY IN /ADMINISTRATOR/
I am "Administrator"
I do administrator login ""
I am going to "Navigate to Categories page in /administrator/"
I am on page "administrator/index.php?option=com_categories&extension=com_weblinks"
I wait for text "Weblinks: Categories"," '60"," ['css' => 'h1']"
I set filter "Select Status"," 'Trashed"
I search for item "$this->categoryTitle"
I check all results ""
I am going to "try to delete a Weblinks Category"
I click toolbar button "Empty trash"
I wait for element "['id' => 'system-message-container']"," '60"
I expect to "see a success message after Deleting the category"
I see "1 category successfully deleted."," ['id' => 'system-message-container']"

View File

@ -0,0 +1,15 @@
I WANT TO TEST PUBLISHING A CATEGORY IN /ADMINISTRATOR/
I am "Administrator"
I do administrator login ""
I am going to "Navigate to Categories page in /administrator/"
I am on page "administrator/index.php?option=com_categories&extension=com_weblinks"
I search for item "$this->categoryTitle"
I wait for text "Weblinks: Categories"," '60"," ['css' => 'h1']"
I check all results ""
I am going to "try to publish a Weblinks Category"
I click toolbar button "publish"
I wait for element "['id' => 'system-message-container']"," '60"
I expect to "see a success message after publishing the category"
I see "1 category successfully published."," ['id' => 'system-message-container']"

View File

@ -0,0 +1,16 @@
I WANT TO TEST TRASHING A CATEGORY IN /ADMINISTRATOR/
I am "Administrator"
I do administrator login ""
I am going to "Navigate to Categories page in /administrator/"
I am on page "administrator/index.php?option=com_categories&extension=com_weblinks"
I wait for text "Weblinks: Categories"," '60"," ['css' => 'h1']"
I set filter "Select Status"," 'Archived"
I search for item "$this->categoryTitle"
I check all results ""
I am going to "try to delete a Weblinks Category"
I click toolbar button "Trash"
I wait for element "['id' => 'system-message-container']"," '60"
I expect to "see a success message after Trashing the category"
I see "1 category successfully trashed."," ['id' => 'system-message-container']"

View File

@ -0,0 +1,15 @@
I WANT TO TEST UNPUBLISH A CATEGORY IN /ADMINISTRATOR/
I am "Administrator"
I do administrator login ""
I am going to "Navigate to Categories page in /administrator/"
I am on page "administrator/index.php?option=com_categories&extension=com_weblinks"
I wait for text "Weblinks: Categories"," '60"," ['css' => 'h1']"
I search for item "$this->categoryTitle"
I check all results ""
I am going to "try to unpublish a Weblinks Category"
I click toolbar button "unpublish"
I wait for element "['id' => 'system-message-container']"," '60"
I expect to "See a success message after unpublishing the category"
I see "1 category successfully unpublished"," ['id' => 'system-message-container']"

View File

@ -0,0 +1,10 @@
I WANT TO TEST CATEGORY EDIT VIEW TABS
I am "Administrator"
I do administrator login ""
I am going to "Navigate to Categories page in /administrator/ and verify the Tabs"
I am on page "administrator/index.php?option=com_categories&extension=com_weblinks"
I click toolbar button "New"
I wait for text "Category Manager: Add A New Weblinks Category"," '30"," ['css' => 'h1']"
I verify available tabs "['Category"," 'Publishing"," 'Permissions"," 'Options']"

View File

@ -0,0 +1,7 @@
I WANT TO INSTALL JOOMLA
I am "Administrator"
I install joomla removing installation folder ""
I do administrator login ""
I set error reporting to development ""

View File

@ -0,0 +1,8 @@
I WANT TO INSTALL WEBLINKS
I do administrator login ""
I comment('get weblinks repository folder from acceptance.suite.yml "see _support/AcceptanceHelper.php)"
I get configuration "repo_folder"
I install extension from folder "$path . 'src/com_weblinks/"
I do administrator logout ""

View File

@ -9,6 +9,170 @@
*/ */
class AdministratorCategoriesCest class AdministratorCategoriesCest
{ {
public $categoryTitle;
/**
* Creates random names for the objects that will be used by the tests
*
* @see https://github.com/fzaninotto/Faker#fakerproviderbase
*/
public function __construct()
{
$this->faker = Faker\Factory::create();
$this->categoryTitle = $this->faker->bothify('AdministratorCategoriesCest category ?##?');
}
public function administratorCreateCategoryWithoutTitleFails(AcceptanceTester $I)
{
$I->am('Administrator');
$I->wantToTest('Category creation in /administrator/ without title fails');
$I->doAdministratorLogin();
$I->amGoingTo('Navigate to Categories page in /administrator/');
$I->amOnPage('administrator/index.php?option=com_categories&extension=com_weblinks');
$I->waitForText('Weblinks: Categories', '60', ['css' => 'h1']);
$I->expectTo('see categories page');
$I->amGoingTo('try to save a category with empty title and it should fail');
$I->clickToolbarButton('new');
$I->waitForText('Weblinks: New Category', '60', ['css' => 'h1']);
$I->clickToolbarButton('save');
$I->expectTo('see an error when trying to save a category without title');
$I->see('Invalid field: Title', ['id' => 'system-message-container']);
}
public function administratorCreateCategory(\Step\Acceptance\category $I)
{
$I->am('Administrator');
$I->wantToTest('create a Category in /administrator/');
$I->doAdministratorLogin();
$I->amGoingTo('Navigate to Categories page in /administrator/ and create a Category');
$I->amOnPage('administrator/index.php?option=com_categories&extension=com_weblinks');
$I->waitForText('Weblinks: Categories', '60', ['css' => 'h1']);
$I->expectTo('see categories page');
$I->checkForPhpNoticesOrWarnings();
$I->amGoingTo('try to save a category with a filled title');
$I->clickToolbarButton('New');
$I->waitForText('Weblinks: New Category', '60', ['css' => 'h1']);
$I->fillField(['id' => 'jform_title'], $this->categoryTitle);
$I->clickToolbarButton('Save & Close');
$I->expectTo('see a success message after saving the category');
$I->see('Category successfully saved', ['id' => 'system-message-container']);
}
/**
* @depends administratorCreateCategory
*/
public function administratorPublishCategory(\Step\Acceptance\category $I)
{
$I->am('Administrator');
$I->wantToTest('Publishing a Category in /administrator/');
$I->doAdministratorLogin();
$I->amGoingTo('Navigate to Categories page in /administrator/');
$I->amOnPage('administrator/index.php?option=com_categories&extension=com_weblinks');
$I->searchForItem($this->categoryTitle);
$I->waitForText('Weblinks: Categories', '60', ['css' => 'h1']);
$I->checkAllResults();
$I->amGoingTo('try to publish a Weblinks Category');
$I->clickToolbarButton('publish');
$I->waitForElement(['id' => 'system-message-container'], '60');
$I->expectTo('see a success message after publishing the category');
$I->see('1 category successfully published.', ['id' => 'system-message-container']);
}
/**
* @depends administratorPublishCategory
*/
public function administratorUnpublishCategory(\Step\Acceptance\category $I)
{
$I->am('Administrator');
$I->wantToTest('Unpublish a Category in /administrator/');
$I->doAdministratorLogin();
$I->amGoingTo('Navigate to Categories page in /administrator/');
$I->amOnPage('administrator/index.php?option=com_categories&extension=com_weblinks');
$I->waitForText('Weblinks: Categories', '60', ['css' => 'h1']);
$I->searchForItem($this->categoryTitle);
$I->checkAllResults();
$I->amGoingTo('try to unpublish a Weblinks Category');
$I->clickToolbarButton('unpublish');
$I->waitForElement(['id' => 'system-message-container'], '60');
$I->expectTo('See a success message after unpublishing the category');
$I->see('1 category successfully unpublished', ['id' => 'system-message-container']);
}
/**
* @depends administratorUnpublishCategory
*/
public function administratorArchiveCategory(\Step\Acceptance\category $I)
{
$I->am('Administrator');
$I->wantToTest('Archiving a Category in /administrator/');
$I->doAdministratorLogin();
$I->amGoingTo('Navigate to Categories page in /administrator/');
$I->amOnPage('administrator/index.php?option=com_categories&extension=com_weblinks');
$I->waitForText('Weblinks: Categories', '60', ['css' => 'h1']);
$I->searchForItem($this->categoryTitle);
$I->checkAllResults();
$I->amGoingTo('try to archive a weblink category');
$I->clickToolbarButton('archive');
$I->waitForElement(['id' => 'system-message-container'], '60');
$I->expectTo('see a success message after Archiving the category');
$I->see('1 category successfully archived.', ['id' => 'system-message-container']);
}
/**
* @depends administratorArchiveCategory
*/
public function administratorTrashCategory(\Step\Acceptance\category $I)
{
$I->am('Administrator');
$I->wantToTest('Trashing a Category in /administrator/');
$I->doAdministratorLogin();
$I->amGoingTo('Navigate to Categories page in /administrator/');
$I->amOnPage('administrator/index.php?option=com_categories&extension=com_weblinks');
$I->waitForText('Weblinks: Categories', '60', ['css' => 'h1']);
$I->setFilter('Select Status', 'Archived');
$I->searchForItem($this->categoryTitle);
$I->checkAllResults();
$I->amGoingTo('try to delete a Weblinks Category');
$I->clickToolbarButton('Trash');
$I->waitForElement(['id' => 'system-message-container'], '60');
$I->expectTo('see a success message after Trashing the category');
$I->see('1 category successfully trashed.', ['id' => 'system-message-container']);
}
/**
* @depends administratorTrashCategory
*/
public function administratorDeleteCategory(\Step\Acceptance\category $I)
{
$I->am('Administrator');
$I->wantToTest('Deleting a Category in /administrator/');
$I->doAdministratorLogin();
$I->amGoingTo('Navigate to Categories page in /administrator/');
$I->amOnPage('administrator/index.php?option=com_categories&extension=com_weblinks');
$I->waitForText('Weblinks: Categories', '60', ['css' => 'h1']);
$I->setFilter('Select Status', 'Trashed');
$I->searchForItem($this->categoryTitle);
$I->checkAllResults();
$I->amGoingTo('try to delete a Weblinks Category');
$I->clickToolbarButton('Empty trash');
$I->waitForElement(['id' => 'system-message-container'], '60');
$I->expectTo('see a success message after Deleting the category');
$I->see('1 category successfully deleted.', ['id' => 'system-message-container']);
}
public function administratorVerifyAvailableTabs(\Step\Acceptance\category $I) public function administratorVerifyAvailableTabs(\Step\Acceptance\category $I)
{ {
$I->am('Administrator'); $I->am('Administrator');
@ -22,126 +186,4 @@ class AdministratorCategoriesCest
$I->waitForText('Weblinks: New Category', '30', ['css' => 'h1']); $I->waitForText('Weblinks: New Category', '30', ['css' => 'h1']);
$I->verifyAvailableTabs(['Category', 'Publishing', 'Permissions', 'Options']); $I->verifyAvailableTabs(['Category', 'Publishing', 'Permissions', 'Options']);
} }
public function administratorCreateCategory(\Step\Acceptance\category $I)
{
$I->am('Administrator');
$categoryName = 'automated testing' . rand(1, 100);
$I->wantToTest('Category creation in /administrator/');
$I->doAdministratorLogin();
$I->amGoingTo('Navigate to Categories page in /administrator/ and create a Category');
$I->createCategory($categoryName);
$I->amGoingTo('Delete the Category which was created');
$I->trashCategory($categoryName);
$I->deleteCategory($categoryName);
}
public function administratorCreateCategoryWithoutTitleFails(AcceptanceTester $I)
{
$I->am('Administrator');
$I->wantToTest('Category creation in /administrator/ without title');
$I->doAdministratorLogin();
$I->amGoingTo('Navigate to Categories page in /administrator/');
$I->amOnPage('administrator/index.php?option=com_categories&extension=com_weblinks');
$I->waitForText('Weblinks: Categories', '30', ['css' => 'h1']);
$I->expectTo('see categories page');
$I->amGoingTo('try to save a category with empty title and it should fail');
$I->click(['xpath' => "//button[@onclick=\"Joomla.submitbutton('category.add')\"]"]);
$I->waitForText('Weblinks: New Category', '30', ['css' => 'h1']);
$I->click(['xpath' => "//button[@onclick=\"Joomla.submitbutton('category.apply')\"]"]);
$I->expectTo('see an error when trying to save a category without title');
$I->see('Invalid field: Title', ['id' => 'system-message-container']);
}
public function administratorPublishCategory(\Step\Acceptance\category $I)
{
$I->am('Administrator');
$categoryName = 'automated testing pub' . rand(1, 100);
$I->wantToTest('Category creation in /administrator/');
$I->doAdministratorLogin();
$I->amGoingTo('Navigate to Categories page in /administrator/ and create a new Category');
$I->createCategory($categoryName);
$I->searchForItem($categoryName);
$I->waitForText('Weblinks: Categories', '30', ['css' => 'h1']);
$I->checkAllResults();
$I->amGoingTo('try to publish a weblink category');
$I->clickToolbarButton('publish');
$I->waitForText('Weblinks: Categories', '30', ['css' => 'h1']);
$I->expectTo('see a success message after publishing the category');
$I->see('1 category successfully published.', ['id' => 'system-message-container']);
$I->amGoingTo('Delete the Category which was created');
$I->trashCategory($categoryName);
$I->deleteCategory($categoryName);
}
public function administratorUnpublishCategory(\Step\Acceptance\category $I)
{
$I->am('Administrator');
$categoryName = 'automated testing unpub' . rand(1, 100);
$I->wantToTest('Category creation in /administrator/');
$I->doAdministratorLogin();
$I->amGoingTo('Navigate to Categories page in /administrator/');
$I->createCategory($categoryName);
$I->searchForItem($categoryName);
$I->waitForText('Weblinks: Categories', '30', ['css' => 'h1']);
$I->checkAllResults();
//publish the category
$I->amGoingTo('try to publish a weblink category');
$I->clickToolbarButton('publish');
$I->waitForText('Weblinks: Categories', '30', ['css' => 'h1']);
$I->expectTo('see a success message after publishing the category');
$I->see('1 category successfully published.', ['id' => 'system-message-container']);
// Unpublish it again
$I->waitForText('Weblinks: Categories', '30', ['css' => 'h1']);
$I->checkAllResults();
$I->amGoingTo('Try to unpublish a weblink category');
$I->clickToolbarButton('unpublish');
$I->waitForText('Weblinks: Categories', '30', ['css' => 'h1']);
$I->expectTo('See a success message after unpublishing the category');
$I->see('1 category successfully unpublished', ['id' => 'system-message-container']);
//delete the category
$I->amGoingTo('Delete the Category which was created');
$I->trashCategory($categoryName);
$I->deleteCategory($categoryName);
}
public function administratorArchiveCategory(\Step\Acceptance\category $I)
{
$I->am('Administrator');
$I->wantToTest('Archiving Category in /administrator/');
$I->doAdministratorLogin();
$salt = rand(1,100);
$I->createCategory('automated testing arch'.$salt);
$I->amGoingTo('Search for automated testing');
$I->fillField(['xpath' => "//input[@id=\"filter_search\"]"], "automated testing arch".$salt. "\n");
$I->waitForText('Weblinks: Categories', '30', ['css' => 'h1']);
$I->amGoingTo('Select the first weblink');
$I->click(['xpath' => "//input[@id=\"cb0\"]"]);
$I->amGoingTo('try to archive a weblink category');
$I->click(['xpath' => "//button[@onclick=\"if (document.adminForm.boxchecked.value==0){alert('Please first make a selection from the list.');}else{ Joomla.submitbutton('categories.archive')}\"]"]);
$I->waitForText('Weblinks: Categories', '30', ['css' => 'h1']);
$I->expectTo('see a success message after Archiving the category');$I->see('1 category successfully archived.', ['id' => 'system-message-container']);
$I->setFilter('select status','Archived');
$I->trashCategory('automated testing arch'.$salt);
}
} }

View File

@ -32,7 +32,7 @@ class FrontendWeblinksCest
$I->doAdministratorLogin(); $I->doAdministratorLogin();
$I->createWeblink($this->title, $this->url); $I->createWeblink($this->title, $this->url, "No");
// Menu link // Menu link
$I->createMenuItem($this->menuItem, 'Weblinks', 'List All Web Link Categories', 'Main Menu'); $I->createMenuItem($this->menuItem, 'Weblinks', 'List All Web Link Categories', 'Main Menu');

View File

@ -27,7 +27,7 @@ class InstallWeblinksCest
$I->doAdministratorLogin(); $I->doAdministratorLogin();
$I->comment('get Weblinks repository folder from acceptance.suite.yml (see _support/AcceptanceHelper.php)'); $I->comment('get Weblinks repository folder from acceptance.suite.yml (see _support/AcceptanceHelper.php)');
$path = $I->getConfiguration('repo_folder'); $path = $I->getConfiguration('repo_folder');
$I->installExtensionFromFolder($path . 'src/com_weblinks/'); $I->installExtensionFromFolder(rtrim($path, "/") . '/src/com_weblinks/');
$I->doAdministratorLogout(); $I->doAdministratorLogout();
} }
} }