1 |
efrain |
1 |
@core @core_course
|
|
|
2 |
Feature: View subfolders in a course in-line
|
|
|
3 |
In order to provide different view options for folders
|
|
|
4 |
As a teacher
|
|
|
5 |
I need to add a folders and subfolders and view them inline
|
|
|
6 |
|
|
|
7 |
Background:
|
|
|
8 |
Given the following "users" exist:
|
|
|
9 |
| username | firstname | lastname | email |
|
|
|
10 |
| teacher1 | Teacher | 1 | teacher1@example.com |
|
|
|
11 |
And the following "courses" exist:
|
|
|
12 |
| fullname | shortname | format | coursedisplay | numsections |
|
|
|
13 |
| Course 1 | C1 | topics | 0 | 5 |
|
|
|
14 |
And the following "course enrolments" exist:
|
|
|
15 |
| user | course | role |
|
|
|
16 |
| teacher1 | C1 | editingteacher |
|
|
|
17 |
And the following "activities" exist:
|
|
|
18 |
| activity | course | name | display | showexpanded |
|
|
|
19 |
| folder | C1 | Test folder | 0 | 0 |
|
|
|
20 |
And I am on the "Test folder" "folder activity" page logged in as "teacher1"
|
|
|
21 |
And I press "Edit"
|
|
|
22 |
And I press "Create folder"
|
|
|
23 |
And I set the field "New folder name" to "Test subfolder 1"
|
|
|
24 |
And I click on "button.fp-dlg-butcreate" "css_element" in the "div.fp-mkdir-dlg" "css_element"
|
|
|
25 |
And I press "Save changes"
|
|
|
26 |
|
|
|
27 |
@javascript
|
|
|
28 |
Scenario: Add a folder with two subfolders - view on separate page
|
|
|
29 |
Given I am on "Course 1" course homepage
|
|
|
30 |
And I should not see "Test subfolder 1"
|
|
|
31 |
And I am on the "Test folder" "folder activity" page
|
|
|
32 |
And I should see "Test subfolder 1"
|
|
|
33 |
And I press "Edit"
|
|
|
34 |
And I press "Create folder"
|
|
|
35 |
And I set the field "New folder name" to "Test subfolder 2"
|
|
|
36 |
And I click on "button.fp-dlg-butcreate" "css_element" in the "div.fp-mkdir-dlg" "css_element"
|
|
|
37 |
And I press "Save changes"
|
|
|
38 |
When I am on "Course 1" course homepage
|
|
|
39 |
Then I should not see "Test subfolder 2"
|
|
|
40 |
And I am on the "Test folder" "folder activity" page
|
|
|
41 |
And I should see "Test subfolder 2"
|
|
|
42 |
And I am on the "Test folder" "folder activity editing" page
|
|
|
43 |
And I set the field "Show subfolders expanded" to "1"
|
|
|
44 |
When I am on "Course 1" course homepage
|
|
|
45 |
Then I should not see "Test subfolder 2"
|
|
|
46 |
And I am on the "Test folder" "folder activity" page
|
|
|
47 |
And I should see "Test subfolder 2"
|
|
|
48 |
|
|
|
49 |
@javascript
|
|
|
50 |
Scenario: Make the subfolders viewable inline on the course page
|
|
|
51 |
Given I press "Edit"
|
|
|
52 |
And I click on "div.fp-filename" "css_element" in the "div.fp-filename-field" "css_element"
|
|
|
53 |
And I press "Create folder"
|
|
|
54 |
And I set the field "New folder name" to "Test sub subfolder"
|
|
|
55 |
And I click on "button.fp-dlg-butcreate" "css_element" in the "div.fp-mkdir-dlg" "css_element"
|
|
|
56 |
And I press "Save changes"
|
|
|
57 |
And I navigate to "Settings" in current page administration
|
|
|
58 |
When I set the field "Display folder contents" to "Inline on a course page"
|
|
|
59 |
And I press "Save and return to course"
|
|
|
60 |
Then I should see "Test subfolder 1"
|
|
|
61 |
And I should not see "Test sub subfolder"
|
|
|
62 |
And I am on the "Test folder" "folder activity editing" page
|
|
|
63 |
And I set the field "Show subfolders expanded" to "1"
|
|
|
64 |
And I press "Save and return to course"
|
|
|
65 |
Then I should see "Test subfolder 1"
|
|
|
66 |
And I should see "Test sub subfolder"
|