1 |
efrain |
1 |
@mod @mod_forum @_file_upload
|
|
|
2 |
Feature: Add forum activities and discussions
|
|
|
3 |
In order to discuss topics with other users
|
|
|
4 |
As a teacher
|
|
|
5 |
I need to add forum activities to moodle courses
|
|
|
6 |
|
|
|
7 |
@javascript
|
|
|
8 |
Scenario: Add a forum and a discussion attaching files
|
|
|
9 |
Given the following "users" exist:
|
|
|
10 |
| username | firstname | lastname | email |
|
|
|
11 |
| teacher1 | Teacher | 1 | teacher1@example.com |
|
|
|
12 |
| student1 | Student | 1 | student1@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 |
And I log in as "teacher1"
|
|
|
21 |
And I add a forum activity to course "Course 1" section "1" and I fill the form with:
|
|
|
22 |
| Forum name | Test forum name |
|
|
|
23 |
| Forum type | Standard forum for general use |
|
|
|
24 |
| Description | Test forum description |
|
|
|
25 |
And I add a new discussion to "Test forum name" forum with:
|
|
|
26 |
| Subject | Forum post 1 |
|
|
|
27 |
| Message | This is the body |
|
|
|
28 |
And I am on the "Course 1" course page logged in as student1
|
|
|
29 |
When I add a new discussion to "Test forum name" forum with:
|
|
|
30 |
| Subject | Post with attachment |
|
|
|
31 |
| Message | This is the body |
|
|
|
32 |
| Attachment | lib/tests/fixtures/empty.txt |
|
|
|
33 |
And I reply "Forum post 1" post from "Test forum name" forum with:
|
|
|
34 |
| Subject | Reply with attachment |
|
|
|
35 |
| Message | This is the body |
|
|
|
36 |
| Attachment | lib/tests/fixtures/upload_users.csv |
|
|
|
37 |
Then I should see "Reply with attachment"
|
|
|
38 |
And I should see "upload_users.csv"
|
|
|
39 |
And I am on the "Test forum name" "forum activity" page
|
|
|
40 |
And I follow "Post with attachment"
|
|
|
41 |
And I should see "empty.txt"
|
|
|
42 |
And I follow "Edit"
|
|
|
43 |
And the field "Attachment" matches value "empty.txt"
|
|
|
44 |
|
|
|
45 |
Scenario: Test forum settings validation
|
|
|
46 |
Given the following "courses" exist:
|
|
|
47 |
| fullname | shortname | category |
|
|
|
48 |
| Course 1 | C1 | 0 |
|
|
|
49 |
And I log in as "admin"
|
|
|
50 |
And I add a forum activity to course "Course 1" section "0" and I fill the form with:
|
|
|
51 |
| Forum name | Test forum |
|
|
|
52 |
| Forum type | single |
|
|
|
53 |
| Group mode | 1 |
|
|
|
54 |
When I press "Save and display"
|
|
|
55 |
Then I should see "Separate groups can't be used with a single simple discussion."
|
|
|
56 |
And I should see "A single simple discussion can't be used with separate groups."
|