Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
@core @core_message @javascript
2
Feature: Create conversations for course's groups
3
  In order to manage a course group in a course
4
  As a user
5
  I need to be able to ensure group conversations reflect the memberships of course groups
6
 
7
  Background:
8
    Given the following "courses" exist:
9
      | fullname | shortname | category | groupmode |
10
      | Course 1 | C1        | 0        | 1         |
11
    And the following "users" exist:
12
      | username | firstname | lastname | email                |
13
      | teacher1 | Teacher   | 1        | teacher1@example.com |
14
      | student0 | Student   | 0        | student0@example.com |
15
      | student1 | Student   | 1        | student1@example.com |
16
      | student2 | Student   | 2        | student2@example.com |
17
      | student3 | Student   | 3        | student3@example.com |
18
      | student4 | Student   | 4        | student4@example.com |
19
    And the following "course enrolments" exist:
20
      | user     | course | role |
21
      | teacher1 | C1     | editingteacher |
22
      | student0 | C1     | student |
23
      | student1 | C1     | student |
24
      | student2 | C1     | student |
25
      | student3 | C1     | student |
26
      | student4 | C1     | student |
27
    And the following "groups" exist:
28
      | name    | course | idnumber | enablemessaging |
29
      | Group 1 | C1     | G1       | 1               |
30
      | Group 2 | C1     | G2       | 1               |
31
      | Group 3 | C1     | G3       | 0               |
32
    And the following "group members" exist:
33
      | user     | group |
34
      | teacher1 | G1 |
35
      | student0 | G1 |
36
      | student1 | G1 |
37
      | student2 | G1 |
38
      | student3 | G1 |
39
      | teacher1 | G2 |
40
      | teacher1 | G3 |
41
      | student0 | G3 |
42
    And the following config values are set as admin:
43
      | messaging        | 1 |
44
      | messagingminpoll | 1 |
45
 
46
  Scenario: Group conversations are restricted to members
47
    Given I log in as "teacher1"
48
    Then I open messaging
49
    And I open the "Group" conversations list
50
    And "Group 1" "core_message > Message" should exist
51
    And "Group 2" "core_message > Message" should exist
52
    And "Group 3" "core_message > Message" should not exist
53
    And I log out
54
    And I log in as "student1"
55
    And I open messaging
56
    And I open the "Group" conversations list
57
    And "Group 1" "core_message > Message" should exist
58
    And "Group 2" "core_message > Message" should not exist
59
    And "Group 3" "core_message > Message" should not exist
60
 
61
  Scenario: View group conversation's participants numbers
62
    Given I log in as "teacher1"
63
    Then I open messaging
64
    And I open the "Group" conversations list
65
    And I select "Group 1" conversation in messaging
66
    And I should see "5 participants" in the "Group 1" "core_message > Message header"
67
    And I go back in "view-conversation" message drawer
68
    And I select "Group 2" conversation in messaging
69
    And I should see "1 participants" in the "Group 2" "core_message > Message header"
70
 
71
  Scenario: View group conversation's participants list
72
    Given I log in as "teacher1"
73
    Then I open messaging
74
    And I open the "Group" conversations list
75
    # Check Group 1 participants list.
76
    And I select "Group 1" conversation in messaging
77
    And I open messaging information
78
    And "Teacher 1" "core_message > Message member" should not exist
79
    And "Student 0" "core_message > Message member" should exist
80
    And "Student 1" "core_message > Message member" should exist
81
    And "Student 2" "core_message > Message member" should exist
82
    And "Student 3" "core_message > Message member" should exist
83
    And "Student 4" "core_message > Message member" should not exist
84
    And I go back in "group-info-content-container" message drawer
85
    And I go back in "view-conversation" message drawer
86
    # Check Group 2 participants list.
87
    And I select "Group 2" conversation in messaging
88
    And I open messaging information
89
    And "Teacher 1" "core_message > Message member" should not exist
90
    And "No participants" "core_message > Message member" should exist
91
    And "Student 4" "core_message > Message member" should not exist
92
 
93
  Scenario: Check group conversation members are synced when a new group member is added
94
    Given I log in as "teacher1"
95
    Then I am on the "Course 1" "groups" page
96
    And I add "Student 4 (student4@example.com)" user to "Group 1" group members
97
    And I add "Student 4 (student4@example.com)" user to "Group 2" group members
98
    And I open messaging
99
    And I open the "Group" conversations list
100
    And I select "Group 1" conversation in messaging
101
    And I should see "6 participants" in the "Group 1" "core_message > Message header"
102
    And I open messaging information
103
    And "Student 4" "core_message > Message member" should exist
104
    And I go back in "group-info-content-container" message drawer
105
    And I go back in "view-conversation" message drawer
106
    And I select "Group 2" conversation in messaging
107
    And I should see "2 participants" in the "Group 2" "core_message > Message header"
108
    And I open messaging information
109
    And "No participants" "core_message > Message member" should not exist
110
    And "Student 4" "core_message > Message member" should exist
111
 
112
  Scenario: Disable messaging for private groups
113
    Given the following "groups" exist:
114
      | name               | course | idnumber | visibility | enablemessaging |
115
      | Messaging group    | C1     | MG       | 0          | 1               |
116
      | No messaging group | C1     | NM       | 2          | 1               |
117
    And the following "group members" exist:
118
      | user     | group |
119
      | student1 | MG    |
120
      | student1 | NM    |
121
    When I log in as "student1"
122
    And I open messaging
123
    And I open the "Group" conversations list
124
    Then "Messaging group" "core_message > Message" should exist
125
    Then "No messaging group" "core_message > Message" should not exist