MDL-55981 behat: Fixed groups seen by user

This commit is contained in:
Rajesh Taneja
2016-10-25 13:19:32 +08:00
parent 6858c7acec
commit cdb4975a44
2 changed files with 16 additions and 7 deletions
@@ -8,12 +8,14 @@ Feature: Posting to groups in a separate group discussion when restricted to gro
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | teacher1 | teacher1 | teacher1@example.com |
| teacher2 | teacher2 | teacher2 | teacher2@example.com |
And the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | teacher |
| teacher1 | C1 | editingteacher |
| teacher2 | C1 | teacher |
And the following "groups" exist:
| name | course | idnumber |
| G1G1 | C1 | G1G1 |
@@ -28,6 +30,9 @@ Feature: Posting to groups in a separate group discussion when restricted to gro
| teacher1 | G1G1 |
| teacher1 | G1G2 |
| teacher1 | G2G1 |
| teacher2 | G1G1 |
| teacher2 | G1G2 |
| teacher2 | G2G1 |
And the following "grouping groups" exist:
| grouping | group |
| G1 | G1G1 |
@@ -67,11 +72,7 @@ Feature: Posting to groups in a separate group discussion when restricted to gro
And I should not see "Post a copy to all groups"
Scenario: Teacher in all groups but without accessallgroups can post in either group but not to All Participants
And I log in as "admin"
And I set the following system permissions of "Non-editing teacher" role:
| moodle/site:accessallgroups | Prohibit |
And I log out
Given I log in as "teacher1"
Given I log in as "teacher2"
And I follow "Course 1"
And I follow "Multiple groups forum"
When I click on "Add a new discussion topic" "button"
@@ -62,7 +62,7 @@ Feature: In a lesson activity, a non editing teacher can grade essay questions
And I set the field "Your answer" to "<p>Once upon a time there were two little green frogs."
And I press "Submit"
And I log out
When I log in as "teacher2"
When I log in as "teacher1"
And I follow "Course 1"
And I follow "Test lesson name"
Then I should see "Grade essays"
@@ -86,3 +86,11 @@ Feature: In a lesson activity, a non editing teacher can grade essay questions
And I should not see "Student 1"
And I select "Group C" from the "Separate groups" singleselect
And I should see "No one in Group C has answered an essay question yet."
And I log out
And I log in as "teacher2"
And I follow "Course 1"
And I follow "Test lesson name"
Then I should see "Grade essays"
And I follow "Grade essays"
And I should not see "Student 1"
And I should see "Student 2"