From abe7460d06ced9726d7e1e3e44be022468432008 Mon Sep 17 00:00:00 2001 From: puneet0191 Date: Sat, 10 Dec 2016 20:20:38 +0530 Subject: [PATCH 01/10] Updating Robo File --- .../Administrator/BannerManagerPage.php | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 tests/codeception/_support/Page/Acceptance/Administrator/BannerManagerPage.php diff --git a/tests/codeception/_support/Page/Acceptance/Administrator/BannerManagerPage.php b/tests/codeception/_support/Page/Acceptance/Administrator/BannerManagerPage.php new file mode 100644 index 0000000000..1cbf3c6597 --- /dev/null +++ b/tests/codeception/_support/Page/Acceptance/Administrator/BannerManagerPage.php @@ -0,0 +1,31 @@ + '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."]']; +} \ No newline at end of file From ec550e5faf7a9e0917a75f92918db9679a267e00 Mon Sep 17 00:00:00 2001 From: puneet0191 Date: Sat, 10 Dec 2016 20:21:08 +0530 Subject: [PATCH 02/10] Updating Robo --- RoboFile.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/RoboFile.php b/RoboFile.php index c34cca356c..808ec7d70e 100644 --- a/RoboFile.php +++ b/RoboFile.php @@ -359,6 +359,15 @@ public function runTests($opts = ['use-htaccess' => false, 'env' => 'desktop']) ->run() ->stopOnFail(); + $this->taskCodecept($pathToCodeception) + ->arg('--steps') + ->arg('--debug') + ->arg('--fail-fast') + ->arg('--env ' . $opts['env']) + ->arg($this->testsPath . 'acceptance/banner.feature') + ->run() + ->stopOnFail(); + $this->taskCodecept($pathToCodeception) ->arg('--steps') ->arg('--debug') From f46d04151197af7b4b7e822d5c710214bf67defd Mon Sep 17 00:00:00 2001 From: puneet0191 Date: Sat, 10 Dec 2016 20:21:17 +0530 Subject: [PATCH 03/10] Adidng Banner Step --- .../Step/Acceptance/Administrator/Banner.php | 213 ++++++++++++++++++ 1 file changed, 213 insertions(+) create mode 100644 tests/codeception/_support/Step/Acceptance/Administrator/Banner.php diff --git a/tests/codeception/_support/Step/Acceptance/Administrator/Banner.php b/tests/codeception/_support/Step/Acceptance/Administrator/Banner.php new file mode 100644 index 0000000000..c9728d6df5 --- /dev/null +++ b/tests/codeception/_support/Step/Acceptance/Administrator/Banner.php @@ -0,0 +1,213 @@ +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'); + } +} \ No newline at end of file From f49b559e6568a72e408b10f131b1cd0e8a49150f Mon Sep 17 00:00:00 2001 From: puneet0191 Date: Sat, 10 Dec 2016 20:21:42 +0530 Subject: [PATCH 04/10] Adding Feature --- tests/codeception/acceptance/banner.feature | 50 +++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 tests/codeception/acceptance/banner.feature diff --git a/tests/codeception/acceptance/banner.feature b/tests/codeception/acceptance/banner.feature new file mode 100644 index 0000000000..daaac98ed2 --- /dev/null +++ b/tests/codeception/acceptance/banner.feature @@ -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 From c8cdbc14aca85ef45c45a821d334b8ca89cd1760 Mon Sep 17 00:00:00 2001 From: puneet0191 Date: Sat, 10 Dec 2016 20:23:19 +0530 Subject: [PATCH 05/10] Adding both the Tests --- tests/codeception/acceptance.suite.dist.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/codeception/acceptance.suite.dist.yml b/tests/codeception/acceptance.suite.dist.yml index d10c68488e..4eb5bc9f2f 100644 --- a/tests/codeception/acceptance.suite.dist.yml +++ b/tests/codeception/acceptance.suite.dist.yml @@ -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 From 2540389a4295b1f1947181d0496247bf134c0f9b Mon Sep 17 00:00:00 2001 From: puneet0191 Date: Sat, 10 Dec 2016 20:43:23 +0530 Subject: [PATCH 06/10] Removing Accept Popup, not sure why this stuff is needed --- .../Page/Acceptance/Administrator/ExtensionManagerPage.php | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/codeception/_support/Page/Acceptance/Administrator/ExtensionManagerPage.php b/tests/codeception/_support/Page/Acceptance/Administrator/ExtensionManagerPage.php index 910a98cb64..c9eb864f4b 100644 --- a/tests/codeception/_support/Page/Acceptance/Administrator/ExtensionManagerPage.php +++ b/tests/codeception/_support/Page/Acceptance/Administrator/ExtensionManagerPage.php @@ -102,7 +102,6 @@ public function uninstallExtension($extensionName) $I->waitForElement(['id' => 'manageList'], '30'); $I->click(['xpath' => "//input[@id='cb0']"]); $I->click(['xpath' => "//div[@id='toolbar-delete']/button"]); - $I->acceptPopup(); $I->seeSystemMessage(self::$managePageTitle, 'was successful'); $I->searchForItem($extensionName); $I->waitForText( From 14fae5c9a5f44f0e6649ab54e076f6e1f9ce8b53 Mon Sep 17 00:00:00 2001 From: puneet0191 Date: Sat, 10 Dec 2016 21:34:33 +0530 Subject: [PATCH 07/10] back to pavilion --- .../Page/Acceptance/Administrator/ExtensionManagerPage.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/codeception/_support/Page/Acceptance/Administrator/ExtensionManagerPage.php b/tests/codeception/_support/Page/Acceptance/Administrator/ExtensionManagerPage.php index c9eb864f4b..dad52eb6e6 100644 --- a/tests/codeception/_support/Page/Acceptance/Administrator/ExtensionManagerPage.php +++ b/tests/codeception/_support/Page/Acceptance/Administrator/ExtensionManagerPage.php @@ -102,6 +102,8 @@ public function uninstallExtension($extensionName) $I->waitForElement(['id' => 'manageList'], '30'); $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( From 3deaaf3f9c0809246831c4c7556235f9a21c85ad Mon Sep 17 00:00:00 2001 From: puneet0191 Date: Sat, 10 Dec 2016 22:39:34 +0530 Subject: [PATCH 08/10] Updating branch --- RoboFile.php | 9 +++++++++ tests/codeception/acceptance/extensions.feature | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/RoboFile.php b/RoboFile.php index 808ec7d70e..fb34ac1045 100644 --- a/RoboFile.php +++ b/RoboFile.php @@ -368,6 +368,15 @@ public function runTests($opts = ['use-htaccess' => false, 'env' => 'desktop']) ->run() ->stopOnFail(); + $this->taskCodecept($pathToCodeception) + ->arg('--steps') + ->arg('--debug') + ->arg('--fail-fast') + ->arg('--env ' . $opts['env']) + ->arg($this->testsPath . 'acceptance/extensions.feature') + ->run() + ->stopOnFail(); + $this->taskCodecept($pathToCodeception) ->arg('--steps') ->arg('--debug') diff --git a/tests/codeception/acceptance/extensions.feature b/tests/codeception/acceptance/extensions.feature index ae3e733467..1b56325e6e 100644 --- a/tests/codeception/acceptance/extensions.feature +++ b/tests/codeception/acceptance/extensions.feature @@ -4,7 +4,7 @@ Feature: extensions I need to install update uninstall extension in the extension manager Background: - When I Login into Joomla administrator with username "puneet" and password "1234" + When I Login into Joomla administrator And I see the administrator dashboard Scenario: Test extension installation From c640b7eb74af5cc870de46f1053264434e788251 Mon Sep 17 00:00:00 2001 From: puneet0191 Date: Sat, 10 Dec 2016 22:40:55 +0530 Subject: [PATCH 09/10] I have to remove it now --- RoboFile.php | 9 --------- 1 file changed, 9 deletions(-) diff --git a/RoboFile.php b/RoboFile.php index 68ee83b70a..fb34ac1045 100644 --- a/RoboFile.php +++ b/RoboFile.php @@ -350,15 +350,6 @@ public function runTests($opts = ['use-htaccess' => false, 'env' => 'desktop']) ->run() ->stopOnFail(); - $this->taskCodecept($pathToCodeception) - ->arg('--steps') - ->arg('--debug') - ->arg('--fail-fast') - ->arg('--env ' . $opts['env']) - ->arg($this->testsPath . 'acceptance/extensions.feature') - ->run() - ->stopOnFail(); - $this->taskCodecept($pathToCodeception) ->arg('--steps') ->arg('--debug') From 54404d63b51b97fa5274adc60bbf3e285f599cef Mon Sep 17 00:00:00 2001 From: puneet0191 Date: Sat, 10 Dec 2016 22:56:49 +0530 Subject: [PATCH 10/10] Removing uninstall Extension --- tests/codeception/acceptance/extensions.feature | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/tests/codeception/acceptance/extensions.feature b/tests/codeception/acceptance/extensions.feature index 1b56325e6e..76b353314f 100644 --- a/tests/codeception/acceptance/extensions.feature +++ b/tests/codeception/acceptance/extensions.feature @@ -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 \ No newline at end of file + Then I should see the extension "weblinks" is updated \ No newline at end of file