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_cohort
2
Feature: View cohort list
3
  In order to operate with cohorts
4
  As an admin or manager
5
  I need to be able to view the list of cohorts in the system
6
 
7
  Background:
8
    Given the following "categories" exist:
9
      | name  | category | idnumber |
10
      | Cat 1 | 0        | CAT1     |
11
      | Cat 2 | 0        | CAT2     |
12
      | Cat 3 | CAT1     | CAT3     |
13
    And the following "cohorts" exist:
14
      | name          | idnumber |
15
      | System cohort | CH0      |
16
    And the following "cohorts" exist:
17
      | name                 | idnumber | contextlevel | reference |
18
      | Cohort in category 1 | CH1      | Category     | CAT1      |
19
      | Cohort in category 2 | CH2      | Category     | CAT2      |
20
      | Cohort in category 3 | CH3      | Category     | CAT3      |
21
    Given the following "users" exist:
22
      | username | firstname | lastname | email           |
23
      | user1    | First     | User     | first@example.com  |
24
      | user2    | Second    | User     | second@example.com |
25
    And the following "role assigns" exist:
26
      | user  | role    | contextlevel | reference |
27
      | user1 | manager | System       |           |
28
      | user2 | manager | Category     | CAT1      |
29
 
30
  Scenario: Admin can see system cohorts and all cohorts
31
    When I log in as "admin"
32
    And I navigate to "Users > Accounts >Cohorts" in site administration
33
    Then I should see "System cohort"
34
    And I should not see "Cohort in category"
35
    And I follow "All cohorts"
36
    And I should see "System cohort"
37
    And I should see "Cohort in category 1"
38
    And I should see "Cohort in category 2"
39
    And I should see "Cohort in category 3"
40
    And I log out
41
 
42
  Scenario: Manager can see system cohorts and all cohorts
43
    When I log in as "user1"
44
    And I navigate to "Users > Accounts >Cohorts" in site administration
45
    Then I should see "System cohort"
46
    And I should not see "Cohort in category"
47
    And I follow "All cohorts"
48
    And I should see "System cohort"
49
    And I should see "Cohort in category 1"
50
    And I should see "Cohort in category 2"
51
    And I should see "Cohort in category 3"
52
    And I log out
53
 
54
  Scenario: Manager in category can see cohorts in the category
55
    When I log in as "user2"
56
    And I am on course index
57
    And I follow "Cat 1"
58
    And I follow "Cohorts"
59
    And I should not see "All cohorts"
60
    And I should not see "System cohort"
61
    And I should see "Cohort in category 1"
62
    And I should not see "Cohort in category 2"
63
    And I should not see "Cohort in category 3"
64
    And I log out
65
 
66
  @javascript
67
  Scenario: Cohorts list can be filtered
1441 ariadna 68
    Given the following "custom field categories" exist:
69
      | name   | component   | area   | itemid |
70
      | Newcat | core_cohort | cohort | 0      |
71
    And the following "custom fields" exist:
72
      | name            | category | type     | shortname | description | configdata |
73
      | Field checkbox  | Newcat   | checkbox | checkbox  |             |            |
74
    And the following "cohorts" exist:
75
      | name           | idnumber | contextlevel | reference | customfield_checkbox |
76
      | Cohort with CF | CH4      | Category     | CAT1      | 1                    |
1 efrain 77
    When I log in as "admin"
78
    And I navigate to "Users > Accounts > Cohorts" in site administration
79
    And I follow "All cohorts"
80
    And I click on "Filters" "button"
81
    And I set the following fields in the "Name" "core_reportbuilder > Filter" to these values:
82
      | Name operator | Contains    |
83
      | Name value    | category 1  |
84
    And I click on "Apply" "button" in the "[data-region='report-filters']" "css_element"
1441 ariadna 85
    Then the following should exist in the "Cohorts" table:
1 efrain 86
      | Category  | Name                  |
87
      | Cat 1     | Cohort in category 1  |
1441 ariadna 88
    And the following should not exist in the "Cohorts" table:
1 efrain 89
      | Category  | Name                  |
90
      | Cat 2     | Cohort in category 2  |
91
      | Cat 3     | Cohort in category 3  |
92
      | System    | System cohort         |
1441 ariadna 93
    And I click on "Reset all" "button" in the "[data-region='report-filters']" "css_element"
94
    And I set the following fields in the "Field checkbox" "core_reportbuilder > Filter" to these values:
95
      | Field checkbox operator | Yes    |
96
    And I click on "Apply" "button" in the "[data-region='report-filters']" "css_element"
97
    And the following should exist in the "Cohorts" table:
98
      | Category  | Name           |
99
      | Cat 1     | Cohort with CF |
100
    And the following should not exist in the "Cohorts" table:
101
      | Category  | Name                  |
102
      | Cat 1     | Cohort in category 1  |
103
      | Cat 2     | Cohort in category 2  |
104
      | Cat 3     | Cohort in category 3  |
105
      | System    | System cohort         |