1 |
efrain |
1 |
@report @report_coursesize @_file_upload
|
|
|
2 |
Feature: Course size report calculates correct information
|
|
|
3 |
|
|
|
4 |
Background:
|
|
|
5 |
Given the following "users" exist:
|
|
|
6 |
| username | firstname | lastname | email |
|
|
|
7 |
| teacher1 | Teacher | 1 | teacher1@example.com |
|
|
|
8 |
And the following "courses" exist:
|
|
|
9 |
| fullname | shortname | category |
|
|
|
10 |
| Course 1 | C1 | 0 |
|
|
|
11 |
| Course 2 | C2 | 0 |
|
|
|
12 |
And the following "course enrolments" exist:
|
|
|
13 |
| user | course | role |
|
|
|
14 |
| teacher1 | C1 | editingteacher |
|
|
|
15 |
| teacher1 | C2 | editingteacher |
|
|
|
16 |
And the following config values are set as admin:
|
|
|
17 |
| config | value | plugin |
|
|
|
18 |
| calcmethod | live | report_coursesize |
|
|
|
19 |
And I log in as "teacher1"
|
|
|
20 |
And I am on "Course 1" course homepage
|
|
|
21 |
And I turn editing mode on
|
|
|
22 |
And I add a "File" to section "1"
|
|
|
23 |
And I set the following fields to these values:
|
|
|
24 |
| Name | Myfile |
|
|
|
25 |
And I upload "report/coursesize/tests/fixtures/COPYING.txt" file to "Select files" filemanager
|
|
|
26 |
And I press "Save and return to course"
|
|
|
27 |
And I log out
|
|
|
28 |
|
|
|
29 |
@javascript
|
|
|
30 |
Scenario: Check coursesize report for course 1
|
|
|
31 |
When I log in as "admin"
|
|
|
32 |
And I navigate to "Reports > Course size" in site administration
|
|
|
33 |
Then I should see "File usage report"
|
|
|
34 |
And I should see "34.3" in the "#coursesize_C1" "css_element"
|
|
|
35 |
And I should not see "C2"
|