MDL-46481 backup: behat tests for the quick backup button
[moodle.git] / backup / util / ui / tests / behat / backup_courses.feature
CommitLineData
550d842e 1@core @core_backup
52e8f537
DM
2Feature: 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:
759b323e 8 Given the following "courses" exist:
905729bf
DM
9 | fullname | shortname | category | numsections |
10 | Course 1 | C1 | 0 | 10 |
11 | Course 2 | C2 | 0 | 2 |
759b323e 12 And the following "activities" exist:
905729bf
DM
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:
87a37ebe 21 | Confirmation | 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:
87a37ebe
AN
30 | Initial | Include calendar events | 0 |
31 | Initial | Include course logs | 1 |
11f69d41 32 | Schema | Topic 5 | 0 |
87a37ebe 33 | Confirmation | Filename | test_backup.mbz |
52e8f537 34 Then I should see "Restore"
fcc0b5b9 35 And I click on "Restore" "link" in the "test_backup.mbz" "table_row"
52e8f537
DM
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"
759b323e
DM
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
62244276 41 And I press "Next"
905729bf
DM
42
43 @javascript
44 Scenario: Backup a course without blocks
45 When I backup "Course 1" course using this options:
87a37ebe 46 | 1 | setting_root_blocks | 0 |
905729bf
DM
47 Then I should see "Course backup area"
48
49 @javascript
50 Scenario: Backup selecting just one section
51 When I backup "Course 2" course using this options:
11f69d41
RT
52 | Schema | Test data | 0 |
53 | Schema | Topic 2 | 0 |
87a37ebe 54 | Confirmation | Filename | test_backup.mbz |
905729bf
DM
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"
60 And I press "Next"
61 And I should see "Test assign"
62 And I should not see "Test data"
bae30ef3
SH
63
64 @javascript
65 Scenario: Backup a course using the one click backup button
66 When I perform a quick backup of course "Course 2"
67 Then I should see "Restore"