From 533ab019c0976c456b32c6783167603d19a59902 Mon Sep 17 00:00:00 2001 From: javier gomez Date: Sun, 1 Nov 2015 12:02:48 +0100 Subject: [PATCH] =?UTF-8?q?Revert=20"Test=20to=20submit=20a=20weblink=20an?= =?UTF-8?q?d=20test=20to=20Displays=20a=20list=20of=20Web=20Links=20for?= =?UTF-8?q?=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); - } }