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
|
|
|
68 |
When I log in as "admin"
|
|
|
69 |
And I navigate to "Users > Accounts > Cohorts" in site administration
|
|
|
70 |
And I follow "All cohorts"
|
|
|
71 |
And I click on "Filters" "button"
|
|
|
72 |
And I set the following fields in the "Name" "core_reportbuilder > Filter" to these values:
|
|
|
73 |
| Name operator | Contains |
|
|
|
74 |
| Name value | category 1 |
|
|
|
75 |
And I click on "Apply" "button" in the "[data-region='report-filters']" "css_element"
|
|
|
76 |
Then the following should exist in the "reportbuilder-table" table:
|
|
|
77 |
| Category | Name |
|
|
|
78 |
| Cat 1 | Cohort in category 1 |
|
|
|
79 |
And the following should not exist in the "reportbuilder-table" table:
|
|
|
80 |
| Category | Name |
|
|
|
81 |
| Cat 2 | Cohort in category 2 |
|
|
|
82 |
| Cat 3 | Cohort in category 3 |
|
|
|
83 |
| System | System cohort |
|