Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
@core @core_course
2
Feature: Managers can create courses
3
  In order to group users and contents
4
  As a manager
5
  I need to create courses and set default values on them
6
 
7
  @javascript
8
  Scenario: Courses are created with the default announcements forum
9
    Given the following "users" exist:
10
      | username | firstname | lastname | email |
11
      | teacher1 | Teacher | 1 | teacher1@example.com |
12
      | student1 | Student | 1 | student1@example.com |
13
    And I log in as "admin"
14
    And I create a course with:
15
      | Course full name | Course 1 |
16
      | Course short name | C1 |
17
    And I enrol "Teacher 1" user as "Teacher"
18
    And I enrol "Student 1" user as "Student"
19
    And I log out
20
    When I log in as "teacher1"
21
    And I am on "Course 1" course homepage with editing mode on
22
    And I add the "Latest announcements" block
23
    And I am on the Announcements "forum activity" page
24
    And "Add discussion topic" "link" should exist
25
    And I navigate to "Subscriptions" in current page administration
26
    And I should see "Forced subscription"
27
    And I log out
28
    And I am on the Announcements "forum activity" page logged in as student1
29
    And "Add a new topic" "link" should not exist
30
 
31
  Scenario: Create a course from the management interface and return to it
32
    Given the following "courses" exist:
33
      | fullname | shortname | idnumber | startdate | enddate   |
34
      | Course 1 | Course 1  | C1       | 957139200 | 960163200 |
35
    And I log in as "admin"
36
    And I go to the courses management page
37
    And I should see the "Categories" management page
38
    And I click on category "Category 1" in the management interface
39
    And I should see the "Course categories and courses" management page
40
    And I click on "Create new course" "link" in the "#course-listing" "css_element"
41
    When I set the following fields to these values:
42
      | Course full name | Course 2 |
43
      | Course short name | Course 2 |
44
      | Course summary | Course 2 summary |
45
      | id_startdate_day | 24 |
46
      | id_startdate_month | October |
47
      | id_startdate_year | 2015 |
48
      | id_enddate_day | 24 |
49
      | id_enddate_month | October |
50
      | id_enddate_year | 2016 |
51
    And I press "Save and return"
52
    Then I should see the "Course categories and courses" management page
53
    And I click on "Sort by Course time created ascending" "link" in the ".course-listing-actions" "css_element"
54
    And I should see course listing "Course 1" before "Course 2"
55
    And I click on "Course 2" "link" in the "region-main" "region"
56
    And I click on "Edit" "link" in the ".course-detail" "css_element"
57
    And the following fields match these values:
58
      | Course full name | Course 2 |
59
      | Course short name | Course 2 |
60
      | Course summary | Course 2 summary |
61
      | id_startdate_day | 24 |
62
      | id_startdate_month | October |
63
      | id_startdate_year | 2015 |
64
      | id_enddate_day | 24 |
65
      | id_enddate_month | October |
66
      | id_enddate_year | 2016 |
67
 
68
  Scenario: Create a course as a custom course creator
69
    Given the following "users" exist:
70
      | username  | firstname | lastname | email          |
71
      | kevin  | Kevin   | the        | kevin@example.com |
72
    And the following "roles" exist:
73
      | shortname | name    | archetype |
74
      | creator   | Creator |           |
75
    And the following "system role assigns" exist:
76
      | user   | role    | contextlevel |
77
      | kevin  | creator | System       |
78
    And the following "role capability" exists:
79
      | role                           | creator |
80
      | moodle/course:create           | allow   |
81
      | moodle/course:manageactivities | allow   |
82
      | moodle/course:viewparticipants | allow   |
83
    And I log in as "kevin"
84
    And I am on site homepage
85
    When I press "Add a new course"
86
    And I set the following fields to these values:
87
      | Course full name  | My first course |
88
      | Course short name | myfirstcourse |
89
    And I press "Save and display"
90
    And I follow "Participants"
91
    Then I should see "My first course"
92
    And I should see "Participants"
93
 
94
  Scenario: Creators' role in new courses setting behavior
95
    Given the following "users" exist:
96
      | username  | firstname | lastname | email          |
97
      | kevin  | Kevin   | the        | kevin@example.com |
98
    And the following "system role assigns" exist:
99
      | user   | role    | contextlevel |
100
      | kevin  | coursecreator | System       |
101
    And I log in as "admin"
102
    And I set the following administration settings values:
103
      | Creators' role in new courses | Non-editing teacher |
104
    And I log out
105
    And I log in as "kevin"
106
    And I am on site homepage
107
    When I press "Add a new course"
108
    And I set the following fields to these values:
109
      | Course full name  | My first course |
110
      | Course short name | myfirstcourse |
111
    And I press "Save and display"
112
    And I click on "Participants" "link"
113
    Then I should see "Non-editing teacher" in the "Kevin the" "table_row"
114
 
115
  @javascript
116
  Scenario: Create a course as admin
117
    Given I log in as "admin"
118
    And the following config values are set as admin:
119
      | enroladminnewcourse | 0 |
120
    And I navigate to "Courses > Add a new course" in site administration
121
    And I set the following fields to these values:
122
      | Course full name  | My first course |
123
      | Course short name | myfirstcourse |
124
    And I press "Save and display"
125
    And I navigate to course participants
126
    Then I should not see "Teacher"
127
    And I should see "Nothing to display"
128
    And the following config values are set as admin:
129
      | enroladminnewcourse | 1 |
130
    And I navigate to "Courses > Add a new course" in site administration
131
    And I set the following fields to these values:
132
      | Course full name  | My second course |
133
      | Course short name | mysecondcourse |
134
    And I press "Save and display"
135
    And I navigate to course participants
136
    And I should see "Teacher"
137
    And I should not see "Nothing to display"