From 75c309e843d89a25599e13fcdd00a77a7178db2a Mon Sep 17 00:00:00 2001 From: puneet0191 Date: Sat, 31 Oct 2015 12:44:29 +0100 Subject: [PATCH] Test to validate the Tabs on edit view For more information see this issue: --- composer.lock | 8 ++++---- .../AdministratorCategoriesCest.php | 14 +++++++++++++ .../AdministratorWeblinksCest.php | 20 ++++++++++++++++--- 3 files changed, 35 insertions(+), 7 deletions(-) diff --git a/composer.lock b/composer.lock index f7fbb90..9800e76 100644 --- a/composer.lock +++ b/composer.lock @@ -525,12 +525,12 @@ "source": { "type": "git", "url": "https://github.com/joomla-projects/joomla-browser.git", - "reference": "0999fe673c34fbcf252957b6bc96bbf48956d70e" + "reference": "b0056ff0018c529cc2a143f6d78004bce8f9d5b0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/joomla-projects/joomla-browser/zipball/0999fe673c34fbcf252957b6bc96bbf48956d70e", - "reference": "0999fe673c34fbcf252957b6bc96bbf48956d70e", + "url": "https://api.github.com/repos/joomla-projects/joomla-browser/zipball/b0056ff0018c529cc2a143f6d78004bce8f9d5b0", + "reference": "b0056ff0018c529cc2a143f6d78004bce8f9d5b0", "shasum": "" }, "require": { @@ -568,7 +568,7 @@ "acceptance testing", "joomla" ], - "time": "2015-10-30 13:37:14" + "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 c74394c..fe00030 100644 --- a/tests/acceptance/administrator/AdministratorCategoriesCest.php +++ b/tests/acceptance/administrator/AdministratorCategoriesCest.php @@ -9,6 +9,20 @@ */ class AdministratorCategoriesCest { + public function administratorVerifyAvailableTabs(\Step\Acceptance\category $I) + { + $I->am('Administrator'); + $I->wantToTest('Category Edit View Tabs'); + + $I->doAdministratorLogin(); + + $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->verifyAvailableTabs(['Category', 'Publishing', 'Permissions', 'Options']); + } + public function administratorCreateCategory(\Step\Acceptance\category $I) { $I->am('Administrator'); diff --git a/tests/acceptance/administrator/AdministratorWeblinksCest.php b/tests/acceptance/administrator/AdministratorWeblinksCest.php index 301bf27..0b5ec65 100644 --- a/tests/acceptance/administrator/AdministratorWeblinksCest.php +++ b/tests/acceptance/administrator/AdministratorWeblinksCest.php @@ -16,6 +16,20 @@ class AdministratorWeblinksCest $this->url = $this->faker->url(); } + public function administratorVerifyAvailableTabs(\Step\Acceptance\weblink $I) + { + $I->am('Administrator'); + $I->wantToTest('Weblinks Edit View Tabs'); + + $I->doAdministratorLogin(); + + $I->amGoingTo('Navigate to Weblinks page in /administrator/ and verify the Tabs'); + $I->amOnPage('administrator/index.php?option=com_weblinks&view=weblinks'); + $I->clickToolbarButton('New'); + $I->waitForText('Web Link: New', '30', ['css' => 'h1']); + $I->verifyAvailableTabs(['New Web Link', 'Images', 'Publishing', 'Options', 'Metadata']); + } + public function administratorCreateWeblink(\Step\Acceptance\weblink $I) { $I->am('Administrator'); @@ -31,11 +45,11 @@ class AdministratorWeblinksCest $I->checkForPhpNoticesOrWarnings(); $I->amGoingTo('try to save a weblink with a filled title and URL'); - $I->click('New'); + $I->clickToolbarButton('New'); $I->waitForText('Web Link: New', '30', ['css' => 'h1']); $I->fillField(['id' => 'jform_title'], $this->title); $I->fillField(['id' => 'jform_url'], $this->url); - $I->click(['xpath' => "//button[@onclick=\"Joomla.submitbutton('weblink.save')\"]"]); + $I->clickToolbarButton('Save & Close'); $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']); @@ -63,7 +77,7 @@ class AdministratorWeblinksCest $I->amGoingTo('Delete the just saved weblink'); $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->clickToolbarButton('Trash'); $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']);