2 Feature: Ensure only users with appropriate permissions can export forum discussions.
5 Given the following "users" exist:
6 | username | firstname | lastname | email |
7 | teacher1 | Teacher | 1 | teacher1@example.com |
8 | student1 | Student | 1 | student1@example.com |
9 And the following "courses" exist:
10 | fullname | shortname | category |
12 And the following "course enrolments" exist:
13 | user | course | role |
14 | teacher1 | C1 | editingteacher |
15 | student1 | C1 | student |
17 Scenario: A teacher can export discussions to a portfolio.
18 Given the following "activities" exist:
19 | activity | name | intro | course | idnumber | groupmode |
20 | forum | Test forum 1 | Test forum 2 | C1 | forum | 0 |
21 And I log in as "admin"
22 And the following config values are set as admin:
23 | enableportfolios | 1 |
24 And I navigate to "Plugins > Portfolios > Manage portfolios" in site administration
25 And I set portfolio instance "File download" to "Enabled and visible"
26 And I click on "Save" "button"
28 When I log in as "student1"
29 And I am on "Course 1" course homepage
30 And I follow "Test forum 1"
31 And I add a new discussion to "Test forum 1" forum with:
32 | Subject | Discussion 1 |
33 | Message | Test post message |
35 And I follow "Discussion 1"
36 Then "Export whole discussion to portfolio" "button" should not exist
38 And I log in as "teacher1"
39 And I am on "Course 1" course homepage
40 And I follow "Test forum 1"
41 And I follow "Discussion 1"
42 And "Export whole discussion to portfolio" "button" should exist
43 And I press "Export whole discussion to portfolio"
44 And I should see "Exporting to portfolio"