MDL-31093 Scorm course format: Remove behat tests
[moodle.git] / backup / util / ui / tests / behat / restore_moodle2_courses.feature
CommitLineData
550d842e 1@core @core_backup
00f07462
DM
2Feature: Restore Moodle 2 course backups
3 In order to continue using my stored course contents
5d7b6307 4 As a teacher and an admin
00f07462
DM
5 I need to restore them inside other Moodle courses or in new courses
6
7 Background:
8 Given the following "courses" exists:
bdf808de
DM
9 | fullname | shortname | category | format | numsections | coursedisplay |
10 | Course 1 | C1 | 0 | topics | 15 | 1 |
11 | Course 2 | C2 | 0 | topics | 5 | 0 |
00f07462
DM
12 And I log in as "admin"
13 And I follow "Course 1"
14 And I turn editing mode on
4d40089d 15 And I add a "Forum" to section "1" and I fill the form with:
00f07462
DM
16 | Forum name | Test forum name |
17 | Description | Test forum description |
18 And I add the "Community finder" block
19
20 @javascript
21 Scenario: Restore a course in another existing course
22 When I backup "Course 1" course using this options:
23 | Filename | test_backup.mbz |
24 And I restore "test_backup.mbz" backup into "Course 2" course using this options:
25 Then I should see "Course 2"
26 And I should see "Community finder"
27 And I should see "Test forum name"
28
29 @javascript
30 Scenario: Restore a course in a new course
31 When I backup "Course 1" course using this options:
32 | Filename | test_backup.mbz |
33 And I restore "test_backup.mbz" backup into a new course using this options:
34 | Course name | Course 1 restored in a new course |
35 Then I should see "Course 1 restored in a new course"
36 And I should see "Community finder"
37 And I should see "Test forum name"
bdf808de
DM
38 And I follow "Edit settings"
39 And I expand all fieldsets
40 And the "id_format" field should match "Topics format" value
41 And the "Number of sections" field should match "15" value
42 And the "Course layout" field should match "Show one section per page" value
43 And I press "Cancel"
00f07462
DM
44
45 @javascript
46 Scenario: Restore a backup into the same course
47 When I backup "Course 1" course using this options:
48 | Filename | test_backup.mbz |
49 And I merge "test_backup.mbz" backup into the current course using this options:
50 | setting_section_section_5_included | 0 |
51 | setting_section_section_5_userinfo | 0 |
52 Then I should see "Course 1"
53 And I should not see "Section 3"
54 And I should see "Community finder"
55 And I should see "Test forum name"
56
57 @javascript
58 Scenario: Restore a backup into the same course removing it's contents before that
59 When I backup "Course 1" course using this options:
60 | Filename | test_backup.mbz |
61 And I follow "Course 1"
62 And I add a "Forum" to section "1" and I fill the form with:
63 | Forum name | Test forum post backup name |
64 | Description | Test forum post backup description |
65 And I follow "Restore"
66 And I merge "test_backup.mbz" backup into the current course after deleting it's contents using this options:
67 | setting_section_section_5_userinfo | 0 |
68 | setting_section_section_5_included | 0 |
69 Then I should see "Course 1"
70 And I should not see "Section 3"
71 And I should not see "Test forum post backup name"
72 And I should see "Community finder"
73 And I should see "Test forum name"
a3dd930e
DM
74
75 @javascript
76 Scenario: Restore a backup into a new course changing the course format afterwards
77 Given I backup "Course 1" course using this options:
78 | Filename | test_backup.mbz |
79 When I restore "test_backup.mbz" backup into a new course using this options:
80 Then I should see "Topic 1"
81 And I should see "Test forum name"
82 And I follow "Edit settings"
5bc7cd92 83 And I expand all fieldsets
a3dd930e
DM
84 And the "id_format" field should match "Topics format" value
85 And I fill the moodle form with:
86 | id_startdate_day | 1 |
87 | id_startdate_month | January |
88 | id_startdate_year | 2020 |
89 | id_format | Weekly format |
90 And I press "Save changes"
2532b034 91 And I should see "1 January - 7 January"
a3dd930e
DM
92 And I should see "Test forum name"
93 And I follow "Edit settings"
5bc7cd92 94 And I expand all fieldsets
a3dd930e
DM
95 And the "id_format" field should match "Weekly format" value
96 And I fill the moodle form with:
97 | id_format | Social format |
98 And I press "Save changes"
99 And I should see "An open forum for chatting about anything you want to"
100 And I follow "Edit settings"
5bc7cd92 101 And I expand all fieldsets
a3dd930e 102 And the "id_format" field should match "Social format" value
a3dd930e 103 And I press "Cancel"
bdf808de
DM
104
105 @javascript
106 Scenario: Restore a backup in an existing course retaining the backup course settings
107 Given I add a "URL" to section "3" and I fill the form with:
108 | Name | Test URL name |
109 | Description | Test URL description |
110 | id_externalurl | http://www.moodle.org |
111 And I hide section "3"
112 And I hide section "7"
113 When I backup "Course 1" course using this options:
114 | Filename | test_backup.mbz |
115 And I restore "test_backup.mbz" backup into "Course 2" course using this options:
116 | Overwrite course configuration | Yes |
117 And I follow "Edit settings"
118 And I expand all fieldsets
119 Then the "id_format" field should match "Topics format" value
120 And the "Number of sections" field should match "15" value
121 And the "Course layout" field should match "Show one section per page" value
122 And I press "Cancel"
123 And section "3" should be hidden
124 And section "7" should be hidden
125 And section "15" should be visible
126 And I should see "Test URL name" in the "#section-3" "css_element"
127 And I should see "Test forum name" in the "#section-1" "css_element"