Merge pull request #137 from javigomez/puneettabschecker

Test to validate the Tabs on edit view
This commit is contained in:
javier gomez 2015-10-31 14:43:24 +01:00
commit da61ac9fe3
2 changed files with 31 additions and 3 deletions

View File

@ -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');

View File

@ -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']);