Commit d32b9ced authored by Robert Lyon's avatar Robert Lyon Committed by Gerrit Code Review
Browse files

Merge "Bug 1687346: Behat tests for Merging of group messages and notifications feature files"

parents e1e88194 b2c3c797
@javascript @core @core_artefact @core_group @javascript @core @core_artefact @core_group
Feature: Commenting on a group page Feature: Commenting on a group page
In order to be able to verify I commented publically on a group page In order to be able to verify I commented publically on a group page
As a user As a user
So leave a comment and it appears in the right place So leave a comment and it appears in the right place
Background: Background:
Given the following "users" exist: Given the following "users" exist:
...@@ -14,37 +14,62 @@ Given the following "groups" exist: ...@@ -14,37 +14,62 @@ Given the following "groups" exist:
| name | owner | description | grouptype | open | invitefriends | editroles | submittableto | allowarchives | members | staff | | name | owner | description | grouptype | open | invitefriends | editroles | submittableto | allowarchives | members | staff |
| group 01 | userA | This is group 01 | standard | ON | ON | all | OFF | OFF | userB | | | group 01 | userA | This is group 01 | standard | ON | ON | all | OFF | OFF | userB | |
Given the following "pages" exist:
| title | description| ownertype | ownername |
| Testing group page 01 | This is the page 01 of the group 01 | group | group 01 |
Scenario: As a user leaving a public comment on a group page (Bug 1509129) Scenario: As a user leaving a public comment on a group page (Bug 1509129)
Given I log in as "userA" with password "Kupuhipa1" Given I log in as "userA" with password "Kupuhipa1"
And I choose "Groups" from main menu And I choose "Groups" from main menu
# Changing the settings of the block to change comment notification # Changing the settings of the block to change comment notification
And I click on "Settings" in the "div.groupuserstatus" "css_element" And I click on "Settings" in the "div.groupuserstatus" "css_element"
And I set the following fields to these values: And I set the following fields to these values:
| Comment notifications | None | | Comment notifications | None |
And I press "Save group" And I press "Save group"
When I click on "Pages" in the ".right-text" "css_element" When I click on "Pages" in the ".right-text" "css_element"
And I follow "Add" And I follow "Add"
And I click on "Page" in the dialog And I click on "Page" in the dialog
And I set the following fields to these values: And I set the following fields to these values:
| Page title | Group Page 01 | | Page title | Group Page 01 |
And I press "Save" And I press "Save"
And I follow "Display page" And I follow "Display page"
And I fill in "Adding a comment to this field. Student = Awesome!" in editor "Comment" And I fill in "Adding a comment to this field. Student = Awesome!" in editor "Comment"
# Checking that the make public is on # Checking that the make public is on
And I enable the switch "Make comment public" And I enable the switch "Make comment public"
And I press "Comment" And I press "Comment"
# Verifying that it saves # Verifying that it saves
Then I should see "Comment submitted" Then I should see "Comment submitted"
And I should see "Adding a comment to this field. Student = Awesome!" And I should see "Adding a comment to this field. Student = Awesome!"
And I log out And I log out
And I log in as "userB" with password "Kupuhipa1" And I log in as "userB" with password "Kupuhipa1"
# Needs to navigate to see the comment and check it can be seen publically # Needs to navigate to see the comment and check it can be seen publically
Then I should see "group 01" Then I should see "group 01"
When I follow "group 01" When I follow "group 01"
Then I should see "About | group 01" Then I should see "About | group 01"
When I follow "Pages and collections (tab)" When I follow "Pages and collections (tab)"
Then I should see "Group Page 01" in the "h3.panel-heading" "css_element" Then I should see "Group Page 01" in the "h3.panel-heading" "css_element"
And I click the panel "Group Page 01" And I click the panel "Group Page 01"
Then I should see "Adding a comment to this field. Student = Awesome!" in the "div.comment-text" "css_element" Then I should see "Adding a comment to this field. Student = Awesome!" in the "div.comment-text" "css_element"
# As part of consolidating behat tests, this scenario has been added.
# Original feature title: Sending notification message when someone leaves a comment in a group page
Scenario: Adding a comment on a group page (Bug 1426983) and verifying the notification message.
Given I log in as "userA" with password "Kupuhipa1"
And I choose "Groups" from main menu
And I follow "group 01"
And I follow "Pages and collections (tab)"
# And I click on "Pages"
And I follow "Testing group page 01"
And I fill in "Testing comment notifications" in editor "Comment"
And I press "Comment"
# Log out as user 1
And I log out
# Log in as admin
When I log in as "userB" with password "Kupuhipa1"
# Checking notification display on the dashboard
And I wait "1" seconds
Then I should see "New comment on Testing group page 01"
# Checking notifications also appear in my inbox
And I choose "mail" from user menu by id
And I follow "New comment on Testing group page 01"
And I should see "Testing comment notifications"
@javascript @core @core_group
Feature: Sending notification message when someone leaves a comment in a group page
In order to notify a user of a comment on a group page
As a user I add a comment
So another person can log in and see a notification message
Background:
Given the following "users" exist:
| username | password | email | firstname | lastname | institution | authname |role |
| bob | Kupuhipa1 | bob@example.com | Bob | Bobby | mahara | internal | member |
| jen | mahara1 | jen@example.com | Jen | Jenny | mahara | internal | member |
Given the following "groups" exist:
| name | owner | description | grouptype | open | invitefriends | editroles | submittableto | allowarchives | members | staff |
| Test group 1 | admin | This is group 01 | standard | ON | ON | all | ON | ON | bob , jen | jen |
Given the following "pages" exist:
| title | description| ownertype | ownername |
| Testing group page 01 | This is the page 01 of the group 01 | group | Test group 1 |
Scenario: Adding a comment on a group page (Bug 1426983)
Given I log in as "bob" with password "Kupuhipa1"
And I choose "Groups" from main menu
And I follow "Test group 1"
And I follow "Pages and collections (tab)"
# And I click on "Pages"
And I follow "Testing group page 01"
And I fill in "Testing comment notifications" in editor "Comment"
And I press "Comment"
# Log out as user 1
And I log out
# Log in as "Admin" user
When I log in as "admin" with password "Kupuhipa1"
# Checking notification display on the dashboard
Then I should see "New comment on Testing group page 01"
# Checking notifications also appear in my inbox
And I choose "mail" from user menu by id
And I follow "New comment on Testing group page 01"
And I should see "Testing comment notifications"
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment