weekly release 3.7dev
[moodle.git] / files / tests / behat / add_custom_file_type.feature
CommitLineData
8b25614c 1@core @core_files @_file_upload
202203e3
RD
2Feature: Add a new custom file type
3 In order to add files of a custom type
4 As an admin
5 I need to add a new custom file type
6
202203e3
RD
7 @javascript
8 Scenario: Add custom file type
9 Given the following "courses" exist:
10 | fullname | shortname | category | legacyfiles |
11 | Course 1 | C1 | 0 | 2 |
12 And the following "users" exist:
13 | username | firstname | lastname | email |
14 | teacher1 | Teacher | 1 | teacher1@example.com |
15 And the following "course enrolments" exist:
16 | user | course | role |
17 | teacher1 | C1 | editingteacher |
18 And I log in as "admin"
02fda279 19 And I navigate to "Server > File types" in site administration
202203e3
RD
20 And I press "Add a new file type"
21 And I set the following fields to these values:
8b25614c
DM
22 | Extension | mdlr |
23 | MIME type | application/x-moodle-rules |
202203e3
RD
24 | File icon | document |
25 | Description type | Custom description specified in this form |
8b25614c 26 | Custom description | Moodle rules |
202203e3 27 And I press "Save changes"
8b25614c 28 And I should see "application/x-moodle-rules"
202203e3
RD
29 And I log out
30 And I log in as "teacher1"
fdeeaff9 31 And I am on "Course 1" course homepage with editing mode on
202203e3
RD
32 When I add a "File" to section "1" and I fill the form with:
33 | Name | Test file |
8b25614c 34 | Select files | files/tests/fixtures/custom_filetype.mdlr |
202203e3
RD
35 | Show type | 1 |
36 | Display resource description | 1 |
fdeeaff9 37 And I am on "Course 1" course homepage
202203e3 38 Then I should see "Test file"
8b25614c 39 And I should see "Moodle rules" in the "span.resourcelinkdetails" "css_element"