From 64870c54d317b6a3b5704cbf447cf8625717784e Mon Sep 17 00:00:00 2001 From: Brian Teeman Date: Wed, 22 Jul 2015 12:41:52 +0100 Subject: [PATCH 1/3] update strings AND new/edit --- .../admin/language/en-GB/en-GB.com_weblinks.ini | 6 ++++-- src/com_weblinks/admin/views/weblink/view.html.php | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/com_weblinks/admin/language/en-GB/en-GB.com_weblinks.ini b/src/com_weblinks/admin/language/en-GB/en-GB.com_weblinks.ini index 59c5239..1606b03 100644 --- a/src/com_weblinks/admin/language/en-GB/en-GB.com_weblinks.ini +++ b/src/com_weblinks/admin/language/en-GB/en-GB.com_weblinks.ini @@ -85,8 +85,10 @@ COM_WEBLINKS_FLOAT_LABEL="Image Float" COM_WEBLINKS_HITS_DESC="Number of hits for this web link." COM_WEBLINKS_LEFT="Left" COM_WEBLINKS_LIST_LAYOUT_DESC="These settings apply for Web Links List Layout Options unless they are changed for a specific menu item." -COM_WEBLINKS_MANAGER_WEBLINK="Web Links Manager: Web Link" -COM_WEBLINKS_MANAGER_WEBLINKS="Web Links Manager: Web Links" +COM_WEBLINKS_MANAGER_WEBLINK="Web Links" +COM_WEBLINKS_MANAGER_WEBLINKS="Web Links" +COM_WEBLINKS_MANAGER_WEBLINK_EDIT="Web Link: Edit" +COM_WEBLINKS_MANAGER_WEBLINK_NEW="Web Link: New" COM_WEBLINKS_N_ITEMS_ARCHIVED="%d web links successfully archived." COM_WEBLINKS_N_ITEMS_ARCHIVED_1="%d web link successfully archived." COM_WEBLINKS_N_ITEMS_CHECKED_IN_0="No web link successfully checked in." diff --git a/src/com_weblinks/admin/views/weblink/view.html.php b/src/com_weblinks/admin/views/weblink/view.html.php index 7cf8a59..0d330ab 100644 --- a/src/com_weblinks/admin/views/weblink/view.html.php +++ b/src/com_weblinks/admin/views/weblink/view.html.php @@ -58,7 +58,7 @@ class WeblinksViewWeblink extends JViewLegacy // Since we don't track these assets at the item level, use the category id. $canDo = JHelperContent::getActions('com_weblinks', 'category', $this->item->catid); - JToolbarHelper::title(JText::_('COM_WEBLINKS_MANAGER_WEBLINK'), 'link weblinks'); + JToolbarHelper::title($isNew ? JText::_('COM_WEBLINKS_MANAGER_WEBLINK_NEW') : JText::_('COM_WEBLINKS_MANAGER_WEBLINK_EDIT'), 'link weblinks'); // If not checked out, can save the item. if (!$checkedOut && ($canDo->get('core.edit')||(count($user->getAuthorisedCategories('com_weblinks', 'core.create'))))) From 0910b638a612adb7057292f38ac3e814d9fad4e0 Mon Sep 17 00:00:00 2001 From: javier gomez Date: Wed, 29 Jul 2015 18:21:47 +0200 Subject: [PATCH 2/3] Update Selenium --- RoboFile.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RoboFile.php b/RoboFile.php index 9e4a78e..eb66bca 100644 --- a/RoboFile.php +++ b/RoboFile.php @@ -147,7 +147,7 @@ class RoboFile extends \Robo\Tasks { $this->say('Downloading Selenium Server, this may take a while.'); $this->taskExec('wget') - ->arg('http://selenium-release.storage.googleapis.com/2.45/selenium-server-standalone-2.45.0.jar') + ->arg('http://selenium-release.storage.googleapis.com/2.46/selenium-server-standalone-2.46.0.jar') ->arg('-O selenium-server-standalone.jar') ->printed(false) ->run(); From 0a984f778b6c8203c9b444543893330905ecf6e8 Mon Sep 17 00:00:00 2001 From: javier gomez Date: Wed, 29 Jul 2015 18:23:47 +0200 Subject: [PATCH 3/3] Update tests with new strings --- tests/acceptance/01-InstallWeblinksCest.php | 18 +++--- .../AdministratorCategoriesCest.php | 28 +++++----- .../acceptance/AdministratorWeblinksCest.php | 56 ++++++++++++++----- tests/acceptance/MenuCest.php | 10 ++-- 4 files changed, 69 insertions(+), 43 deletions(-) diff --git a/tests/acceptance/01-InstallWeblinksCest.php b/tests/acceptance/01-InstallWeblinksCest.php index 5484b7d..6093714 100644 --- a/tests/acceptance/01-InstallWeblinksCest.php +++ b/tests/acceptance/01-InstallWeblinksCest.php @@ -19,13 +19,13 @@ class InstallWeblinksCest $I->setErrorReportingToDevelopment(); } - // tests - public function installWeblinks(AcceptanceTester $I) - { - $I->doAdministratorLogin(); - $I->comment('get Weblinks repository folder from acceptance.suite.yml (see _support/AcceptanceHelper.php)'); - $path = $I->getConfiguration('repo_folder'); - $I->installExtensionFromDirectory($path . 'src/com_weblinks/'); - $I->doAdministratorLogout(); - } + // tests + public function installWeblinks(AcceptanceTester $I) + { + $I->doAdministratorLogin(); + $I->comment('get Weblinks repository folder from acceptance.suite.yml (see _support/AcceptanceHelper.php)'); + $path = $I->getConfiguration('repo_folder'); + $I->installExtensionFromFolder($path . 'src/com_weblinks/'); + $I->doAdministratorLogout(); + } } \ No newline at end of file diff --git a/tests/acceptance/AdministratorCategoriesCest.php b/tests/acceptance/AdministratorCategoriesCest.php index 86a41ce..9e2d0bb 100644 --- a/tests/acceptance/AdministratorCategoriesCest.php +++ b/tests/acceptance/AdministratorCategoriesCest.php @@ -20,13 +20,13 @@ class AdministratorCategoriesCest $I->amGoingTo('Navigate to Categories page in /administrator/'); $I->amOnPage('administrator/index.php?option=com_categories&extension=com_weblinks'); - $I->waitForText('Weblinks: Categories','5',['css' => 'h1']); + $I->waitForText('Weblinks: Categories','30',['css' => 'h1']); $I->expectTo('see categories page'); $I->checkForPhpNoticesOrWarnings(); $I->amGoingTo('try to save a category with a filled title'); $I->click(['xpath'=> "//button[@onclick=\"Joomla.submitbutton('category.add')\"]"]); - $I->waitForText('Category Manager: Add A New Weblinks Category','5',['css' => 'h1']); + $I->waitForText('Category Manager: Add A New Weblinks Category','30',['css' => 'h1']); $I->fillField(['id' => 'jform_title'],'automated testing' . rand(1,100)); $I->click(['xpath'=> "//button[@onclick=\"Joomla.submitbutton('category.apply')\"]"]); $I->expectTo('see a success message after saving the category'); @@ -42,12 +42,12 @@ class AdministratorCategoriesCest $I->amGoingTo('Navigate to Categories page in /administrator/'); $I->amOnPage('administrator/index.php?option=com_categories&extension=com_weblinks'); - $I->waitForText('Weblinks: Categories','5',['css' => 'h1']); + $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('Category Manager: Add A New Weblinks Category','5',['css' => 'h1']); + $I->waitForText('Category Manager: Add A New Weblinks 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']); @@ -62,13 +62,13 @@ class AdministratorCategoriesCest $I->amGoingTo('Navigate to Categories page in /administrator/'); $I->amOnPage('administrator/index.php?option=com_categories&extension=com_weblinks'); - $I->waitForText('Weblinks: Categories','5',['css' => 'h1']); + $I->waitForText('Weblinks: Categories','30',['css' => 'h1']); $I->expectTo('see categories page'); $I->checkForPhpNoticesOrWarnings(); $I->amGoingTo('try to save a category with a filled title'); $I->click(['xpath'=> "//button[@onclick=\"Joomla.submitbutton('category.add')\"]"]); - $I->waitForText('Category Manager: Add A New Weblinks Category','5',['css' => 'h1']); + $I->waitForText('Category Manager: Add A New Weblinks Category','30',['css' => 'h1']); $I->fillField(['id' => 'jform_title'],'automated testing pub' . rand(1,100)); $I->click(['xpath'=> "//button[@onclick=\"Joomla.submitbutton('category.save')\"]"]); @@ -78,13 +78,13 @@ class AdministratorCategoriesCest $I->amGoingTo('Search for automated testing'); $I->fillField(['xpath'=> "//input[@id=\"filter_search\"]"], "automated testing pub" . "\n"); - $I->waitForText('Weblinks: Categories','5',['css' => 'h1']); + $I->waitForText('Weblinks: Categories','30',['css' => 'h1']); $I->amGoingTo('Select the first weblink'); $I->click(['xpath'=> "//input[@id=\"cb0\"]"]); $I->amGoingTo('try to publish 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.publish')}\"]"]); - $I->waitForText('Weblinks: Categories','5',['css' => 'h1']); + $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']); } @@ -98,13 +98,13 @@ class AdministratorCategoriesCest $I->amGoingTo('Navigate to Categories page in /administrator/'); $I->amOnPage('administrator/index.php?option=com_categories&extension=com_weblinks'); - $I->waitForText('Weblinks: Categories','5',['css' => 'h1']); + $I->waitForText('Weblinks: Categories','30',['css' => 'h1']); $I->expectTo('see categories page'); $I->checkForPhpNoticesOrWarnings(); $I->amGoingTo('try to save a category with a filled title'); $I->click(['xpath'=> "//button[@onclick=\"Joomla.submitbutton('category.add')\"]"]); - $I->waitForText('Category Manager: Add A New Weblinks Category','5',['css' => 'h1']); + $I->waitForText('Category Manager: Add A New Weblinks Category','30',['css' => 'h1']); $I->fillField(['id' => 'jform_title'],'automated testing unpub' . rand(1,100)); $I->click(['xpath'=> "//button[@onclick=\"Joomla.submitbutton('category.save')\"]"]); @@ -114,24 +114,24 @@ class AdministratorCategoriesCest $I->amGoingTo('Search for automated testing'); $I->fillField(['xpath'=> "//input[@id=\"filter_search\"]"], "automated testing unpub" . "\n"); - $I->waitForText('Weblinks: Categories','5',['css' => 'h1']); + $I->waitForText('Weblinks: Categories','30',['css' => 'h1']); $I->amGoingTo('Select the first weblink'); $I->click(['xpath'=> "//input[@id=\"cb0\"]"]); $I->amGoingTo('Try to publish 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.publish')}\"]"]); - $I->waitForText('Weblinks: Categories','5',['css' => 'h1']); + $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','5',['css' => 'h1']); + $I->waitForText('Weblinks: Categories','30',['css' => 'h1']); $I->amGoingTo('Select the first weblink'); $I->click(['xpath'=> "//input[@id=\"cb0\"]"]); $I->amGoingTo('Try to unpublish 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.unpublish')}\"]"]); - $I->waitForText('Weblinks: Categories','5',['css' => 'h1']); + $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']); } diff --git a/tests/acceptance/AdministratorWeblinksCest.php b/tests/acceptance/AdministratorWeblinksCest.php index a926233..e591692 100644 --- a/tests/acceptance/AdministratorWeblinksCest.php +++ b/tests/acceptance/AdministratorWeblinksCest.php @@ -28,17 +28,17 @@ class AdministratorWeblinksCest $I->amGoingTo('Navigate to Weblinks page in /administrator/'); $I->amOnPage('administrator/index.php?option=com_weblinks'); - $I->waitForText('Web Links Manager: Web Links','5',['css' => 'h1']); + $I->waitForText('Web Links','30',['css' => 'h1']); $I->expectTo('see weblinks page'); $I->checkForPhpNoticesOrWarnings(); $I->amGoingTo('try to save a weblink with a filled title and URL'); $I->click(['xpath'=> "//button[@onclick=\"Joomla.submitbutton('weblink.add')\"]"]); - $I->waitForText('Web Links Manager: Web Link','5',['css' => 'h1']); + $I->waitForText('Web Link: New','30',['css' => 'h1']); $I->fillField(['id' => 'jform_title'], $this->title); $I->fillField(['id' => 'jform_url'],'http://example.com/automated_testing' . $this->title); $I->click(['xpath'=> "//button[@onclick=\"Joomla.submitbutton('weblink.save')\"]"]); - $I->waitForText('Web Links Manager: Web Link','5',['css' => 'h1']); + $I->waitForText('Web Links','30',['css' => 'h1']); $I->expectTo('see a success message and the weblink added after saving the weblink'); $I->see('Web link successfully saved',['id' => 'system-message-container']); $I->see($this->title,['id' => 'weblinkList']); @@ -49,7 +49,7 @@ class AdministratorWeblinksCest * * @param AcceptanceTester $I */ - public function administratorCreateWeblinkTrash(AcceptanceTester $I) + public function administratorTrashWeblink(AcceptanceTester $I) { $I->am('Administrator'); $I->wantToTest('Weblink removal in /administrator/'); @@ -58,26 +58,52 @@ class AdministratorWeblinksCest $I->amGoingTo('Navigate to Weblinks page in /administrator/'); $I->amOnPage('administrator/index.php?option=com_weblinks'); - $I->waitForText('Web Links Manager: Web Links','5',['css' => 'h1']); + $I->waitForText('Web Links','30',['css' => 'h1']); $I->expectTo('see weblinks page'); - $I->checkForPhpNoticesOrWarnings(); $I->amGoingTo('Search the just saved weblink'); - $I->fillField(['id' => 'filter_search'],$this->title); - $I->pressKey(['id' => 'filter_search'],WebDriverKeys::ENTER); - $I->waitForText('Web Links Manager: Web Links','5',['css' => 'h1']); - $I->expectTo('see weblinks page'); - $I->checkForPhpNoticesOrWarnings(); + $I->searchForItem($this->title); + $I->waitForText('Web Links','30',['css' => 'h1']); $I->amGoingTo('Delete the just saved weblink'); - $I->click(['id' => 'cb0']); + $I->checkAllResults(); $I->click(['xpath'=> "//button[@onclick=\"if (document.adminForm.boxchecked.value==0){alert('Please first make a selection from the list');}else{ Joomla.submitbutton('weblinks.trash')}\"]"]); - $I->waitForText('Web Links Manager: Web Link','5',['css' => 'h1']); + $I->waitForText('Web Links','30',['css' => 'h1']); $I->expectTo('see a success message and the weblink removed from the list'); $I->see('Web link successfully trashed',['id' => 'system-message-container']); $I->cantSee($this->title,['id' => 'weblinkList']); } + /** + * @depends administratorCreateWeblink + * + * @param AcceptanceTester $I + */ + public function administratorDeleteWeblink(AcceptanceTester $I) + { + $I->am('Administrator'); + $I->wantToTest('Weblink removal in /administrator/'); + + $I->doAdministratorLogin(); + + $I->amGoingTo('Navigate to Weblinks page in /administrator/'); + $I->amOnPage('administrator/index.php?option=com_weblinks'); + $I->waitForText('Web Links','30',['css' => 'h1']); + $I->expectTo('see weblinks page'); + $I->selectOptionInChosen('- Select Status -', 'Trashed'); + $I->amGoingTo('Search the just saved weblink'); + $I->searchForItem($this->title); + $I->waitForText('Web Links','30',['css' => 'h1']); + + $I->amGoingTo('Delete the just saved weblink'); + $I->checkAllResults(); + $I->click(['xpath'=> '//div[@id="toolbar-delete"]/button']); + $I->waitForText('Web Links','30',['css' => 'h1']); + $I->expectTo('see a success message and the weblink removed from the list'); + $I->see('1 web link successfully deleted.',['id' => 'system-message-container']); + $I->cantSee($this->title,['id' => 'weblinkList']); + } + public function administratorCreateWeblinkWithoutTitleFails(AcceptanceTester $I) { $I->am('Administrator'); @@ -87,13 +113,13 @@ class AdministratorWeblinksCest $I->amGoingTo('Navigate to Weblinks page in /administrator/'); $I->amOnPage('administrator/index.php?option=com_weblinks'); - $I->waitForText('Web Links Manager: Web Links','5',['css' => 'h1']); + $I->waitForText('Web Links','30',['css' => 'h1']); $I->expectTo('see weblinks page'); $I->checkForPhpNoticesOrWarnings(); $I->amGoingTo('try to save a weblink with empty title and it should fail'); $I->click(['xpath'=> "//button[@onclick=\"Joomla.submitbutton('weblink.add')\"]"]); - $I->waitForText('Web Links Manager: Web Link','5',['css' => 'h1']); + $I->waitForText('Web Link: New','30',['css' => 'h1']); $I->click(['xpath'=> "//button[@onclick=\"Joomla.submitbutton('weblink.apply')\"]"]); $I->expectTo('see an error when trying to save a weblink without title and without URL'); $I->see('Invalid field: Title',['id' => 'system-message-container']); diff --git a/tests/acceptance/MenuCest.php b/tests/acceptance/MenuCest.php index 9364771..cb24708 100644 --- a/tests/acceptance/MenuCest.php +++ b/tests/acceptance/MenuCest.php @@ -31,25 +31,25 @@ class MenuCest $I->doAdministratorLogin(); $I->amGoingTo('Navigate to Menu Manager page in /administrator/'); $I->amOnPage('administrator/index.php?option=com_menus&view=items&menutype=mainmenu'); - $I->waitForText('Menus: Items', '5', ['css' => 'h1']); + $I->waitForText('Menus: Items','30', ['css' => 'h1']); $I->expectTo('see menu menager items'); $I->checkForPhpNoticesOrWarnings(); $I->amGoingTo('try to save a category with a filled title'); $I->click(['xpath' => "//button[@onclick=\"Joomla.submitbutton('item.add')\"]"]); - $I->waitForText('Menus: New Item', '5', ['css' => 'h1']); + $I->waitForText('Menus: New Item','30', ['css' => 'h1']); $I->fillField(['id' => 'jform_title'], 'automated testing' . rand(1, 100)); $I->click(['xpath' => "//a[@href=\"#menuTypeModal\"]"]); - $I->waitForElement('.iframe', 60); + $I->waitForElement('.iframe','30'); $I->comment('I switch to Menu Type iframe'); $I->switchToIFrame("Menu Item Type"); - $I->waitForElementVisible(['link' => "Weblinks"],60); + $I->waitForElementVisible(['link' => "Weblinks"],'30'); $I->click(['link' => "Weblinks"]); $I->wait(1); $I->waitForElementVisible(['xpath' => "//a[contains(@title, 'Show all the web link categories within a category')]"], 60); $I->click(['xpath' => "//a[contains(@title, 'Show all the web link categories within a category')]"]); $I->wait(1); $I->switchToIFrame(); - $I->waitForElement(['xpath' => "//input[@value='List All Web Link Categories']"],60); + $I->waitForElement(['xpath' => "//input[@value='List All Web Link Categories']"],'30'); $I->click(['xpath' => "//button[@onclick=\"Joomla.submitbutton('item.apply')\"]"]); $I->expectTo('see a success message after saving the category'); $I->see('Menu item successfully saved', ['id' => 'system-message-container']);