1 |
efrain |
1 |
@block @block_private_files @_file_upload
|
|
|
2 |
Feature: The private files block allows users to store files privately in moodle on front page.
|
|
|
3 |
In order to store a private file in moodle
|
|
|
4 |
As a teacher
|
|
|
5 |
I can upload the file to my private files area using the private files block from the front page
|
|
|
6 |
|
|
|
7 |
Background:
|
|
|
8 |
Given the following "courses" exist:
|
|
|
9 |
| fullname | shortname | category |
|
|
|
10 |
| Course 1 | C1 | 0 |
|
|
|
11 |
And the following "users" exist:
|
|
|
12 |
| username | firstname | lastname | email |
|
|
|
13 |
| teacher1 | Teacher | 1 | teacher1@example.com |
|
|
|
14 |
And the following "blocks" exist:
|
|
|
15 |
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
|
|
|
16 |
| private_files | System | 1 | site-index | side-pre |
|
|
|
17 |
|
|
|
18 |
Scenario: Try to view the private files block as a guest
|
|
|
19 |
Given I log in as "guest"
|
|
|
20 |
When I am on site homepage
|
|
|
21 |
Then "Private files" "block" should not exist
|
|
|
22 |
|
|
|
23 |
@javascript
|
|
|
24 |
Scenario: Upload a file to the private files block from the frontpage
|
|
|
25 |
Given I log in as "teacher1"
|
|
|
26 |
And I am on site homepage
|
|
|
27 |
And "Private files" "block" should exist
|
|
|
28 |
And I should see "No files available" in the "Private files" "block"
|
|
|
29 |
When I follow "Manage private files..."
|
|
|
30 |
And I upload "blocks/private_files/tests/fixtures/testfile.txt" file to "Files" filemanager
|
|
|
31 |
And I press "Save changes"
|
|
|
32 |
Then I should see "testfile.txt" in the "Private files" "block"
|