2 Feature: Backup Moodle courses
3 In order to save and store course contents
5 I need to create backups of courses
8 Given the following "courses" exist:
9 | fullname | shortname | category | numsections |
10 | Course 1 | C1 | 0 | 10 |
11 | Course 2 | C2 | 0 | 2 |
12 And the following "activities" exist:
13 | activity | course | idnumber | name | intro | section |
14 | assign | C2 | assign1 | Test assign | Assign description | 1 |
15 | data | C2 | data1 | Test data | Database description | 2 |
16 And I log in as "admin"
19 Scenario: Backup a course providing options
20 When I backup "Course 1" course using this options:
21 | Confirmation | Filename | test_backup.mbz |
22 Then I should see "Restore"
23 And I click on "Restore" "link" in the "test_backup.mbz" "table_row"
24 And I should see "URL of backup"
25 And I should see "Anonymize user information"
28 Scenario: Backup a course with default options
29 When I backup "Course 1" course using this options:
30 | Initial | Include calendar events | 0 |
31 | Initial | Include course logs | 1 |
32 | Schema | Topic 5 | 0 |
33 | Confirmation | Filename | test_backup.mbz |
34 Then I should see "Restore"
35 And I click on "Restore" "link" in the "test_backup.mbz" "table_row"
36 And I should not see "Section 3"
37 And I press "Continue"
38 And I click on "Continue" "button" in the ".bcs-current-course" "css_element"
39 And "//div[contains(concat(' ', normalize-space(@class), ' '), ' fitem ')][contains(., 'Include calendar events')]/descendant::img" "xpath_element" should exist
40 And "Include course logs" "checkbox" should exist
44 Scenario: Backup a course without blocks
45 When I backup "Course 1" course using this options:
46 | 1 | setting_root_blocks | 0 |
47 Then I should see "Course backup area"
50 Scenario: Backup selecting just one section
51 When I backup "Course 2" course using this options:
52 | Schema | Test data | 0 |
53 | Schema | Topic 2 | 0 |
54 | Confirmation | Filename | test_backup.mbz |
55 Then I should see "Course backup area"
56 And I click on "Restore" "link" in the "test_backup.mbz" "table_row"
57 And I should not see "Section 2"
58 And I press "Continue"
59 And I click on "Continue" "button" in the ".bcs-current-course" "css_element"
61 And I should see "Test assign"
62 And I should not see "Test data"