1 |
efrain |
1 |
@core @core_backup
|
|
|
2 |
Feature: Import course's contents into another course
|
|
|
3 |
In order to move and copy contents between courses
|
|
|
4 |
As a teacher
|
|
|
5 |
I need to import a course contents into another course selecting what I want to import
|
|
|
6 |
|
|
|
7 |
Background:
|
|
|
8 |
Given the following "courses" exist:
|
|
|
9 |
| fullname | shortname | category |
|
|
|
10 |
| Course 1 | C1 | 0 |
|
|
|
11 |
| Course 2 | C2 | 0 |
|
|
|
12 |
And the following "users" exist:
|
|
|
13 |
| username | firstname | lastname | email |
|
|
|
14 |
| teacher1 | Teacher | 1 | teacher1@example.com |
|
|
|
15 |
And the following "course enrolments" exist:
|
|
|
16 |
| user | course | role |
|
|
|
17 |
| teacher1 | C1 | editingteacher |
|
|
|
18 |
| teacher1 | C2 | editingteacher |
|
|
|
19 |
|
|
|
20 |
Scenario: Import course's contents to another course
|
|
|
21 |
Given I log in as "teacher1"
|
|
|
22 |
And the following "activities" exist:
|
|
|
23 |
| activity | name | course | idnumber |
|
|
|
24 |
| data | Test database name | C1 | database1 |
|
|
|
25 |
| forum | Test forum name | C1 | forum1 |
|
|
|
26 |
And the following "blocks" exist:
|
|
|
27 |
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
|
|
|
28 |
| comments | Course | C1 | course-view-* | side-pre |
|
|
|
29 |
| blog_recent | Course | C1 | course-view-* | side-pre |
|
|
|
30 |
When I import "Course 1" course into "Course 2" course using this options:
|
|
|
31 |
Then I should see "Test database name"
|
|
|
32 |
And I should see "Test forum name"
|
|
|
33 |
And I should see "Comments" in the "Comments" "block"
|
|
|
34 |
And I should see "Recent blog entries"
|
|
|
35 |
|
|
|
36 |
Scenario: Import process with permission option
|
|
|
37 |
Given the following "permission overrides" exist:
|
|
|
38 |
| capability | permission | role | contextlevel | reference |
|
|
|
39 |
| enrol/manual:enrol | Allow | teacher | Course | C1 |
|
|
|
40 |
And I log in as "teacher1"
|
|
|
41 |
When I import "Course 1" course into "Course 2" course using this options:
|
|
|
42 |
| Initial | Include permission overrides | 1 |
|
|
|
43 |
And I am on the "Course 1" "permissions" page
|
|
|
44 |
Then I should see "Non-editing teacher (1)"
|
|
|
45 |
And I set the field "Advanced role override" to "Non-editing teacher (1)"
|
|
|
46 |
And I click on "//div[@class='advancedoverride']/div/form/noscript/input" "xpath_element"
|
|
|
47 |
And "enrol/manual:enrol" capability has "Allow" permission
|
|
|
48 |
|
|
|
49 |
Scenario: Import process without permission option
|
|
|
50 |
Given the following "permission overrides" exist:
|
|
|
51 |
| capability | permission | role | contextlevel | reference |
|
|
|
52 |
| enrol/manual:enrol | Allow | teacher | Course | C1 |
|
|
|
53 |
And I log in as "teacher1"
|
|
|
54 |
When I import "Course 1" course into "Course 2" course using this options:
|
|
|
55 |
| Initial | Include permission overrides | 0 |
|
|
|
56 |
And I am on the "Course 2" "permissions" page
|
|
|
57 |
Then I should see "Non-editing teacher (0)"
|