User tests: Successful: Unsuccessful:
Milestone |
Added: 3.4.2 |
Thanks, I will refactor this by making use of Step Object. Need some time
The build will fail since this PR depends on joomla-projects/joomla-browser#71
I have updated the function name! thanks for the feedback!
Worked:
vendor/bin/codecept run --steps --debug tests/acceptance/administrator/AdministratorCategoriesCest.php
Codeception PHP Testing Framework v2.1.3
Powered by PHPUnit 4.8.16 by Sebastian Bergmann and contributors.
Acceptance Tests (4) -----------------------------------------------------------
Modules: JoomlaBrowser, AcceptanceHelper
--------------------------------------------------------------------------------
Test Category (AdministratorCategoriesCest::administratorCreateCategory)
Scenario:
* As an Administrator
* I do administrator login
I open Joomla Administrator Login Page
[GET] http://joomla.box/repos/weblinks/tests/joomla-cms3/administrator/index.php
Fill Username Text Field
Fill Password Text Field
I click Login button
I wait to see Administrator Control Panel
* I am going to Navigate to Categories page in /administrator/ and create a Category
* As an Administrator
* I am on page "administrator/index.php?option=com_categories&extension=com_weblinks"
[GET] http://joomla.box/repos/weblinks/tests/joomla-cms3/administrator/index.php?option=com_categories&extension=com_weblinks
* I wait for text "Weblinks: Categories","30",{"css":"h1"}
* I expect to see categories page
* I check for php notices or warnings
* I am going to try to save a category with a filled title
* I click toolbar button "New"
* I wait for text "Weblinks: New Category","30",{"css":"h1"}
* I fill field {"id":"jform_title"},"automated testing19"
* I click toolbar button "Save & Close"
* I expect to see a success message after saving the category
* I see "Category successfully saved",{"id":"system-message-container"}
* I am going to Delete the Category which was created
* I am on page "administrator/index.php?option=com_categories&extension=com_weblinks"
[GET] http://joomla.box/repos/weblinks/tests/joomla-cms3/administrator/index.php?option=com_categories&extension=com_weblinks
* I wait for text "Weblinks: Categories","30",{"css":"h1"}
* I search for item "automated testing19"
Searching for automated testing19
* I am going to Select the weblink result
* I check all results
Selecting Checkall button
* I click toolbar button "Trash"
* I see "category successfully trashed.",{"id":"system-message-container"}
PASSED
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Test Category creation in /administrator/ without ti (AdministratorCategoriesCest::administratorCreateCategoryWithoutTitleFails)
Scenario:
* As an Administrator
* I do administrator login
I open Joomla Administrator Login Page
[GET] http://joomla.box/repos/weblinks/tests/joomla-cms3/administrator/index.php
Fill Username Text Field
Fill Password Text Field
I click Login button
I wait to see Administrator Control Panel
* I am going to Navigate to Categories page in /administrator/
* I am on page "administrator/index.php?option=com_categories&extension=com_weblinks"
[GET] http://joomla.box/repos/weblinks/tests/joomla-cms3/administrator/index.php?option=com_categories&extension=com_weblinks
* I wait for text "Weblinks: Categories","30",{"css":"h1"}
* I expect to see categories page
* I am going to try to save a category with empty title and it should fail
* I click {"xpath":"//button[@onclick="Joomla.submitbutton('category.add')"]"}
* I wait for text "Weblinks: New Category","30",{"css":"h1"}
* I click {"xpath":"//button[@onclick="Joomla.submitbutton('category.apply')"]"}
* I expect to see an error when trying to save a category without title
* I see "Invalid field: Title",{"id":"system-message-container"}
PASSED
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Test Category (AdministratorCategoriesCest::administratorPublishCategory)
Scenario:
* As an Administrator
* I do administrator login
I open Joomla Administrator Login Page
[GET] http://joomla.box/repos/weblinks/tests/joomla-cms3/administrator/index.php
Fill Username Text Field
Fill Password Text Field
I click Login button
I wait to see Administrator Control Panel
* I am going to Navigate to Categories page in /administrator/ and create a new Category
* As an Administrator
* I am on page "administrator/index.php?option=com_categories&extension=com_weblinks"
[GET] http://joomla.box/repos/weblinks/tests/joomla-cms3/administrator/index.php?option=com_categories&extension=com_weblinks
* I wait for text "Weblinks: Categories","30",{"css":"h1"}
* I expect to see categories page
* I check for php notices or warnings
* I am going to try to save a category with a filled title
* I click toolbar button "New"
* I wait for text "Weblinks: New Category","30",{"css":"h1"}
* I fill field {"id":"jform_title"},"automated testing pub88"
* I click toolbar button "Save & Close"
* I expect to see a success message after saving the category
* I see "Category successfully saved",{"id":"system-message-container"}
* I search for item "automated testing pub88"
Searching for automated testing pub88
* I wait for text "Weblinks: Categories","30",{"css":"h1"}
* I check all results
Selecting Checkall button
* I am going to try to publish a weblink category
* I click toolbar button "publish"
* I wait for text "Weblinks: Categories","30",{"css":"h1"}
* I expect to see a success message after publishing the category
* I see "1 category successfully published.",{"id":"system-message-container"}
* I am going to Delete the Category which was created
* I am on page "administrator/index.php?option=com_categories&extension=com_weblinks"
[GET] http://joomla.box/repos/weblinks/tests/joomla-cms3/administrator/index.php?option=com_categories&extension=com_weblinks
* I wait for text "Weblinks: Categories","30",{"css":"h1"}
* I search for item "automated testing pub88"
Searching for automated testing pub88
* I am going to Select the weblink result
* I check all results
Selecting Checkall button
* I click toolbar button "Trash"
* I see "category successfully trashed.",{"id":"system-message-container"}
PASSED
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Test Catego (AdministratorCategoriesCest::administratorUnpublishCategory)
Scenario:
* As an Administrator
* I do administrator login
I open Joomla Administrator Login Page
[GET] http://joomla.box/repos/weblinks/tests/joomla-cms3/administrator/index.php
Fill Username Text Field
Fill Password Text Field
I click Login button
I wait to see Administrator Control Panel
* I am going to Navigate to Categories page in /administrator/
* As an Administrator
* I am on page "administrator/index.php?option=com_categories&extension=com_weblinks"
[GET] http://joomla.box/repos/weblinks/tests/joomla-cms3/administrator/index.php?option=com_categories&extension=com_weblinks
* I wait for text "Weblinks: Categories","30",{"css":"h1"}
* I expect to see categories page
* I check for php notices or warnings
* I am going to try to save a category with a filled title
* I click toolbar button "New"
* I wait for text "Weblinks: New Category","30",{"css":"h1"}
* I fill field {"id":"jform_title"},"automated testing unpub16"
* I click toolbar button "Save & Close"
* I expect to see a success message after saving the category
* I see "Category successfully saved",{"id":"system-message-container"}
* I search for item "automated testing unpub16"
Searching for automated testing unpub16
* I wait for text "Weblinks: Categories","30",{"css":"h1"}
* I check all results
Selecting Checkall button
* I am going to try to publish a weblink category
* I click toolbar button "publish"
* I wait for text "Weblinks: Categories","30",{"css":"h1"}
* I expect to see a success message after publishing the category
* I see "1 category successfully published.",{"id":"system-message-container"}
* I wait for text "Weblinks: Categories","30",{"css":"h1"}
* I check all results
Selecting Checkall button
* I am going to Try to unpublish a weblink category
* I click toolbar button "unpublish"
* I wait for text "Weblinks: Categories","30",{"css":"h1"}
* I expect to See a success message after unpublishing the category
* I see "1 category successfully unpublished",{"id":"system-message-container"}
* I am going to Delete the Category which was created
* I am on page "administrator/index.php?option=com_categories&extension=com_weblinks"
[GET] http://joomla.box/repos/weblinks/tests/joomla-cms3/administrator/index.php?option=com_categories&extension=com_weblinks
* I wait for text "Weblinks: Categories","30",{"css":"h1"}
* I search for item "automated testing unpub16"
Searching for automated testing unpub16
* I am going to Select the weblink result
* I check all results
Selecting Checkall button
* I click toolbar button "Trash"
* I see "category successfully trashed.",{"id":"system-message-container"}
PASSED
Thank you @puneet0191! Merged with d42948b
Thanks @Kubik-Rubik
@Test works fine.