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: Test if displaying the course contacts works correctly:
3
  As a user I need to see the course contacts of a course.
4
  As an admin I need to be able to control the appearance of the course contacts.
5
 
6
  Background:
7
    Given the following "categories" exist:
8
      | name | category | idnumber |
9
      | Cat 1 | 0 | CAT1 |
10
    And the following "courses" exist:
11
      | fullname | shortname | category | format |
12
      | Course 1 | C1 | CAT1 | topics |
13
    And the following "users" exist:
14
      | username | firstname | lastname | email |
15
      | teacher1 | Teacher | 1 | teacher1@example.com |
16
      | teacher2 | Teacher | 2 | teacher2@example.com |
17
      | teacher3 | Teacher | 3 | teacher3@example.com |
18
      | manager1 | Manager | 1 | manager1@example.com |
19
      | student1 | Student | 1 | student1@example.com |
20
    And the following "course enrolments" exist:
21
      | user | course | role |
22
      | teacher1 | C1 | editingteacher |
23
      | teacher1 | C1 | teacher |
24
      | teacher2 | C1 | teacher |
25
      | teacher3 | C1 | editingteacher |
26
      | manager1 | C1 | manager |
27
 
28
  Scenario: Test general course contacts functionality for all user roles
29
    Given I log in as "admin"
30
    And I navigate to "Appearance > Courses" in site administration
31
    And I set the following fields to these values:
32
      | Manager | 0 |
33
      | Teacher | 1 |
34
      | Non-editing teacher | 0 |
35
      | Display all course contact roles | 0 |
36
    And I press "Save changes"
37
 
38
    When I am on course index
39
    And I should see "Cat 1" in the "#region-main" "css_element"
40
    And I follow "Cat 1"
41
    And I wait until the page is ready
42
    And I should see "Course 1" in the "#region-main" "css_element"
43
    Then I should see "Teacher 1" in the ".teachers" "css_element"
44
    And I should not see "Teacher 2" in the ".teachers" "css_element"
45
    And I should not see "Manager 1" in the ".teachers" "css_element"
46
 
47
    When I log out
48
    And I log in as "manager1"
49
    And I am on course index
50
    And I should see "Cat 1" in the "#region-main" "css_element"
51
    And I follow "Cat 1"
52
    And I wait until the page is ready
53
    And I should see "Course 1" in the "#region-main" "css_element"
54
    Then I should see "Teacher 1" in the ".teachers" "css_element"
55
    And I should not see "Teacher 2" in the ".teachers" "css_element"
56
    And I should not see "Manager 1" in the ".teachers" "css_element"
57
 
58
    When I log out
59
    And I log in as "teacher1"
60
    And I am on course index
61
    And I should see "Cat 1" in the "#region-main" "css_element"
62
    And I follow "Cat 1"
63
    And I wait until the page is ready
64
    And I should see "Course 1" in the "#region-main" "css_element"
65
    Then I should see "Teacher 1" in the ".teachers" "css_element"
66
    And I should not see "Teacher 2" in the ".teachers" "css_element"
67
    And I should not see "Manager 1" in the ".teachers" "css_element"
68
 
69
    When I log out
70
    And I log in as "student1"
71
    And I am on course index
72
    And I should see "Cat 1" in the "#region-main" "css_element"
73
    And I follow "Cat 1"
74
    And I wait until the page is ready
75
    And I should see "Course 1" in the "#region-main" "css_element"
76
    Then I should see "Teacher 1" in the ".teachers" "css_element"
77
    And I should not see "Teacher 2" in the ".teachers" "css_element"
78
    And I should not see "Manager 1" in the ".teachers" "css_element"
79
 
80
  Scenario: Test course contact roles without displaying all roles
81
    Given I log in as "admin"
82
    And I navigate to "Appearance > Courses" in site administration
83
    And I set the following fields to these values:
84
      | Manager | 0 |
85
      | Teacher | 1 |
86
      | Non-editing teacher | 1 |
87
      | Display all course contact roles | 0 |
