1 |
efrain |
1 |
@core @core_message @javascript
|
|
|
2 |
Feature: Unread messages
|
|
|
3 |
In order to know how many unread messages I have
|
|
|
4 |
As a user
|
|
|
5 |
I need to be able to view an unread message
|
|
|
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 |
| student1 | Student | 1 | student1@example.com |
|
|
|
14 |
| student2 | Student | 2 | student2@example.com |
|
|
|
15 |
And the following "course enrolments" exist:
|
|
|
16 |
| user | course | role |
|
|
|
17 |
| student1 | C1 | student |
|
|
|
18 |
| student2 | C1 | student |
|
|
|
19 |
And the following "groups" exist:
|
|
|
20 |
| name | course | idnumber | enablemessaging |
|
|
|
21 |
| New group | C1 | NG | 1 |
|
|
|
22 |
And the following "group members" exist:
|
|
|
23 |
| user | group |
|
|
|
24 |
| student1 | NG |
|
|
|
25 |
| student2 | NG |
|
|
|
26 |
And the following config values are set as admin:
|
|
|
27 |
| messaging | 1 |
|
|
|
28 |
| messagingminpoll | 1 |
|
|
|
29 |
|
|
|
30 |
Scenario: Unread messages for group conversation
|
|
|
31 |
Given I log in as "student1"
|
|
|
32 |
When I open messaging
|
|
|
33 |
And I open the "Group" conversations list
|
|
|
34 |
Then "New group" "core_message > Message" should exist
|
|
|
35 |
And I select "New group" conversation in messaging
|
|
|
36 |
And I send "Hi!" message in the message area
|
|
|
37 |
And I should see "Hi!" in the "New group" "core_message > Message conversation"
|
|
|
38 |
And I should see "##today##%d %B##" in the "New group" "core_message > Message conversation"
|
|
|
39 |
And I log out
|
|
|
40 |
And I log in as "student2"
|
|
|
41 |
And I should see "1" in the "//*[@title='Toggle messaging drawer']/../*[@data-region='count-container']" "xpath_element"
|
|
|
42 |
And I open messaging
|
|
|
43 |
And I should see "1" in the "Group" "core_message > Message tab"
|
|
|
44 |
And "New group" "core_message > Message" should exist
|
|
|
45 |
And I should see "1" in the "New group" "core_message > Message"
|
|
|
46 |
And I select "New group" conversation in messaging
|
|
|
47 |
And I should see "Hi!" in the "New group" "core_message > Message conversation"
|
|
|
48 |
And I should not see "1" in the "//*[@title='Toggle messaging drawer']/../*[@data-region='count-container']" "xpath_element"
|
|
|
49 |
And I should not see "1" in the "Group" "core_message > Message tab"
|
|
|
50 |
And I should not see "1" in the "New group" "core_message > Message"
|
|
|
51 |
|
|
|
52 |
Scenario: Unread messages for private conversation
|
|
|
53 |
Given the following "private messages" exist:
|
|
|
54 |
| user | contact | message |
|
|
|
55 |
| student1 | student2 | Hi! |
|
|
|
56 |
| student2 | student1 | What do you need? |
|
|
|
57 |
When I log in as "student1"
|
|
|
58 |
Then I should see "1" in the "//*[@title='Toggle messaging drawer']/../*[@data-region='count-container']" "xpath_element"
|
|
|
59 |
And I open messaging
|
|
|
60 |
And I should see "1" in the "Private" "core_message > Message tab"
|
|
|
61 |
And "Student 2" "core_message > Message" should exist
|
|
|
62 |
And I should see "1" in the "Student 2" "core_message > Message"
|
|
|
63 |
And I select "Student 2" conversation in messaging
|
|
|
64 |
And I should see "Hi!" in the "Student 2" "core_message > Message conversation"
|
|
|
65 |
And I should not see "1" in the "//*[@title='Toggle messaging drawer']/../*[@data-region='count-container']" "xpath_element"
|
|
|
66 |
And I should not see "1" in the "Private" "core_message > Message tab"
|
|
|
67 |
And I should not see "1" in the "Student 2" "core_message > Message"
|
|
|
68 |
|
|
|
69 |
Scenario: Unread messages for starred conversation
|
|
|
70 |
Given the following "private messages" exist:
|
|
|
71 |
| user | contact | message |
|
|
|
72 |
| student1 | student2 | Hi! |
|
|
|
73 |
| student2 | student1 | What do you need? |
|
|
|
74 |
And the following "favourite conversations" exist:
|
|
|
75 |
| user | contact |
|
|
|
76 |
| student1 | student2 |
|
|
|
77 |
When I log in as "student1"
|
|
|
78 |
Then I should see "1" in the "//*[@title='Toggle messaging drawer']/../*[@data-region='count-container']" "xpath_element"
|
|
|
79 |
And I open messaging
|
|
|
80 |
And I should see "1" in the "Starred" "core_message > Message tab"
|
|
|
81 |
And "Student 2" "core_message > Message" should exist
|
|
|
82 |
And I should see "1" in the "Student 2" "core_message > Message"
|
|
|
83 |
And I select "Student 2" conversation in messaging
|
|
|
84 |
And I should see "Hi!" in the "Student 2" "core_message > Message conversation"
|
|
|
85 |
And I should not see "1" in the "//*[@title='Toggle messaging drawer']/../*[@data-region='count-container']" "xpath_element"
|
|
|
86 |
And I should not see "1" in the "Starred" "core_message > Message tab"
|
|
|
87 |
And I should not see "1" in the "Student 2" "core_message > Message"
|