From 07a7fbbc6ab7ef52b1313c995322374c89095821 Mon Sep 17 00:00:00 2001 From: Nicola Galgano Date: Tue, 8 Sep 2015 08:49:37 +0200 Subject: [PATCH 01/11] installation fix on MSSQL testing this one #7832 i was unable to install pkg_weblinks on MSSQL the problem was that these fields (version,hits,modified_user_id,checked_out) was passed like a string instead of bigint --- src/com_weblinks/script.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/com_weblinks/script.php b/src/com_weblinks/script.php index f42fb3d..c00f5c2 100644 --- a/src/com_weblinks/script.php +++ b/src/com_weblinks/script.php @@ -43,6 +43,10 @@ class Com_WeblinksInstallerScript $category->metadata = '{"author":"","robots":""}'; $category->language = '*'; $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 $category->setLocation(1, 'last-child'); From 8717ae772029564dbc15618036ff0922321487b3 Mon Sep 17 00:00:00 2001 From: zero-24 Date: Tue, 8 Sep 2015 11:59:05 +0200 Subject: [PATCH 02/11] CS --- src/com_weblinks/script.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/com_weblinks/script.php b/src/com_weblinks/script.php index c00f5c2..e5a249e 100644 --- a/src/com_weblinks/script.php +++ b/src/com_weblinks/script.php @@ -45,8 +45,8 @@ class Com_WeblinksInstallerScript $category->checked_out_time = JFactory::getDbo()->getNullDate(); $category->version = 1; $category->hits = 0; - $category->modified_user_id=0; - $category->checked_out=0; + $category->modified_user_id = 0; + $category->checked_out = 0; // Set the location in the tree $category->setLocation(1, 'last-child'); From 5374929e527c631d6f170320ca85d1bf7a7e4181 Mon Sep 17 00:00:00 2001 From: "remoteshaman.com" Date: Thu, 15 Oct 2015 05:26:38 +0300 Subject: [PATCH 03/11] Update default_items.php "label label-warning" text "Unpublished" view only for administrator's and not need display for all user in filter label tag. --- src/com_weblinks/site/views/category/tmpl/default_items.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/com_weblinks/site/views/category/tmpl/default_items.php b/src/com_weblinks/site/views/category/tmpl/default_items.php index 07df66d..319dabc 100644 --- a/src/com_weblinks/site/views/category/tmpl/default_items.php +++ b/src/com_weblinks/site/views/category/tmpl/default_items.php @@ -38,7 +38,7 @@ $listDirn = $this->escape($this->state->get('list.direction'));
params->get('filter_field') != 'hide') :?>
- +
@@ -96,7 +96,7 @@ $listDirn = $this->escape($this->state->get('list.direction')); $height = 500; } if ($this->items[$i]->state == 0) : ?> - Unpublished + params->get('target', $this->params->get('target'))) From d4b80d8ae8df947e900294a1267fe9ce0882891b Mon Sep 17 00:00:00 2001 From: javier gomez Date: Sat, 31 Oct 2015 12:22:02 +0100 Subject: [PATCH 04/11] Fix wrong move command in robo --- RoboFile.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RoboFile.php b/RoboFile.php index 1e78044..c056176 100644 --- a/RoboFile.php +++ b/RoboFile.php @@ -203,7 +203,7 @@ class RoboFile extends \Robo\Tasks // Optionally uses Joomla default htaccess file. Used by TravisCI 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'); } } From ab8116ccc376690ec9fdd7af19191477c2f5c4bc Mon Sep 17 00:00:00 2001 From: javier gomez Date: Sat, 31 Oct 2015 12:37:27 +0100 Subject: [PATCH 05/11] Fixed ilegal usage of sed --- RoboFile.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RoboFile.php b/RoboFile.php index c056176..84cc293 100644 --- a/RoboFile.php +++ b/RoboFile.php @@ -204,7 +204,7 @@ class RoboFile extends \Robo\Tasks if ($use_htaccess == true) { $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'); } } From 24552b5e29606e621aedba53509ea2ef4b83b1f5 Mon Sep 17 00:00:00 2001 From: kshitij sharma Date: Sat, 31 Oct 2015 17:58:48 +0100 Subject: [PATCH 06/11] Test to submit a weblink and test to Displays a list of Web Links for a category --- composer.lock | 9 +- .../AdministratorCategoriesCest.php | 134 ++++++++++++++++++ 2 files changed, 138 insertions(+), 5 deletions(-) diff --git a/composer.lock b/composer.lock index 2ac7273..aa96306 100644 --- a/composer.lock +++ b/composer.lock @@ -5,7 +5,6 @@ "This file is @generated automatically" ], "hash": "a92f2be1ccb2397e6cc71bcb0287cff5", - "content-hash": "48d3e6cb6a82e49be6cf95b54abd5364", "packages": [], "packages-dev": [ { @@ -527,12 +526,12 @@ "source": { "type": "git", "url": "https://github.com/joomla-projects/joomla-browser.git", - "reference": "b0056ff0018c529cc2a143f6d78004bce8f9d5b0" + "reference": "cdc02b3e3d7c112d83d625db7ea410dac4ce3142" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/joomla-projects/joomla-browser/zipball/b0056ff0018c529cc2a143f6d78004bce8f9d5b0", - "reference": "b0056ff0018c529cc2a143f6d78004bce8f9d5b0", + "url": "https://api.github.com/repos/joomla-projects/joomla-browser/zipball/cdc02b3e3d7c112d83d625db7ea410dac4ce3142", + "reference": "cdc02b3e3d7c112d83d625db7ea410dac4ce3142", "shasum": "" }, "require": { @@ -570,7 +569,7 @@ "acceptance testing", "joomla" ], - "time": "2015-10-31 11:00:18" + "time": "2015-10-31 15:09:12" }, { "name": "joomla-projects/robo", diff --git a/tests/acceptance/administrator/AdministratorCategoriesCest.php b/tests/acceptance/administrator/AdministratorCategoriesCest.php index fe00030..b521566 100644 --- a/tests/acceptance/administrator/AdministratorCategoriesCest.php +++ b/tests/acceptance/administrator/AdministratorCategoriesCest.php @@ -9,6 +9,68 @@ */ class AdministratorCategoriesCest { + /** + * Function to delete the menuItem + * + * @param string $menuItem Title of the menuItem which is to be deleted + * @return void + */ + private function deleteMenuItem(AcceptanceTester $I, $menuItem) + { + $I->amGoingTo('Delete the just saved MenuItem'); + $I->amOnPage('/administrator/index.php?option=com_menus&view=items'); + $I->searchForItem($menuItem); + $I->checkAllResults(); + $I->clickToolbarButton('Trash'); + $I->expectTo('see a success message and the menuItem removed from the list'); + $I->see('1 menu item successfully trashed.', ['id' => 'system-message-container']); + $I->searchForItem($menuItem); + $I->setFilter('select status', 'Trashed'); + $I->checkAllResults(); + $I->clickToolbarButton('empty trash'); + $I->see("1 menu item successfully deleted.", ['id' => 'system-message-container']); + } + + /** + * Creates a weblink with category + * + * @param string $title The title for the weblink + * @param string $url The url for the + * @param string $cat The category of the weblink + * + */ + private function createWeblinkWithCategory(AcceptanceTester $I, $title, $url, $cat) + { + $I->comment('I navigate to Weblinks page in /administrator/'); + $I->amOnPage('administrator/index.php?option=com_weblinks'); + $I->waitForText('Web Links', '30', ['css' => 'h1']); + $I->comment('I see weblinks page'); + $I->comment('I try to save a weblink with a filled title and URL'); + $I->click('New'); + $I->waitForText('Web Link: New', '30', ['css' => 'h1']); + $I->fillField(['id' => 'jform_title'], $title); + $I->fillField(['id' => 'jform_url'], $url); + $I->selectOptionInChosen('Category', "- " . $cat); + $I->click(['xpath' => "//button[@onclick=\"Joomla.submitbutton('weblink.save')\"]"]); + $I->waitForText('Web link successfully saved', '30', ['id' => 'system-message-container']); + } + + private function deleteWeblink(AcceptanceTester $I, $weblinkTitle) + { + $I->amGoingTo('Delete the just saved Weblink'); + $I->amOnPage('/administrator/index.php?option=com_weblinks'); + $I->searchForItem($weblinkTitle); + $I->checkAllResults(); + $I->clickToolbarButton('Trash'); + $I->expectTo('see a success message and the weblink removed from the list'); + $I->see('1 web link successfully trashed.', ['id' => 'system-message-container']); + $I->selectOptionInChosen('- Select Status -', 'Trashed'); + $I->searchForItem($weblinkTitle); + $I->checkAllResults(); + $I->clickToolbarButton('empty trash'); + $I->see("1 web link successfully deleted.", ['id' => 'system-message-container']); + } + public function administratorVerifyAvailableTabs(\Step\Acceptance\category $I) { $I->am('Administrator'); @@ -144,4 +206,76 @@ class AdministratorCategoriesCest $I->setFilter('select status','Archived'); $I->trashCategory('automated testing arch'.$salt); } + + public function administratorMenuWeblinkCategory(\Step\Acceptance\category $I) + { + $I->am('Administrator'); + $salt = rand(1, 100); + $categoryName = 'automated testing' . $salt; + + $I->doAdministratorLogin(); + $I->amGoingTo('Navigate to Categories page in /administrator/ and create a Category'); + $I->createCategory($categoryName); + $title = 'weblink' . $salt; + $url = 'www.google.com'; + $this->createWeblinkWithCategory($I, $title, $url, $categoryName); + $menuTitle = 'menuItem' . $salt; + $I->createMenuItem($menuTitle, $menuCategory = 'Weblinks', $menuItem = 'List Web Links in a Category', $menu = 'Main Menu', $language = 'All'); + $I->selectOptionInChosen('Select a Category', $categoryName); + $I->click('Save & Close'); + + // Go to the frontend + $I->comment('I want to check if the menu entry exists in the frontend'); + $I->amOnPage('index.php/'); + $I->click(['link' => $menuTitle]); + $I->waitForText($categoryName, 60, ['css' => 'h2']); + $I->seeElement(['xpath' => "//a[contains(text(),'" . $title . "')]"]); + + //Go to backend + $I->amOnPage('/administrator/'); + $this->deleteWeblink($I, $title); + $I->trashCategory($categoryName); + $this->deleteMenuItem($I, $menuTitle); + } + + + public function administratorWeblinkSubmit(\Step\Acceptance\category $I) + { + $I->am('Administrator'); + $I->wantToTest('Weblink creation in /administrator/'); + + $I->doAdministratorLogin(); + + // Get the weblink StepObject + $I->amGoingTo('Navigate to Weblinks page in /administrator/'); + $I->amOnPage('administrator/index.php?option=com_weblinks'); + $I->clickToolbarButton('options'); + $I->waitForText("Web Links Manager Options",30,['css' => 'h1']); + $I->click(['xpath' => "//a[contains(text(),'Permissions')]"]); + $I->selectOption('Create','Allowed'); + $I->clickToolbarButton('Save & Close'); + $I->waitForText("Web Links",30,['css' => 'h1']); + $I->amGoingTo('Navigate to Categories page in /administrator/ and create a Category'); + $salt = rand(1,100); + $categoryName = 'automated testing' . $salt; + $I->createCategory($categoryName); + $title = 'weblink' . $salt; + $url = 'www.google.com'; + $menuTitle = 'menuItem' . $salt; + $I->createMenuItem($menuTitle, $menuCategory = 'Weblinks', $menuItem = 'Submit a Web Link', $menu = 'Main Menu', $language = 'All'); + $I->click('Save & Close'); + + // Go to the frontend + $I->comment('I want to check if the menu entry exists in the frontend'); + $I->amOnPage('index.php/'); + $I->click(['link' => $menuTitle]); + $I->fillField(['id' => 'jform_title'], $title); + $I->selectOptionInChosen('Category', "- " . $categoryName); + $I->fillField(['id' => 'jform_url'], 'www.google.com'); + $I->click(['xpath' => "//button[@onclick=\"Joomla.submitbutton('weblink.save')\"]"]); + $I->see('Web Link successfully submitted.', ['id' => 'system-message-container']); + + $I->trashCategory($categoryName); + $this->deleteMenuItem($I, $menuTitle); + } } From 35e3f1f18acfe2540ac883e31b3db3fb6b6f89ba Mon Sep 17 00:00:00 2001 From: Francesco Abeni Date: Sun, 1 Nov 2015 10:42:34 +0100 Subject: [PATCH 07/11] Fix missing global option default --- src/com_weblinks/site/views/category/view.html.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/com_weblinks/site/views/category/view.html.php b/src/com_weblinks/site/views/category/view.html.php index fdb9555..2b16d2c 100644 --- a/src/com_weblinks/site/views/category/view.html.php +++ b/src/com_weblinks/site/views/category/view.html.php @@ -33,7 +33,7 @@ class WeblinksViewCategory extends JViewCategory { $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); } From 49ad05a93020edb2b1cef5978254327d86d268ea Mon Sep 17 00:00:00 2001 From: Francesco Abeni Date: Sun, 1 Nov 2015 10:56:43 +0100 Subject: [PATCH 08/11] Fix tests after PR #153 --- tests/acceptance/frontend/FrontendWeblinksCest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/acceptance/frontend/FrontendWeblinksCest.php b/tests/acceptance/frontend/FrontendWeblinksCest.php index 35b7372..ff3007a 100644 --- a/tests/acceptance/frontend/FrontendWeblinksCest.php +++ b/tests/acceptance/frontend/FrontendWeblinksCest.php @@ -32,7 +32,7 @@ class FrontendWeblinksCest $I->doAdministratorLogin(); - $I->createWeblink($this->title, $this->url); + $I->createWeblink($this->title, $this->url, "No"); // Menu link $I->createMenuItem($this->menuItem, 'Weblinks', 'List All Web Link Categories', 'Main Menu'); From 533ab019c0976c456b32c6783167603d19a59902 Mon Sep 17 00:00:00 2001 From: javier gomez Date: Sun, 1 Nov 2015 12:02:48 +0100 Subject: [PATCH 09/11] =?UTF-8?q?Revert=20"Test=20to=20submit=20a=20weblin?= =?UTF-8?q?k=20and=20test=20to=20Displays=20a=20list=20of=20Web=20Links=20?= =?UTF-8?q?for=E2=80=A6"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- composer.lock | 9 +- .../AdministratorCategoriesCest.php | 134 ------------------ 2 files changed, 5 insertions(+), 138 deletions(-) diff --git a/composer.lock b/composer.lock index aa96306..2ac7273 100644 --- a/composer.lock +++ b/composer.lock @@ -5,6 +5,7 @@ "This file is @generated automatically" ], "hash": "a92f2be1ccb2397e6cc71bcb0287cff5", + "content-hash": "48d3e6cb6a82e49be6cf95b54abd5364", "packages": [], "packages-dev": [ { @@ -526,12 +527,12 @@ "source": { "type": "git", "url": "https://github.com/joomla-projects/joomla-browser.git", - "reference": "cdc02b3e3d7c112d83d625db7ea410dac4ce3142" + "reference": "b0056ff0018c529cc2a143f6d78004bce8f9d5b0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/joomla-projects/joomla-browser/zipball/cdc02b3e3d7c112d83d625db7ea410dac4ce3142", - "reference": "cdc02b3e3d7c112d83d625db7ea410dac4ce3142", + "url": "https://api.github.com/repos/joomla-projects/joomla-browser/zipball/b0056ff0018c529cc2a143f6d78004bce8f9d5b0", + "reference": "b0056ff0018c529cc2a143f6d78004bce8f9d5b0", "shasum": "" }, "require": { @@ -569,7 +570,7 @@ "acceptance testing", "joomla" ], - "time": "2015-10-31 15:09:12" + "time": "2015-10-31 11:00:18" }, { "name": "joomla-projects/robo", diff --git a/tests/acceptance/administrator/AdministratorCategoriesCest.php b/tests/acceptance/administrator/AdministratorCategoriesCest.php index b521566..fe00030 100644 --- a/tests/acceptance/administrator/AdministratorCategoriesCest.php +++ b/tests/acceptance/administrator/AdministratorCategoriesCest.php @@ -9,68 +9,6 @@ */ class AdministratorCategoriesCest { - /** - * Function to delete the menuItem - * - * @param string $menuItem Title of the menuItem which is to be deleted - * @return void - */ - private function deleteMenuItem(AcceptanceTester $I, $menuItem) - { - $I->amGoingTo('Delete the just saved MenuItem'); - $I->amOnPage('/administrator/index.php?option=com_menus&view=items'); - $I->searchForItem($menuItem); - $I->checkAllResults(); - $I->clickToolbarButton('Trash'); - $I->expectTo('see a success message and the menuItem removed from the list'); - $I->see('1 menu item successfully trashed.', ['id' => 'system-message-container']); - $I->searchForItem($menuItem); - $I->setFilter('select status', 'Trashed'); - $I->checkAllResults(); - $I->clickToolbarButton('empty trash'); - $I->see("1 menu item successfully deleted.", ['id' => 'system-message-container']); - } - - /** - * Creates a weblink with category - * - * @param string $title The title for the weblink - * @param string $url The url for the - * @param string $cat The category of the weblink - * - */ - private function createWeblinkWithCategory(AcceptanceTester $I, $title, $url, $cat) - { - $I->comment('I navigate to Weblinks page in /administrator/'); - $I->amOnPage('administrator/index.php?option=com_weblinks'); - $I->waitForText('Web Links', '30', ['css' => 'h1']); - $I->comment('I see weblinks page'); - $I->comment('I try to save a weblink with a filled title and URL'); - $I->click('New'); - $I->waitForText('Web Link: New', '30', ['css' => 'h1']); - $I->fillField(['id' => 'jform_title'], $title); - $I->fillField(['id' => 'jform_url'], $url); - $I->selectOptionInChosen('Category', "- " . $cat); - $I->click(['xpath' => "//button[@onclick=\"Joomla.submitbutton('weblink.save')\"]"]); - $I->waitForText('Web link successfully saved', '30', ['id' => 'system-message-container']); - } - - private function deleteWeblink(AcceptanceTester $I, $weblinkTitle) - { - $I->amGoingTo('Delete the just saved Weblink'); - $I->amOnPage('/administrator/index.php?option=com_weblinks'); - $I->searchForItem($weblinkTitle); - $I->checkAllResults(); - $I->clickToolbarButton('Trash'); - $I->expectTo('see a success message and the weblink removed from the list'); - $I->see('1 web link successfully trashed.', ['id' => 'system-message-container']); - $I->selectOptionInChosen('- Select Status -', 'Trashed'); - $I->searchForItem($weblinkTitle); - $I->checkAllResults(); - $I->clickToolbarButton('empty trash'); - $I->see("1 web link successfully deleted.", ['id' => 'system-message-container']); - } - public function administratorVerifyAvailableTabs(\Step\Acceptance\category $I) { $I->am('Administrator'); @@ -206,76 +144,4 @@ class AdministratorCategoriesCest $I->setFilter('select status','Archived'); $I->trashCategory('automated testing arch'.$salt); } - - public function administratorMenuWeblinkCategory(\Step\Acceptance\category $I) - { - $I->am('Administrator'); - $salt = rand(1, 100); - $categoryName = 'automated testing' . $salt; - - $I->doAdministratorLogin(); - $I->amGoingTo('Navigate to Categories page in /administrator/ and create a Category'); - $I->createCategory($categoryName); - $title = 'weblink' . $salt; - $url = 'www.google.com'; - $this->createWeblinkWithCategory($I, $title, $url, $categoryName); - $menuTitle = 'menuItem' . $salt; - $I->createMenuItem($menuTitle, $menuCategory = 'Weblinks', $menuItem = 'List Web Links in a Category', $menu = 'Main Menu', $language = 'All'); - $I->selectOptionInChosen('Select a Category', $categoryName); - $I->click('Save & Close'); - - // Go to the frontend - $I->comment('I want to check if the menu entry exists in the frontend'); - $I->amOnPage('index.php/'); - $I->click(['link' => $menuTitle]); - $I->waitForText($categoryName, 60, ['css' => 'h2']); - $I->seeElement(['xpath' => "//a[contains(text(),'" . $title . "')]"]); - - //Go to backend - $I->amOnPage('/administrator/'); - $this->deleteWeblink($I, $title); - $I->trashCategory($categoryName); - $this->deleteMenuItem($I, $menuTitle); - } - - - public function administratorWeblinkSubmit(\Step\Acceptance\category $I) - { - $I->am('Administrator'); - $I->wantToTest('Weblink creation in /administrator/'); - - $I->doAdministratorLogin(); - - // Get the weblink StepObject - $I->amGoingTo('Navigate to Weblinks page in /administrator/'); - $I->amOnPage('administrator/index.php?option=com_weblinks'); - $I->clickToolbarButton('options'); - $I->waitForText("Web Links Manager Options",30,['css' => 'h1']); - $I->click(['xpath' => "//a[contains(text(),'Permissions')]"]); - $I->selectOption('Create','Allowed'); - $I->clickToolbarButton('Save & Close'); - $I->waitForText("Web Links",30,['css' => 'h1']); - $I->amGoingTo('Navigate to Categories page in /administrator/ and create a Category'); - $salt = rand(1,100); - $categoryName = 'automated testing' . $salt; - $I->createCategory($categoryName); - $title = 'weblink' . $salt; - $url = 'www.google.com'; - $menuTitle = 'menuItem' . $salt; - $I->createMenuItem($menuTitle, $menuCategory = 'Weblinks', $menuItem = 'Submit a Web Link', $menu = 'Main Menu', $language = 'All'); - $I->click('Save & Close'); - - // Go to the frontend - $I->comment('I want to check if the menu entry exists in the frontend'); - $I->amOnPage('index.php/'); - $I->click(['link' => $menuTitle]); - $I->fillField(['id' => 'jform_title'], $title); - $I->selectOptionInChosen('Category', "- " . $categoryName); - $I->fillField(['id' => 'jform_url'], 'www.google.com'); - $I->click(['xpath' => "//button[@onclick=\"Joomla.submitbutton('weblink.save')\"]"]); - $I->see('Web Link successfully submitted.', ['id' => 'system-message-container']); - - $I->trashCategory($categoryName); - $this->deleteMenuItem($I, $menuTitle); - } } From e3bb16c086adf5f21c75834566b71cb778611c51 Mon Sep 17 00:00:00 2001 From: javier gomez Date: Sun, 1 Nov 2015 11:52:58 +0100 Subject: [PATCH 10/11] Standarise Administrator Categories Tests --- .../acceptance/01-Install_Weblinks.txt | 10 - ...egories.administrator_Archive_Category.txt | 15 + ...tegories.administrator_Create_Category.txt | 17 ++ ...or_Create_Category_Without_Title_Fails.txt | 15 + ...tegories.administrator_Delete_Category.txt | 16 + ...egories.administrator_Publish_Category.txt | 15 + ...ategories.administrator_Trash_Category.txt | 16 + ...ories.administrator_Unpublish_Category.txt | 15 + ...es.administrator_Verify_Available_Tabs.txt | 10 + .../Install_Weblinks.install_Joomla.txt | 7 + .../Install_Weblinks.install_Weblinks.txt | 8 + .../AdministratorCategoriesCest.php | 288 ++++++++++-------- 12 files changed, 299 insertions(+), 133 deletions(-) delete mode 100644 tests/_data/scenarios/acceptance/01-Install_Weblinks.txt create mode 100644 tests/_data/scenarios/acceptance/Administrator_Categories.administrator_Archive_Category.txt create mode 100644 tests/_data/scenarios/acceptance/Administrator_Categories.administrator_Create_Category.txt create mode 100644 tests/_data/scenarios/acceptance/Administrator_Categories.administrator_Create_Category_Without_Title_Fails.txt create mode 100644 tests/_data/scenarios/acceptance/Administrator_Categories.administrator_Delete_Category.txt create mode 100644 tests/_data/scenarios/acceptance/Administrator_Categories.administrator_Publish_Category.txt create mode 100644 tests/_data/scenarios/acceptance/Administrator_Categories.administrator_Trash_Category.txt create mode 100644 tests/_data/scenarios/acceptance/Administrator_Categories.administrator_Unpublish_Category.txt create mode 100644 tests/_data/scenarios/acceptance/Administrator_Categories.administrator_Verify_Available_Tabs.txt create mode 100644 tests/_data/scenarios/acceptance/Install_Weblinks.install_Joomla.txt create mode 100644 tests/_data/scenarios/acceptance/Install_Weblinks.install_Weblinks.txt diff --git a/tests/_data/scenarios/acceptance/01-Install_Weblinks.txt b/tests/_data/scenarios/acceptance/01-Install_Weblinks.txt deleted file mode 100644 index 957d2a4..0000000 --- a/tests/_data/scenarios/acceptance/01-Install_Weblinks.txt +++ /dev/null @@ -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 \ No newline at end of file diff --git a/tests/_data/scenarios/acceptance/Administrator_Categories.administrator_Archive_Category.txt b/tests/_data/scenarios/acceptance/Administrator_Categories.administrator_Archive_Category.txt new file mode 100644 index 0000000..5cec2e5 --- /dev/null +++ b/tests/_data/scenarios/acceptance/Administrator_Categories.administrator_Archive_Category.txt @@ -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']" + diff --git a/tests/_data/scenarios/acceptance/Administrator_Categories.administrator_Create_Category.txt b/tests/_data/scenarios/acceptance/Administrator_Categories.administrator_Create_Category.txt new file mode 100644 index 0000000..df3e828 --- /dev/null +++ b/tests/_data/scenarios/acceptance/Administrator_Categories.administrator_Create_Category.txt @@ -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']" + diff --git a/tests/_data/scenarios/acceptance/Administrator_Categories.administrator_Create_Category_Without_Title_Fails.txt b/tests/_data/scenarios/acceptance/Administrator_Categories.administrator_Create_Category_Without_Title_Fails.txt new file mode 100644 index 0000000..68b9e18 --- /dev/null +++ b/tests/_data/scenarios/acceptance/Administrator_Categories.administrator_Create_Category_Without_Title_Fails.txt @@ -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']" + diff --git a/tests/_data/scenarios/acceptance/Administrator_Categories.administrator_Delete_Category.txt b/tests/_data/scenarios/acceptance/Administrator_Categories.administrator_Delete_Category.txt new file mode 100644 index 0000000..0e5a115 --- /dev/null +++ b/tests/_data/scenarios/acceptance/Administrator_Categories.administrator_Delete_Category.txt @@ -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']" + diff --git a/tests/_data/scenarios/acceptance/Administrator_Categories.administrator_Publish_Category.txt b/tests/_data/scenarios/acceptance/Administrator_Categories.administrator_Publish_Category.txt new file mode 100644 index 0000000..588ec38 --- /dev/null +++ b/tests/_data/scenarios/acceptance/Administrator_Categories.administrator_Publish_Category.txt @@ -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']" + diff --git a/tests/_data/scenarios/acceptance/Administrator_Categories.administrator_Trash_Category.txt b/tests/_data/scenarios/acceptance/Administrator_Categories.administrator_Trash_Category.txt new file mode 100644 index 0000000..085c31e --- /dev/null +++ b/tests/_data/scenarios/acceptance/Administrator_Categories.administrator_Trash_Category.txt @@ -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']" + diff --git a/tests/_data/scenarios/acceptance/Administrator_Categories.administrator_Unpublish_Category.txt b/tests/_data/scenarios/acceptance/Administrator_Categories.administrator_Unpublish_Category.txt new file mode 100644 index 0000000..976c45e --- /dev/null +++ b/tests/_data/scenarios/acceptance/Administrator_Categories.administrator_Unpublish_Category.txt @@ -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']" + diff --git a/tests/_data/scenarios/acceptance/Administrator_Categories.administrator_Verify_Available_Tabs.txt b/tests/_data/scenarios/acceptance/Administrator_Categories.administrator_Verify_Available_Tabs.txt new file mode 100644 index 0000000..a2fc14e --- /dev/null +++ b/tests/_data/scenarios/acceptance/Administrator_Categories.administrator_Verify_Available_Tabs.txt @@ -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']" + diff --git a/tests/_data/scenarios/acceptance/Install_Weblinks.install_Joomla.txt b/tests/_data/scenarios/acceptance/Install_Weblinks.install_Joomla.txt new file mode 100644 index 0000000..649a8e3 --- /dev/null +++ b/tests/_data/scenarios/acceptance/Install_Weblinks.install_Joomla.txt @@ -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 "" + diff --git a/tests/_data/scenarios/acceptance/Install_Weblinks.install_Weblinks.txt b/tests/_data/scenarios/acceptance/Install_Weblinks.install_Weblinks.txt new file mode 100644 index 0000000..21099d1 --- /dev/null +++ b/tests/_data/scenarios/acceptance/Install_Weblinks.install_Weblinks.txt @@ -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 "" + diff --git a/tests/acceptance/administrator/AdministratorCategoriesCest.php b/tests/acceptance/administrator/AdministratorCategoriesCest.php index fe00030..8c88af8 100644 --- a/tests/acceptance/administrator/AdministratorCategoriesCest.php +++ b/tests/acceptance/administrator/AdministratorCategoriesCest.php @@ -9,6 +9,170 @@ */ 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('Category Manager: Add A New Weblinks 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('Category Manager: Add A New Weblinks 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) { $I->am('Administrator'); @@ -19,129 +183,7 @@ class AdministratorCategoriesCest $I->amGoingTo('Navigate to Categories page in /administrator/ and verify the Tabs'); $I->amOnPage('administrator/index.php?option=com_categories&extension=com_weblinks'); $I->clickToolbarButton('New'); - $I->waitForText('Weblinks: New Category', '30', ['css' => 'h1']); + $I->waitForText('Category Manager: Add A New Weblinks Category', '30', ['css' => 'h1']); $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); - } } From 9b9603b08957b7aea08fcbd1916fa28def0493f4 Mon Sep 17 00:00:00 2001 From: javier gomez Date: Sun, 1 Nov 2015 13:49:10 +0100 Subject: [PATCH 11/11] Update com_categories new title --- .../administrator/AdministratorCategoriesCest.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/acceptance/administrator/AdministratorCategoriesCest.php b/tests/acceptance/administrator/AdministratorCategoriesCest.php index 8c88af8..53575a0 100644 --- a/tests/acceptance/administrator/AdministratorCategoriesCest.php +++ b/tests/acceptance/administrator/AdministratorCategoriesCest.php @@ -37,7 +37,7 @@ class AdministratorCategoriesCest $I->amGoingTo('try to save a category with empty title and it should fail'); $I->clickToolbarButton('new'); - $I->waitForText('Category Manager: Add A New Weblinks Category', '60', ['css' => 'h1']); + $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']); @@ -58,7 +58,7 @@ class AdministratorCategoriesCest $I->amGoingTo('try to save a category with a filled title'); $I->clickToolbarButton('New'); - $I->waitForText('Category Manager: Add A New Weblinks Category', '60', ['css' => 'h1']); + $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'); @@ -183,7 +183,7 @@ class AdministratorCategoriesCest $I->amGoingTo('Navigate to Categories page in /administrator/ and verify the Tabs'); $I->amOnPage('administrator/index.php?option=com_categories&extension=com_weblinks'); $I->clickToolbarButton('New'); - $I->waitForText('Category Manager: Add A New Weblinks Category', '30', ['css' => 'h1']); + $I->waitForText('Weblinks: New Category', '30', ['css' => 'h1']); $I->verifyAvailableTabs(['Category', 'Publishing', 'Permissions', 'Options']); } }