Commit | Line | Data |
---|---|---|
550d842e | 1 | @core @core_backup |
52e8f537 DM |
2 | Feature: Backup Moodle courses |
3 | In order to save and store course contents | |
5d7b6307 | 4 | As an admin |
52e8f537 DM |
5 | I need to create backups of courses |
6 | ||
7 | Background: | |
8 | Given the following "courses" exists: | |
905729bf DM |
9 | | fullname | shortname | category | numsections | |
10 | | Course 1 | C1 | 0 | 10 | | |
11 | | Course 2 | C2 | 0 | 2 | | |
12 | And the following "activities" exists: | |
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 | | |
52e8f537 DM |
16 | And I log in as "admin" |
17 | ||
18 | @javascript | |
19 | Scenario: Backup a course providing options | |
20 | When I backup "Course 1" course using this options: | |
fcc0b5b9 | 21 | | Filename | test_backup.mbz | |
52e8f537 | 22 | Then I should see "Restore" |
fcc0b5b9 | 23 | And I click on "Restore" "link" in the "test_backup.mbz" "table_row" |
52e8f537 DM |
24 | And I should see "URL of backup" |
25 | And I should see "Anonymize user information" | |
26 | ||
27 | @javascript | |
28 | Scenario: Backup a course with default options | |
29 | When I backup "Course 1" course using this options: | |
30 | | Filename | test_backup.mbz | | |
31 | | Include calendar events | 0 | | |
32 | | Include course logs | 1 | | |
33 | | setting_section_section_5_userinfo | 0 | | |
34 | | setting_section_section_5_included | 0 | | |
35 | Then I should see "Restore" | |
fcc0b5b9 | 36 | And I click on "Restore" "link" in the "test_backup.mbz" "table_row" |
52e8f537 DM |
37 | And I should not see "Section 3" |
38 | And I press "Continue" | |
39 | And I click on "Continue" "button" in the ".bcs-current-course" "css_element" | |
38976081 | 40 | And "//div[contains(concat(' ', normalize-space(@class), ' '), ' fitem ')][contains(., 'Include calendar events')]/descendant::img" "xpath_element" should exists |
333db2e9 | 41 | And "Include course logs" "checkbox" should exists |
62244276 | 42 | And I press "Next" |
905729bf DM |
43 | |
44 | @javascript | |
45 | Scenario: Backup a course without blocks | |
46 | When I backup "Course 1" course using this options: | |
47 | | id_setting_root_blocks | 0 | | |
48 | Then I should see "Course backup area" | |
49 | ||
50 | @javascript | |
51 | Scenario: Backup selecting just one section | |
52 | When I backup "Course 2" course using this options: | |
53 | | Filename | test_backup.mbz | | |
54 | | setting_section_section_2_userinfo | 0 | | |
55 | | setting_section_section_2_included | 0 | | |
56 | | setting_section_section_4_userinfo | 0 | | |
57 | | setting_section_section_4_included | 0 | | |
58 | Then I should see "Course backup area" | |
59 | And I click on "Restore" "link" in the "test_backup.mbz" "table_row" | |
60 | And I should not see "Section 2" | |
61 | And I press "Continue" | |
62 | And I click on "Continue" "button" in the ".bcs-current-course" "css_element" | |
63 | And I press "Next" | |
64 | And I should see "Test assign" | |
65 | And I should not see "Test data" |