MDL-52347 behat: fix random failures on fast computer
[moodle.git] / course / format / social / tests / behat / social_adjust_discussion_count.feature
CommitLineData
7ce40bcb
SB
1@format @format_social
2Feature: Change number of discussions displayed
3 In order to change the number of discussions displayed
4 As a teacher
5 I need to edit the course and change the number of sections displayed.
6
7Background:
8 Given the following "users" exist:
9 | username | firstname | lastname | email |
0fe86bbd 10 | teacher1 | Teacher | 1 | teacher1@example.com |
7ce40bcb
SB
11 And the following "courses" exist:
12 | fullname | shortname | category | format |
13 | Course 1 | C1 | 0 | social |
14 And the following "course enrolments" exist:
15 | user | course | role |
16 | teacher1 | C1 | editingteacher |
17 And I log in as "teacher1"
18 And I follow "Course 1"
19 And I press "Add a new discussion topic"
20 And I set the following fields to these values:
21 | Subject | Forum Post 10 |
22 | Message | This is forum post ten |
23 And I press "Post to forum"
24 And I wait to be redirected
25 And I follow "Course 1"
a4269b45 26 And I wait "1" seconds
7ce40bcb
SB
27 And I press "Add a new discussion topic"
28 And I set the following fields to these values:
29 | Subject | Forum Post 9 |
30 | Message | This is forum post nine |
31 And I press "Post to forum"
32 And I wait to be redirected
33 And I follow "Course 1"
a4269b45 34 And I wait "1" seconds
7ce40bcb
SB
35 And I press "Add a new discussion topic"
36 And I set the following fields to these values:
37 | Subject | Forum Post 8 |
38 | Message | This is forum post eight |
39 And I press "Post to forum"
40 And I wait to be redirected
41 And I follow "Course 1"
42 And I press "Add a new discussion topic"
43 And I set the following fields to these values:
44 | Subject | Forum Post 7 |
45 | Message | This is forum post seven |
46 And I press "Post to forum"
47 And I wait to be redirected
48 And I follow "Course 1"
49 And I press "Add a new discussion topic"
50 And I set the following fields to these values:
51 | Subject | Forum Post 6 |
52 | Message | This is forum post six |
53 And I press "Post to forum"
54 And I wait to be redirected
55 And I follow "Course 1"
56 And I press "Add a new discussion topic"
57 And I set the following fields to these values:
58 | Subject | Forum Post 5 |
59 | Message | This is forum post five |
60 And I press "Post to forum"
61 And I wait to be redirected
62 And I follow "Course 1"
63 And I press "Add a new discussion topic"
64 And I set the following fields to these values:
65 | Subject | Forum Post 4 |
66 | Message | This is forum post four |
67 And I press "Post to forum"
68 And I wait to be redirected
69 And I follow "Course 1"
70 And I press "Add a new discussion topic"
71 And I set the following fields to these values:
72 | Subject | Forum Post 3 |
73 | Message | This is forum post three |
74 And I press "Post to forum"
75 And I wait to be redirected
76 And I follow "Course 1"
77 And I press "Add a new discussion topic"
78 And I set the following fields to these values:
79 | Subject | Forum Post 2 |
80 | Message | This is forum post two |
81 And I press "Post to forum"
82 And I wait to be redirected
a4269b45 83 And I wait "1" seconds
7ce40bcb
SB
84 And I follow "Course 1"
85 And I press "Add a new discussion topic"
86 And I set the following fields to these values:
87 | Subject | Forum Post 1 |
88 | Message | This is forum post one |
89 And I press "Post to forum"
90 And I wait to be redirected
91 And I follow "Course 1"
92
93Scenario: When number of discussions is decreased fewer discussions appear
94 Given I click on "Edit settings" "link" in the "Administration" "block"
95 And I set the following fields to these values:
96 | numdiscussions | 5 |
97 When I press "Save and display"
85099b38
AN
98 Then I should see "This is forum post one"
99 And I should see "This is forum post five"
7ce40bcb
SB
100 And I should not see "This is forum post six"
101
102Scenario: When number of discussions is decreased to less than 1 only 1 discussion should appear
103 Given I click on "Edit settings" "link" in the "Administration" "block"
104 And I set the following fields to these values:
105 | numdiscussions | -1 |
106 When I press "Save and display"
107 Then I should see "This is forum post one"
108 And I should not see "This is forum post two"
85099b38 109 And I should not see "This is forum post ten"
7ce40bcb
SB
110
111Scenario: When number of discussions is increased more discussions appear
112 Given I click on "Edit settings" "link" in the "Administration" "block"
113 And I set the following fields to these values:
114 | numdiscussions | 9 |
115 When I press "Save and display"
85099b38
AN
116 Then I should see "This is forum post one"
117 And I should see "This is forum post five"
7ce40bcb 118 And I should see "This is forum post nine"
85099b38 119 And I should not see "This is forum post ten"