Skip to content

Commit

Permalink
Merge pull request joomla#39 from pritalpatel/fix_issue_#37
Browse files Browse the repository at this point in the history
Fix issue joomla#37
  • Loading branch information
javigomez authored Jun 30, 2016
2 parents c426857 + 9dd70e7 commit f7a1c2d
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 140 deletions.
20 changes: 5 additions & 15 deletions tests/_support/Step/Acceptance/Administrator/Content.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@ public function iSaveAnArticle()
}

/**
* @Then I wait for the title :title and see the message :message
* @Then I should see the :arg1 message
*/
public function iShouldSeeTheMessage($title, $message)
public function iShouldSeeTheMessage($message)
{
$I = $this;
$I->waitForPageTitle($title);
$I->waitForText($message, 60, AdminPage::$systemMessageContainer);
$I->see($message, AdminPage::$systemMessageContainer);
}

Expand All @@ -67,16 +67,6 @@ public function iFeatureTheContentWithTitle()
$I->clickToolbarButton('featured');
}

/**
* @Then I save and see the :arg1 message
*/
/*public function iSaveAndSeeTheMessage($message)
{
$I = $this;
$I->waitForPageTitle($message, AdminPage::$systemMessageContainer);
$I->see($message, AdminPage::$systemMessageContainer);
}*/

/**
* @Given I select the content article with title :arg1
*/
Expand Down Expand Up @@ -109,7 +99,7 @@ public function iSaveTheArticle()
}

/**
* @Given I have article with name :arg1
* @Given I have article with name :title
*/
public function iHaveArticleWithName($title)
{
Expand Down Expand Up @@ -169,4 +159,4 @@ public function iSeeArticleTrashMessage($title, $message)
$I->waitForPageTitle($title);
$I->see($message, AdminPage::$systemMessageContainer);
}
}
}
106 changes: 5 additions & 101 deletions tests/_support/Step/Acceptance/Administrator/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public function iCreateNewUser($name, $username, $password, $email)
}

/**
* @When I Save the user
* @When I Save the user
*/
public function iSaveTheUser()
{
Expand All @@ -42,12 +42,12 @@ public function iSaveTheUser()
}

/**
* @Then I should wait for the title :title and see the message :message
* @Then I should see the :arg1 message
*/
public function iSeeTheMessage($title, $message)
public function iSeeTheMessage($message)
{
$I = $this;
$I->waitForPageTitle($title);
$I->waitForText($message, 60, AdminPage::$systemMessageContainer);
$I->see($message, AdminPage::$systemMessageContainer);
}

Expand Down Expand Up @@ -77,17 +77,6 @@ public function iAssignedNameAndUserGroup($name, $userGroup)
$I->checkOption('#1group_4');
}

/**
* @Then I should wait for :arg1 title and see the :arg2 message
*/
public function iShouldDisplayTheMessage($title, $message)
{
$I = $this;
$I->clickToolbarButton('Save & Close');
$I->waitForPageTitle($title);
$I->see($message, AdminPage::$systemMessageContainer);
}

/**
* @Given I have a user with user name :username
*/
Expand All @@ -109,16 +98,6 @@ public function iBlockTheUser()
$I->clickToolbarButton('unpublish');
}

/**
* @Then I wait for the title :title and see the message :message
*/
public function iShouldSeeTheUserBlockMessage($title, $message)
{
$I = $this;
$I->waitForPageTitle($title);
$I->see($message, AdminPage::$systemMessageContainer);
}

/**
* @Given I have a blocked user with user name :username
*/
Expand All @@ -137,20 +116,9 @@ public function iHaveABlockedUserWithUserName($username)
public function iUnblockTheUser()
{
$I = $this;
$I->waitForPageTitle('Users');
$I->clickToolbarButton('unblock');
}

/**
* @Then I should see the user unblock message :message
*/
/*public function iShouldSeeTheUserUnblockMessage($message)
{
$I = $this;
$I->waitForPageTitle($message, AdminPage::$systemMessageContainer);
$I->see($message, AdminPage::$systemMessageContainer);
}*/

/**
* @When I Delete the user :username
*/
Expand All @@ -165,17 +133,6 @@ public function iDeleteTheUser($username)
$I->acceptPopup();
}

