1 |
efrain |
1 |
@core @core_course
|
|
|
2 |
Feature: Course content can be downloaded
|
|
|
3 |
In order to retain a backup offline copy of course activity/resource data
|
|
|
4 |
As a user
|
|
|
5 |
I can download a course's content
|
|
|
6 |
|
|
|
7 |
Background:
|
|
|
8 |
Given the following "users" exist:
|
|
|
9 |
| username | firstname | lastname | email |
|
|
|
10 |
| teacher1 | Teacher | 1 | teacher1@example.com |
|
|
|
11 |
| student1 | Student | 1 | student1@example.com |
|
|
|
12 |
And the following "courses" exist:
|
|
|
13 |
| fullname | shortname |
|
|
|
14 |
| Hockey 101 | C1 |
|
|
|
15 |
And the following "course enrolments" exist:
|
|
|
16 |
| user | course | role |
|
|
|
17 |
| teacher1 | C1 | editingteacher |
|
|
|
18 |
| student1 | C1 | student |
|
|
|
19 |
And I log in as "admin"
|
|
|
20 |
And I navigate to "Courses > Download course content" in site administration
|
|
|
21 |
And I set the following fields to these values:
|
|
|
22 |
| Download course content feature available | 1 |
|
|
|
23 |
And I press "Save changes"
|
|
|
24 |
And I navigate to "Courses > Default settings > Course default settings" in site administration
|
|
|
25 |
And I set the field "Enable download course content" to "Yes"
|
|
|
26 |
And I press "Save changes"
|
|
|
27 |
And I log out
|
|
|
28 |
|
|
|
29 |
@javascript
|
|
|
30 |
Scenario: A student can download course content when the feature is enabled in their course
|
|
|
31 |
Given I log in as "student1"
|
|
|
32 |
When I am on "Hockey 101" course homepage
|
|
|
33 |
And I navigate to "Download course content" in current page administration
|
|
|
34 |
Then I should see "You are about to download a zip file"
|
|
|
35 |
# Without the ability to check the downloaded file, the absence of an exception being thrown here is considered a success.
|
|
|
36 |
And I click on "Download" "button" in the "Download course content" "dialogue"
|
|
|
37 |
|
|
|
38 |
@javascript
|
|
|
39 |
Scenario: A teacher can download course content when the feature is enabled in their course
|
|
|
40 |
Given I log in as "teacher1"
|
|
|
41 |
When I am on "Hockey 101" course homepage
|
|
|
42 |
And "Download course content" "link" should exist in current page administration
|
|
|
43 |
And I navigate to "Download course content" in current page administration
|
|
|
44 |
Then I should see "You are about to download a zip file"
|
|
|
45 |
# Without the ability to check the downloaded file, the absence of an exception being thrown here is considered a success.
|
|
|
46 |
And I click on "Download" "button" in the "Download course content" "dialogue"
|