1 |
efrain |
1 |
@mod @mod_forum
|
|
|
2 |
Feature: A user can navigate to previous and next discussions
|
|
|
3 |
In order to get go the previous discussion
|
|
|
4 |
As a user
|
|
|
5 |
I need to click on the previous discussion link
|
|
|
6 |
|
|
|
7 |
Background:
|
|
|
8 |
Given the following "users" exist:
|
|
|
9 |
| username | firstname | lastname | email |
|
|
|
10 |
| teacher1 | Teacher | 1 | teacher1@example.com |
|
|
|
11 |
| student1 | Student | 1 | student1@example.com |
|
|
|
12 |
| student2 | Student | 2 | student2@example.com |
|
|
|
13 |
And the following "courses" exist:
|
|
|
14 |
| fullname | shortname | category |
|
|
|
15 |
| Course 1 | C1 | 0 |
|
|
|
16 |
And the following "course enrolments" exist:
|
|
|
17 |
| user | course | role |
|
|
|
18 |
| teacher1 | C1 | editingteacher |
|
|
|
19 |
| student1 | C1 | student |
|
|
|
20 |
| student2 | C1 | student |
|
|
|
21 |
And the following "groups" exist:
|
|
|
22 |
| name | course | idnumber |
|
|
|
23 |
| Group 1 | C1 | G1 |
|
|
|
24 |
| Group 2 | C1 | G2 |
|
|
|
25 |
And the following "group members" exist:
|
|
|
26 |
| user | group |
|
|
|
27 |
| teacher1 | G1 |
|
|
|
28 |
| teacher1 | G2 |
|
|
|
29 |
| student1 | G1 |
|
|
|
30 |
| student2 | G2 |
|
|
|
31 |
|
|
|
32 |
Scenario: A user can navigate between discussions
|
|
|
33 |
Given the following "activities" exist:
|
|
|
34 |
| activity | name | course | idnumber | groupmode |
|
|
|
35 |
| forum | Test forum name | C1 | forum | 0 |
|
|
|
36 |
And the following "mod_forum > discussions" exist:
|
|
|
37 |
| user | forum | name | message |
|
|
|
38 |
| teacher1 | forum | Discussion 1 | Test post message |
|
|
|
39 |
| teacher1 | forum | Discussion 2 | Test post message |
|
|
|
40 |
| teacher1 | forum | Discussion 3 | Test post message |
|
|
|
41 |
And I am on the "Test forum name" "forum activity" page logged in as teacher1
|
|
|
42 |
When I follow "Discussion 3"
|
|
|
43 |
Then I should not see "Discussion 1"
|
|
|
44 |
And I should see "Discussion 2"
|
|
|
45 |
And I follow "Discussion 2"
|
|
|
46 |
And I should see "Discussion 1"
|
|
|
47 |
And I should see "Discussion 3"
|
|
|
48 |
And I follow "Discussion 1"
|
|
|
49 |
And I should see "Discussion 2"
|
|
|
50 |
And I should not see "Discussion 3"
|
|
|
51 |
And I follow "Reply"
|
|
|
52 |
And I set the following fields to these values:
|
|
|
53 |
| Message | Answer to discussion |
|
|
|
54 |
# We need to wait a bit to guarantee that the post is created after the previous ones.
|
|
|
55 |
# because there is a bug in the forum_get_discussion_neighbours() when all the discussion
|
|
|
56 |
# last modified times are the same. See MDL-79247 for more details.
|
|
|
57 |
And I wait "1" seconds
|
|
|
58 |
And I press "Post to forum"
|
|
|
59 |
And I should not see "Discussion 2"
|
|
|
60 |
And I should see "Discussion 3"
|
|
|
61 |
And I follow "Discussion 3"
|
|
|
62 |
And I should see "Discussion 1"
|
|
|
63 |
And I should see "Discussion 2"
|
|
|
64 |
And I follow "Discussion 2"
|
|
|
65 |
And I should not see "Discussion 1"
|
|
|
66 |
And I should see "Discussion 3"
|
|
|
67 |
|
|
|
68 |
Scenario: A user can navigate between discussions with visible groups
|
|
|
69 |
Given the following "activities" exist:
|
|
|
70 |
| activity | name | course | idnumber | groupmode |
|
|
|
71 |
| forum | Test forum name | C1 | forum | 2 |
|
|
|
72 |
And the following "mod_forum > discussions" exist:
|
|
|
73 |
| user | forum | name | message |
|
|
|
74 |
| student1 | forum | Discussion 1 Group 0 | Test post message |
|
|
|
75 |
| student1 | forum | Discussion 2 Group 0 | Test post message |
|
|
|
76 |
And the following "mod_forum > discussions" exist:
|
|
|
77 |
| user | forum | name | message | group |
|
|
|
78 |
| student1 | forum | Discussion 1 Group 1 | Test post message | G1 |
|
|
|
79 |
| student1 | forum | Discussion 2 Group 1 | Test post message | G1 |
|
|
|
80 |
| student1 | forum | Discussion 1 Group 2 | Test post message | G2 |
|
|
|
81 |
| student1 | forum | Discussion 2 Group 2 | Test post message | G2 |
|
|
|
82 |
When I am on the "Test forum name" "forum activity" page logged in as student1
|
|
|
83 |
And I select "All participants" from the "Visible groups" singleselect
|
|
|
84 |
And I follow "Discussion 1 Group 0"
|
|
|
85 |
Then I should see "Discussion 2 Group 0"
|
|
|
86 |
And I should not see "Group 1"
|
|
|
87 |
And I should not see "Group 2"
|
|
|
88 |
And I follow "Discussion 2 Group 0"
|
|
|
89 |
And I should see "Discussion 1 Group 0"
|
|
|
90 |
And I should see "Discussion 1 Group 1"
|
|
|
91 |
And I follow "Discussion 1 Group 1"
|
|
|
92 |
And I should see "Discussion 2 Group 0"
|
|
|
93 |
And I should see "Discussion 2 Group 1"
|
|
|
94 |
And I follow "Test forum name"
|
|
|
95 |
And I follow "Discussion 1 Group 2"
|
|
|
96 |
And I should see "Discussion 2 Group 1"
|
|
|
97 |
And I should see "Discussion 2 Group 2"
|
|
|
98 |
And I follow "Test forum name"
|
|
|
99 |
And I select "Group 1" from the "Visible groups" singleselect
|
|
|
100 |
And I follow "Discussion 1 Group 1"
|
|
|
101 |
And I should see "Discussion 2 Group 0"
|
|
|
102 |
And I should see "Discussion 2 Group 1"
|
|
|
103 |
And I follow "Discussion 2 Group 1"
|
|
|
104 |
And I should see "Discussion 1 Group 1"
|
|
|
105 |
And I should not see "Group 2"
|
|
|
106 |
|
|
|
107 |
Scenario: A user can navigate between discussions with separate groups
|
|
|
108 |
Given the following "activities" exist:
|
|
|
109 |
| activity | name | course | idnumber | groupmode |
|
|
|
110 |
| forum | Test forum name | C1 | forum | 1 |
|
|
|
111 |
And the following "mod_forum > discussions" exist:
|
|
|
112 |
| user | forum | name | message |
|
|
|
113 |
| student1 | forum | Discussion 1 Group 0 | Test post message |
|
|
|
114 |
| student1 | forum | Discussion 2 Group 0 | Test post message |
|
|
|
115 |
And the following "mod_forum > discussions" exist:
|
|
|
116 |
| user | forum | name | message | group |
|
|
|
117 |
| student1 | forum | Discussion 1 Group 1 | Test post message | G1 |
|
|
|
118 |
| student1 | forum | Discussion 2 Group 1 | Test post message | G1 |
|
|
|
119 |
| student1 | forum | Discussion 1 Group 2 | Test post message | G2 |
|
|
|
120 |
| student1 | forum | Discussion 2 Group 2 | Test post message | G2 |
|
|
|
121 |
When I am on the "Test forum name" "forum activity" page logged in as student1
|
|
|
122 |
And I follow "Discussion 1 Group 1"
|
|
|
123 |
Then I should see "Discussion 2 Group 0"
|
|
|
124 |
And I should see "Discussion 2 Group 1"
|
|
|
125 |
And I follow "Discussion 2 Group 1"
|
|
|
126 |
And I should see "Discussion 1 Group 1"
|
|
|
127 |
And I should not see "Group 2"
|