/**
* @Then I confirm the user should have been deleted by getting the title :title and see the message :message
*/
public function iConfirmTheUserDeleteSucessfully($title, $message)
{
$I = $this;
$I->checkForPhpNoticesOrWarnings();
$I->waitForPageTitle($title);
$I->see($message, AdminPage::$systemMessageContainer);
}

/**
* @Given There is an user link
*/
Expand Down Expand Up @@ -226,7 +183,7 @@ public function iSetAssignedUserGroupAsAnAdministrator()
$I->click('Assigned User Groups');
$I->checkOption('#1group_7');
}

/**
* @Then Login in backend with username :username and password :password
*/
Expand Down Expand Up @@ -298,16 +255,6 @@ public function iSaveTheGroup()
$I->clickToolbarButton('Save & Close');
}

/**
* @Then I should wait for :title title and see the message :message
*/
public function iShouldSeeTheMessage($title, $message)
{
$I = $this;
$I->waitForPageTitle($title);
$I->see($message, AdminPage::$systemMessageContainer);
}

/**
* @Given I search and select the Group with name :grouptitle
*/
Expand All @@ -330,7 +277,6 @@ public function iSetGroupTitleAsA($GroupTitle)
$I->fillField(UserManagerPage::$title, $GroupTitle);
}


/**
* @When I Delete the Group :arg1
*/
Expand All @@ -345,17 +291,6 @@ public function iDeleteTheGroup($GroupTitle)
$I->acceptPopup();
}

/**
* @Then I confirm the group should have been deleted by getting the title :title and see the message :message
*/
public function iDeleteUserGroup($title, $message)
{
$I = $this;
$I->checkForPhpNoticesOrWarnings();
$I->waitForPageTitle($title);
$I->see($message, AdminPage::$systemMessageContainer);
}

/**
* @Given There is a add viewing access level link
*/
Expand Down Expand Up @@ -385,16 +320,6 @@ public function iSaveTheAccessLevel()
$I->clickToolbarButton('Save & Close');
}

/**
* @Then I wait for the title :title see the message :message
*/
public function iShouldBeSeeTheMessage($title, $message)
{
$I = $this;
$I->waitForPageTitle($title);
$I->see($message, AdminPage::$systemMessageContainer);
}

/**
* @Given I search and select the Access Level with name :leveltitle
*/
Expand All @@ -417,15 +342,6 @@ public function iSetAccessLevelTitleAsA($LevelTitle)
$I->fillField(UserManagerPage::$title, $LevelTitle);
}

/**
* @When I save Access Level
*/
public function iSaveAccessLevel()
{
$I = $this;
$I->clickToolbarButton('Save & Close');
}

/**
* @When I Delete the Access level :leveltitle
*/
Expand All @@ -440,16 +356,6 @@ public function iDeleteTheAccessLeVel($LevelTitle)
$I->acceptPopup();
}

/**
* @Then I confirm the Access Level have been deleted by getting the title :title and see the message :message
*/
public function iDeleteAccessLevel($title, $message)
{
$I = $this;
$I->checkForPhpNoticesOrWarnings();
$I->waitForPageTitle($title);
$I->see($message, AdminPage::$systemMessageContainer);
}
/**
* @Given There is a User link
*/
Expand Down Expand Up @@ -496,6 +402,4 @@ public function iShouldBeSeeTheLinkCreateAnAccountInFrontend()
$I = $this;
$I->click(['class' => 'brand visible-desktop visible-tablet']);
}


}
10 changes: 5 additions & 5 deletions tests/acceptance/content.feature
Original file line number Diff line number Diff line change
Expand Up @@ -12,26 +12,26 @@ Feature: content
Given There is a add content link
When I create new content with field title as "My_Article" and content as a "This is my first article"
And I save an article
Then I wait for the title "Articles" and see the message "Article successfully saved."
Then I should see the "Article successfully saved." message

Scenario: Feature an Article
Given I search and select content article with title "My_Article"
When I featured the article
Then I wait for the title "Articles" and see the message "1 article featured."
Then I should see the "1 article featured." message

Scenario: Modify an article
Given I select the content article with title "My_Article"
And I set access level as a "Registered"
When I save the article
Then I wait for the title "Articles" and see the message "Article successfully saved."
Then I should see the "Article successfully saved." message

