Proyectos de Subversion Moodle

Rev

Rev 1 | | Comparar con el anterior | Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
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)"
1441 ariadna 58
 
59
  Scenario: Import course badges to another course
60
    Given I log in as "teacher1"
61
    And the following "core_badges > Badges" exist:
62
      | name                                      | course | description       | image                        | status | type |
63
      | Published course badge                    | C1     | Badge description | badges/tests/behat/badge.png | active | 2    |
64
      | Unpublished course badge                  | C1     | Badge description | badges/tests/behat/badge.png | 0      | 2    |
65
      | Unpublished without criteria course badge | C1     | Badge description | badges/tests/behat/badge.png | 0      | 2    |
66
    And the following "core_badges > Criterias" exist:
67
      | badge                    | role           |
68
      | Published course badge   | editingteacher |
69
      | Unpublished course badge | editingteacher |
70
    When I import "Course 1" course into "Course 2" course using this options:
71
      | Initial  | Include badges | 1 |
72
    And I navigate to "Badges" in current page administration
73
    Then I should see "Published course badge"
74
    And I should see "Unpublished course badge"
75
    And I should see "Unpublished without criteria course badge"
76
    # Badges exist and the criteria have been restored too.
77
    And ".no-criteria-set" "css_element" should not exist in the "Published course badge" "table_row"
78
    And ".no-criteria-set" "css_element" should not exist in the "Unpublished course badge" "table_row"
79
    And ".no-criteria-set" "css_element" should exist in the "Unpublished without criteria course badge" "table_row"
80
 
81
  Scenario: Import process should not include badges by default
82
    Given I log in as "teacher1"
83
    And the following "core_badges > Badges" exist:
84
      | name                                      | course | description       | image                        | status | type |
85
      | Published course badge                    | C1     | Badge description | badges/tests/behat/badge.png | active | 2    |
86
    And the following "core_badges > Criterias" exist:
87
      | badge                    | role           |
88
      | Published course badge   | editingteacher |
89
    When I import "Course 1" course into "Course 2" course using this options:
90
      | Initial  | Include badges | 0 |
91
    And I navigate to "Badges" in current page administration
92
    Then I should not see "Published course badge"