MDL-52347 behat: fix random failures on fast computer
[moodle.git] / message / tests / behat / display_history.feature
CommitLineData
711b1d6b 1@core @core_message
0bc72fcd
AD
2Feature: Message history displays correctly
3 In order to read messages between two users
4 As a user
5 I need to view the conversation with another user
6
7 Background:
759b323e 8 Given the following "users" exist:
0bc72fcd 9 | username | firstname | lastname | email |
0fe86bbd
RT
10 | user1 | User | One | one@example.com |
11 | user2 | User | Two | two@example.com |
0bc72fcd 12 And I log in as "user1"
50edfdca 13 And I send "Message 1 from user1 to user2" message to "User Two" user
a4269b45 14 And I wait "1" seconds
50edfdca
DM
15 And I send "Message 2 from user1 to user2" message to "User Two" user
16 And I send "Message 3 from user1 to user2" message to "User Two" user
17 And I send "Message 4 from user1 to user2" message to "User Two" user
18 And I send "Message 5 from user1 to user2" message to "User Two" user
19 And I send "Message 6 from user1 to user2" message to "User Two" user
20 And I send "Message 7 from user1 to user2" message to "User Two" user
21 And I send "Message 8 from user1 to user2" message to "User Two" user
22 And I send "Message 9 from user1 to user2" message to "User Two" user
a4269b45 23 And I wait "1" seconds
50edfdca 24 And I send "Message 10 from user1 to user2" message to "User Two" user
0bc72fcd
AD
25
26 Scenario: View sent messages
2547fea2 27 When I follow "Messages" in the user menu
f083d614 28 And I set the field "Search people and messages" to "User Two"
0bc72fcd 29 And I press "Search people and messages"
e7c71c44 30 And I click on "Message history" "link" in the "User Two" "table_row"
0bc72fcd
AD
31 # The message history link shows all messages.
32 Then I should see "Message 1 from user1 to user2"
33 And I should see "Message 10 from user1 to user2"
34 # Only the last eight messages.
35 And I follow "Recent messages"
36 And I should see "Message 10 from user1 to user2"
37 And I should not see "Message 1 from user1 to user2"
38
39 Scenario: View received messages
40 When I log out
41 And I log in as "user2"
2547fea2 42 And I follow "Messages" in the user menu
0bc72fcd
AD
43 And I follow "User One (10)"
44 # Should show all of the user's unread messages.
45 Then I should see "Message 1 from user1 to user2"
46 And I should see "Message 10 from user1 to user2"