This repository was archived by the owner on Mar 17, 2020. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 28
Adding gherkin scenarios for Banners #53
Closed
Closed
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
tests/_support/Page/Acceptance/Administrator/BannerPage.php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?php | ||
namespace Page\Acceptance\Administrator; | ||
|
||
use Page\Acceptance\Administrator\AdminPage; | ||
|
||
class BannerPage 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."]']; | ||
} |
219 changes: 219 additions & 0 deletions
219
tests/_support/Step/Acceptance/Administrator/Banner.php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,219 @@ | ||
<?php | ||
namespace Step\Acceptance\Administrator; | ||
|
||
use Page\Acceptance\Administrator\BannerPage; | ||
|
||
|
||
class Banner extends \AcceptanceTester | ||
{ | ||
/** | ||
* @Given There is an add Banner link | ||
*/ | ||
public function thereIsAnAddBannerLink() | ||
{ | ||
$I = $this; | ||
$I->amOnPage(BannerPage::$url); | ||
$I->clickToolbarButton('New'); | ||
} | ||
|
||
/** | ||
* @When I create a new banner with field title as :title | ||
*/ | ||
public function iCreateANewBannerWithFieldTitleAs($title) | ||
{ | ||
$I = $this; | ||
$I->fillField(BannerPage::$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, AdminPage::$systemMessageContainer); | ||
$I->see($message, AdminPage::$systemMessageContainer); | ||
} | ||
|
||
/** | ||
* @Given There is a Banner listing page | ||
*/ | ||
public function thereIsABannerListingPage() | ||
{ | ||
$I = $this; | ||
$I->amOnPage(BannerPage::$url); | ||
} | ||
|
||
/** | ||
* @When I Click the Banner with Name :Gsocbanner | ||
*/ | ||
public function iClickTheBannerWithName($title) | ||
{ | ||
$I = $this; | ||
$I->fillField(BannerPage::$searchField, $title); | ||
$I->Click(BannerPage::$searchButton); | ||
$I->checkAllResults(); | ||
$I->clickToolbarButton('edit'); | ||
} | ||
|
||
/** | ||
* @When I have Change the Banner field title to :Gsocbanner | ||
*/ | ||
public function iHaveChangeTheBannerFieldTitleTo($title) | ||
{ | ||
$I = $this; | ||
$I->fillField(BannerPage::$titleField, $title); | ||
$I->fillField(BannerPage::$aliasField, $title); | ||
} | ||
|
||
/** | ||
* @When I select the Banner with Name :Gsocbanner which needs to be published | ||
*/ | ||
public function iSelectTheBannerWithNameWhichNeedsToBePublished($title) | ||
{ | ||
$I = $this; | ||
$I->fillField(BannerPage::$searchField, $title); | ||
$I->Click(BannerPage::$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(BannerPage::$searchField, $title); | ||
$I->Click(BannerPage::$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(BannerPage::$searchField, $title); | ||
$I->Click(BannerPage::$searchButton); | ||
$I->checkAllResults(); | ||
} | ||
|
||
/** | ||
* @When I have Trash the Banner | ||
*/ | ||
public function iTrashTheBanner() | ||
{ | ||
$I = $this; | ||
$I->clickToolbarButton('Trash'); | ||
} | ||
|
||
/** | ||
* @When I select the Banner with Name "Gsocbanner" which needs to be Remove Trash | ||
*/ | ||
public function iSelectTheBannerWithNameWhichNeedsToBeRemoveTrash() | ||
{ | ||
$I = $this; | ||
$I->Click(BannerPage::$searchToolButton); | ||
$I->selectOptionInChosenById('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(BannerPage::$searchField, $title); | ||
$I->Click(BannerPage::$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(BannerPage::$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(BannerPage::$searchField, $title); | ||
$I->Click(BannerPage::$searchButton); | ||
$I->checkAllResults(); | ||
} | ||
|
||
/** | ||
* @When I Check-In the Banner | ||
*/ | ||
public function iCheckInTheBanner() | ||
{ | ||
$I = $this; | ||
$I->clickToolbarButton('Check-in'); | ||
} | ||
|
||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
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 with username "admin" and password "admin" | ||
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 "Gsocbanner" | ||
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 "Gsocbanner" | ||
And I have Change the Banner field title to "Gsocbanner1" | ||
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 "Gsocbanner" 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 "Gsocbanner" 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 "Gsocbanner" which needs to be Check-In | ||
And I Check-In the Banner | ||
Then I should see the "1 banner successfully checked in." message | ||
|
||
Scenario: archived a Banner | ||
Given There is a Banner listing page | ||
When I select the Banner with Name "Gsocbanner" which needs to be archived | ||
And I archived the Banner | ||
Then I should see the "1 banner successfully archived." message | ||
|
||
Scenario: Unarchive a Banner | ||
Given There is a Banner listing page | ||
When I select the Banner with Name "Gsocbanner" which needs to be Unarchive | ||
And I Unarchive the Banner | ||
Then I should see the "1 banner successfully published." message | ||
|
||
Scenario: Trash a Banner | ||
Given There is a Banner listing page | ||
When I select the Banner with Name "Gsocbanner" 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 "Gsocbanner" which needs to be Remove Trash | ||
And I Remove Trash the Banner | ||
Then I should see the "1 banner successfully deleted." message | ||
|
||
|
||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please remove extra space as there should be only one empty line at end of the file. |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add one empty line at the end of the file.