Scenario: Unpublish an article
Given I have article with name "My_Article"
When I unpublish the article
Then I wait for title "Articles" and see the unpublish message "1 article unpublished."
Then I should see the "1 article unpublished." message

Scenario: Trash an article
Given I have "My_Article" content article which needs to be Trash
When I Trash the article
Then I wait for the title "Articles" and see article trash message "1 article trashed."
Then I should see the "1 article trashed." message

38 changes: 19 additions & 19 deletions tests/acceptance/users.feature
Original file line number Diff line number Diff line change
Expand Up @@ -16,77 +16,77 @@ Feature: users
Scenario: Create a add new user
Given There is a add user link
When I create new user with fields Name "register", Login Name "register", Password "register" and Email "[email protected]"
And I Save the user
Then I should wait for the title "Users" and see the message "User successfully saved."
And I Save the user
Then I should see the "User successfully saved." message

Scenario: Edit user
Given I search and select the user with user name "register"
When I set name as an "Editor" and User Group as "Editor"
And I Save the user
Then I should wait for the title "Users" and see the message "User successfully saved."
And I Save the user
Then I should see the "User successfully saved." message

Scenario: Block a User
Given I have a user with user name "register"
When I block the user
Then I wait for the title "Users" and see the message "User blocked."
Then I should see the "User blocked." message

Scenario: Unblock user
Given I have a blocked user with user name "register"
When I unblock the user
Then I wait for the title "Users" and see the message "User enabled."
# Scenario: Unblock user
# Given I have a blocked user with user name "register"
# When I unblock the user
# Then I should see the "User enabled." message

Scenario: Delete user
Given I have a user with user name "Editor"
When I Delete the user "Editor"
Then I confirm the user should have been deleted by getting the title "Users" and see the message "1 user successfully deleted."
Then I should see the "1 user successfully deleted." message

Scenario: Create super admin and login into the backend
Given There is a add user link
And I fill a super admin with fields Name "prital", Login Name "prital", Password "prital", and Email "[email protected]"
When I set assigned user group as an Administrator
And I Save the user
And I Save the user
Then Login in backend with username "prital" and password "prital"

Scenario: Create User without username fails
Given There is a add user link
When I don't fill Login Name but fulfill remaining mandatory fields: Name "piyu", Password "piyu" and Email "[email protected]"
And I Save the user
And I Save the user
Then I see the title "Users: New"
But I see the alert error "Invalid field: Login Name"

Scenario: Create group
Given There is a add new group link
When I fill Group Title as a "Gsoc"
And I save the Group
Then I should wait for "Users: Groups" title and see the message "Group successfully saved."
Then I should see the "Group successfully saved." message

Scenario: Edit group
Given I search and select the Group with name "Gsoc"
And I set group Title as a "Gsoc_admin"
When I save the Group
Then I should wait for "Users: Groups" title and see the message "Group successfully saved."
Then I should see the "Group successfully saved." message

Scenario: Delete Group
Given I search and select the Group with name "Gsoc_admin"
When I Delete the Group "Gsoc_admin"
Then I confirm the group should have been deleted by getting the title "Users: Groups" and see the message "1 User Group successfully deleted."
Then I should see the "1 User Group successfully deleted." message

Scenario: Create ACL level
Given There is a add viewing access level link
When I fill Level Title as a "joomla" and set Access as a public
And I save the Access Level
Then I wait for the title "Users: Viewing Access Levels" see the message "Access level successfully saved."
Then I should see the "Access level successfully saved." message

Scenario: Edit ACL
Given I search and select the Access Level with name "joomla"
And I set Access Level title as a "Gsoc_joomla"
When I save Access Level
Then I wait for the title "Users: Viewing Access Levels" and see the message "Access level successfully saved."
When I save the Access Level
Then I should see the "Access level successfully saved." message

Scenario: Delete ACL
Given I search and select the Access Level with name "Gsoc_joomla"
When I Delete the Access level "Gsoc_joomla"
Then I confirm the Access Level have been deleted by getting the title "Users: Viewing Access Levels" and see the message "1 View Access Level successfully removed."
Then I should see the "1 View Access Level successfully removed." message

Scenario: User settings (Allow user registration)
Given There is a User link
Expand Down

0 comments on commit f7a1c2d

Please sign in to comment.