MDL-66818 mod_forum: remove unnecessary behat steps
[moodle.git] / mod / forum / tests / behat / portfolio_export.feature
CommitLineData
e4ffa5f3 1@mod @mod_forum
2Feature: Ensure only users with appropriate permissions can export forum discussions.
3
4 Background:
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 |
11 | Course 1 | C1 | 0 |
12 And the following "course enrolments" exist:
13 | user | course | role |
14 | teacher1 | C1 | editingteacher |
15 | student1 | C1 | student |
8578e19a 16
e4ffa5f3 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"
27 And I log out
8578e19a 28 When I log in as "student1"
e4ffa5f3 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 |
34 And I reload the page
35 And I follow "Discussion 1"
8578e19a 36 Then "Export whole discussion to portfolio" "button" should not exist
e4ffa5f3 37 And I log out
8578e19a 38 And I log in as "teacher1"
e4ffa5f3 39 And I am on "Course 1" course homepage
40 And I follow "Test forum 1"
41 And I follow "Discussion 1"
8578e19a 42 And "Export whole discussion to portfolio" "button" should exist
e4ffa5f3 43 And I press "Export whole discussion to portfolio"
8578e19a 44 And I should see "Exporting to portfolio"