88
    And I press "Save changes"
89
    When I am on course index
90
    And I should see "Cat 1" in the "#region-main" "css_element"
91
    And I follow "Cat 1"
92
    And I wait until the page is ready
93
    And I should see "Course 1" in the "#region-main" "css_element"
94
    Then I should see "Teacher 1" in the ".teachers" "css_element"
95
    And I should see "Teacher 2" in the ".teachers" "css_element"
96
    And I should see "Teacher 3" in the ".teachers" "css_element"
97
    And I should see "Teacher: Teacher 1" in the ".teachers" "css_element"
98
    And I should not see "Teacher, Non-editing teacher: Teacher 1" in the ".teachers" "css_element"
99
    And I should not see "Manager 1" in the ".teachers" "css_element"
100
 
101
  Scenario: Test course contact roles with displaying all roles and standard sorting
102
    Given I log in as "admin"
103
    And I navigate to "Appearance > Courses" in site administration
104
    And I set the following fields to these values:
105
      | Manager | 0 |
106
      | Teacher | 1 |
107
      | Non-editing teacher | 1 |
108
      | Display all course contact roles | 1 |
109
    And I press "Save changes"
110
    When I am on course index
111
    And I should see "Cat 1" in the "#region-main" "css_element"
112
    And I follow "Cat 1"
113
    And I wait until the page is ready
114
    And I should see "Course 1" in the "#region-main" "css_element"
115
    Then I should see "Teacher 1" in the ".teachers" "css_element"
116
    And I should see "Teacher 2" in the ".teachers" "css_element"
117
    And I should see "Teacher 3" in the ".teachers" "css_element"
118
    And I should see "Teacher, Non-editing teacher: Teacher 1" in the ".teachers" "css_element"
119
    And I should not see "Teacher: Teacher 1" in the ".teachers" "css_element"
120
    And I should not see "Manager 1" in the ".teachers" "css_element"
121
    And I should see teacher "Teacher 1" before "Teacher 3" in the course contact listing
122
    And I should see teacher "Teacher 3" before "Teacher 2" in the course contact listing
123
    And I should not see teacher "Teacher 1" after "Teacher 3" in the course contact listing
124
    And I should not see teacher "Teacher 3" after "Teacher 2" in the course contact listing
125
 
126
  Scenario: Test course contact roles with displaying all roles and modified sorting
127
    Given I log in as "admin"
128
    And I navigate to "Appearance > Courses" in site administration
129
    And I set the following fields to these values:
130
      | Manager | 0 |
131
      | Teacher | 1 |
132
      | Non-editing teacher | 1 |
133
      | Display all course contact roles | 1 |
134
    And I press "Save changes"
135
    And I navigate to "Users > Permissions > Define roles" in site administration
136
    And I click on "Move up" "link" in the "//td[text()[contains(.,'Non-editing teacher')]]/parent::tr/td[contains(@class, 'lastcol')]" "xpath_element"
137
    When I am on course index
138
    And I should see "Cat 1" in the "#region-main" "css_element"
139
    And I follow "Cat 1"
140
    And I wait until the page is ready
141
    And I should see "Course 1" in the "#region-main" "css_element"
142
    Then I should see "Teacher 1" in the ".teachers" "css_element"
143
    And I should see "Teacher 2" in the ".teachers" "css_element"
144
    And I should see "Teacher 3" in the ".teachers" "css_element"
145
    And I should see "Non-editing teacher, Teacher: Teacher 1" in the ".teachers" "css_element"
146
    And I should not see "Non-editing teacher: Teacher 1" in the ".teachers" "css_element"
147
    And I should not see "Manager 1" in the ".teachers" "css_element"
148
    And I should see teacher "Teacher 1" before "Teacher 2" in the course contact listing
149
    And I should see teacher "Teacher 2" before "Teacher 3" in the course contact listing
150
    And I should not see teacher "Teacher 1" after "Teacher 2" in the course contact listing
151
    And I should not see teacher "Teacher 2" after "Teacher 3" in the course contact listing