MDL-58265 core_test: add I am on course homepage in edit mode step
[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"
19 And I navigate to "File types" node in "Site administration>Server"
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"
c987d1b2 31 And I am on course page "Course 1"
202203e3
RD
32 And I turn editing mode on
33 When I add a "File" to section "1" and I fill the form with:
34 | Name | Test file |
8b25614c 35 | Select files | files/tests/fixtures/custom_filetype.mdlr |
202203e3
RD
36 | Show type | 1 |
37 | Display resource description | 1 |
c987d1b2 38 And I am on course page "Course 1"
202203e3 39 Then I should see "Test file"
8b25614c 40 And I should see "Moodle rules" in the "span.resourcelinkdetails" "css_element"