Skip to content
This repository was archived by the owner on Mar 17, 2020. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions RoboFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ public function runTests($opts = ['use-htaccess' => false, 'env' => 'desktop'])
->arg('--debug')
->arg('--fail-fast')
->arg('--env ' . $opts['env'])
->arg($this->testsPath . 'acceptance/extensions.feature')
->arg($this->testsPath . 'acceptance/users_frontend.feature')
->run()
->stopOnFail();

Expand All @@ -364,7 +364,16 @@ public function runTests($opts = ['use-htaccess' => false, 'env' => 'desktop'])
->arg('--debug')
->arg('--fail-fast')
->arg('--env ' . $opts['env'])
->arg($this->testsPath . 'acceptance/users_frontend.feature')
->arg($this->testsPath . 'acceptance/banner.feature')
->run()
->stopOnFail();

$this->taskCodecept($pathToCodeception)
->arg('--steps')
->arg('--debug')
->arg('--fail-fast')
->arg('--env ' . $opts['env'])
->arg($this->testsPath . 'acceptance/extensions.feature')
->run()
->stopOnFail();

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?php
/**
* @package Joomla.Test
* @subpackage AcceptanceTester.Page
*
* @copyright Copyright (C) 2005 - 2016 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace Page\Acceptance\Administrator;

/**
* Acceptance Page object class to define Control Panel page objects.
*
* @package Page\Acceptance\Administrator
*
* @since __DEPLOY_VERSION__
*/
class BannerManagerPage extends AdminPage
{
public static $url = "/administrator/index.php?option=com_banners";

public static $titleField = ['id' => 'jform_name'];

public static $aliasField = ['id' => 'jform_alias'];

public static $searchField = ['id' => 'filter_search'];

public static $searchButton = ['class' => 'icon-search'];

public static $searchToolButton = ['css' => 'button[data-original-title="Filter the list items."]'];
}
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ public function uninstallExtension($extensionName)
$I->click(['xpath' => "//input[@id='cb0']"]);
$I->click(['xpath' => "//div[@id='toolbar-delete']/button"]);
$I->acceptPopup();
$I->wait(3);
$I->seeSystemMessage(self::$managePageTitle, 'was successful');
$I->searchForItem($extensionName);
$I->waitForText(
Expand Down
213 changes: 213 additions & 0 deletions tests/codeception/_support/Step/Acceptance/Administrator/Banner.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,213 @@
<?php
/**
* @package Joomla.Test
* @subpackage AcceptanceTester.Step
*
* @copyright Copyright (C) 2005 - 2016 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/

namespace Step\Acceptance\Administrator;

use Page\Acceptance\Administrator\BannerManagerPage;

/**
* Acceptance Step object class contains suits for Content Manager.
*
* @package Step\Acceptance\Administrator
*
* @since __DEPLOY_VERSION__
*/
class Banner extends \AcceptanceTester
{
/**
* @Given There is an add Banner link
*/
public function thereIsAnAddBannerLink()
{
$I = $this;
$I->amOnPage(BannerManagerPage::$url);
$I->clickToolbarButton('New');
}
/**
* @When I create a new banner with field title as :title
*/
public function iCreateANewBannerWithFieldTitleAs($title)
{
$I = $this;
$I->fillField(BannerManagerPage::$titleField, $title);
}
/**
* @When I save a Banner
*/
public function iSaveABanner()
{
$I = $this;
$I->clickToolbarButton('Save & Close');
}
/**
* @Then I should see the :Banner successfully saved. message
*/
public function iShouldSeeTheMessage($message)
{
$I = $this;
$I->waitForText($message, TIMEOUT, BannerManagerPage::$systemMessageContainer);
$I->see($message, BannerManagerPage::$systemMessageContainer);
}
/**
* @Given There is a Banner listing page
*/
public function thereIsABannerListingPage()
{
$I = $this;
$I->amOnPage(BannerManagerPage::$url);
}
/**
* @When I Click the Banner with Name :Gsocbanner
*/
public function iClickTheBannerWithName($title)
{
$I = $this;
$I->fillField(BannerManagerPage::$searchField, $title);
$I->Click(BannerManagerPage::$searchButton);
$I->checkAllResults();
$I->clickToolbarButton('edit');
}
/**
* @When I have Change the Banner field title to :Gsocbanner
*/
public function iHaveChangeTheBannerFieldTitleTo($title)
{
$I = $this;
$I->fillField(BannerManagerPage::$titleField, $title);
$I->fillField(BannerManagerPage::$aliasField, $title);
}
/**
* @When I select the Banner with Name :Gsocbanner which needs to be published
*/
public function iSelectTheBannerWithNameWhichNeedsToBePublished($title)
{
$I = $this;
$I->fillField(BannerManagerPage::$searchField, $title);
$I->Click(BannerManagerPage::$searchButton);
$I->checkAllResults();
}
/**
* @When I have publish the Banner
*/
public function iHavePublishTheBanner()
{
$I = $this;
$I->clickToolbarButton('Publish');
}
/**
* @When I select the Banner with Name :Gsocbanner which needs to be unpublished
*/
public function iSelectTheBannerWithNameWhichNeedsToBeUnpublished($title)
{
$I = $this;
$I->fillField(BannerManagerPage::$searchField, $title);
$I->Click(BannerManagerPage::$searchButton);
$I->checkAllResults();
}
/**
* @When I have unpublish the Banner
*/
public function iHaveUnpublishTheBanner()
{
$I = $this;
$I->clickToolbarButton('Unpublish');
}
/**
* @When I select the Banner with Name :Gsocbanner which needs to be Trash
*/
public function iSelectTheBannerWithNameWhichNeedsToBeTrash($title)
{
$I = $this;
$I->fillField(BannerManagerPage::$searchField, $title);
$I->Click(BannerManagerPage::$searchButton);
$I->checkAllResults();
}
/**
* @When I have Trash the Banner
*/
public function iTrashTheBanner()
{
$I = $this;
$I->clickToolbarButton('Trash');
}

/**
* @When I select the Banner with Name "randombanner" which needs to be Remove Trash
*/
public function iSelectTheBannerWithNameWhichNeedsToBeRemoveTrash()
{
$I = $this;
$I->Click(BannerManagerPage::$searchToolButton);
$I->selectOptionInChosenByIdUsingJs('filter_published', "Trashed");
$I->checkAllResults();
}
/**
* @When I Remove Trash the Banner
*/
public function iRemoveTrashTheBanner()
{
$I = $this;
$I->clickToolbarButton('Empty trash');
$I->acceptPopup();
}
/**
* @When I select the Banner with Name :Gsocbanner which needs to be archived
*/
public function iSelectTheBannerWithNameWhichNeedsToBeArchived($title)
{
$I = $this;
$I->fillField(BannerManagerPage::$searchField, $title);
$I->Click(BannerManagerPage::$searchButton);
$I->checkAllResults();
}
/**
* @When I archived the Banner
*/
public function iArchivedTheBanner()
{
$I = $this;
$I->clickToolbarButton('Archive');
}
/**
* @When I select the Banner with Name :Gsocbanner which needs to be Unarchive
*/
public function iSelectTheBannerWithNameWhichNeedsToBeUnarchive()
{
$I = $this;
$I->Click(BannerManagerPage::$searchToolButton);
$I->selectOptionInChosenById('filter_published', "Archived");
$I->checkAllResults();
}
/**
* @When I Unarchive the Banner
*/
public function iUnarchiveTheBanner()
{
$I = $this;
$I->clickToolbarButton('unarchive');
}
/**
* @When I select the Banner with Name :arg1 which needs to be Check-In
*/
public function iSelectTheBannerWithNameWhichNeedsToBeCheckIn($title)
{
$I = $this;
$I->fillField(BannerManagerPage::$searchField, $title);
$I->Click(BannerManagerPage::$searchButton);
$I->checkAllResults();
}
/**
* @When I Check-In the Banner
*/
public function iCheckInTheBanner()
{
$I = $this;
$I->clickToolbarButton('Check-in');
}
}
2 changes: 2 additions & 0 deletions tests/codeception/acceptance.suite.dist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,5 @@ gherkin:
- Step\Acceptance\Administrator\Content
- Step\Acceptance\Administrator\Category
- Step\Acceptance\Administrator\Admin
- Step\Acceptance\Administrator\Extension
- Step\Acceptance\Administrator\Banner
50 changes: 50 additions & 0 deletions tests/codeception/acceptance/banner.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
Feature: Banner
In order to manage Banner article in the web
I need to create modify trash archived Check-In And publish and Unpublish Banner

Background:
When I Login into Joomla administrator
And I see the administrator dashboard

Scenario: Create a Banner
Given There is an add Banner link
When I create a new banner with field title as "banner"
And I save a Banner
Then I should see the "Banner successfully saved." message

Scenario: Modify a Banner
Given There is a Banner listing page
When I Click the Banner with Name "banner"
And I have Change the Banner field title to "randombanner1"
And I save a Banner
Then I should see the "Banner successfully saved." message

Scenario: publish a Banner
Given There is a Banner listing page
When I select the Banner with Name "randombanner" which needs to be published
And I have publish the Banner
Then I should see the "1 banner successfully published." message

Scenario: Unpublish an Banner
Given There is a Banner listing page
When I select the Banner with Name "randombanner" which needs to be unpublished
And I have unpublish the Banner
Then I should see the "1 banner successfully unpublished." message

Scenario: Check-In a Banner
Given There is a Banner listing page
When I select the Banner with Name "randombanner" which needs to be Check-In
And I Check-In the Banner
Then I should see the "1 banner successfully checked in." message

Scenario: Trash a Banner
Given There is a Banner listing page
When I select the Banner with Name "randombanner" which needs to be Trash
And I have Trash the Banner
Then I should see the "1 banner successfully trashed." message

Scenario: Remove trash a Banner
Given There is a Banner listing page
When I select the Banner with Name "randombanner" which needs to be Remove Trash
And I Remove Trash the Banner
Then I should see the "1 banner successfully deleted." message
7 changes: 1 addition & 6 deletions tests/codeception/acceptance/extensions.feature
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,4 @@ Feature: extensions
Scenario: Test extension update
Given There is an extension "weblinks" installed with update available
When I install extension update
Then I should see the extension "weblinks" is updated

Scenario: Test extension uninstall
Given There is an extension "weblinks" installed
When I uninstall the extension
Then I should see the extension "weblinks" is uninstalled
Then I should see the extension "weblinks" is updated