1441 |
ariadna |
1 |
@report @report_log
|
|
|
2 |
Feature: In a course with group mode, I can view the group report log page or not
|
|
|
3 |
depending on the group I am in.
|
|
|
4 |
|
|
|
5 |
Background:
|
|
|
6 |
Given the following "courses" exist:
|
|
|
7 |
| fullname | shortname | category | groupmode |
|
|
|
8 |
| Course separate group | C1 | 0 | 1 |
|
|
|
9 |
| Course visible group | C2 | 0 | 2 |
|
|
|
10 |
| Course no group | C3 | 0 | 0 |
|
|
|
11 |
And the following "users" exist:
|
|
|
12 |
| username | firstname | lastname | email |
|
|
|
13 |
| student1 | Student | 1 | student1@example.com |
|
|
|
14 |
| student2 | Student | 2 | student2@example.com |
|
|
|
15 |
| teacher1 | Teacher | 1 | teacher1@example.com |
|
|
|
16 |
| teacher2 | Teacher | 2 | teacher2@example.com |
|
|
|
17 |
And the following "course enrolments" exist:
|
|
|
18 |
| user | course | role |
|
|
|
19 |
| teacher1 | C1 | teacher |
|
|
|
20 |
| teacher2 | C1 | teacher |
|
|
|
21 |
| student1 | C1 | student |
|
|
|
22 |
| student2 | C1 | student |
|
|
|
23 |
| teacher1 | C2 | teacher |
|
|
|
24 |
| teacher2 | C2 | teacher |
|
|
|
25 |
| student1 | C2 | student |
|
|
|
26 |
| student2 | C2 | student |
|
|
|
27 |
| teacher1 | C3 | teacher |
|
|
|
28 |
| teacher2 | C3 | teacher |
|
|
|
29 |
| student1 | C3 | student |
|
|
|
30 |
| student2 | C3 | student |
|
|
|
31 |
And the following "groups" exist:
|
|
|
32 |
| course | name | idnumber |
|
|
|
33 |
| C1 | Group C1.1 | group11 |
|
|
|
34 |
| C2 | Group C2.1 | group21 |
|
|
|
35 |
| C3 | Group C3.1 | group31 |
|
|
|
36 |
And the following "group members" exist:
|
|
|
37 |
| group | user |
|
|
|
38 |
| group11 | student1 |
|
|
|
39 |
| group11 | teacher1 |
|
|
|
40 |
| group21 | student1 |
|
|
|
41 |
| group21 | teacher1 |
|
|
|
42 |
| group31 | student1 |
|
|
|
43 |
| group31 | teacher1 |
|
|
|
44 |
And the following "activities" exist:
|
|
|
45 |
| activity | name | intro | course | idnumber |
|
|
|
46 |
| page | Page11 | Page11 | C1 | page1 |
|
|
|
47 |
| page | Page21 | Page21 | C2 | page1 |
|
|
|
48 |
| page | Page31 | Page31 | C3 | page1 |
|
|
|
49 |
# Generate logs for the pages.
|
|
|
50 |
And I am on the "Page11" "page activity" page logged in as student1
|
|
|
51 |
And I am on "Course separate group" course homepage
|
|
|
52 |
And I log out
|
|
|
53 |
And I am on the "Page11" "page activity" page logged in as student2
|
|
|
54 |
And I am on "Course separate group" course homepage
|
|
|
55 |
And I log out
|
|
|
56 |
And I am on the "Page21" "page activity" page logged in as student1
|
|
|
57 |
And I am on "Course visible group" course homepage
|
|
|
58 |
And I log out
|
|
|
59 |
And I am on the "Page21" "page activity" page logged in as student2
|
|
|
60 |
And I am on "Course visible group" course homepage
|
|
|
61 |
And I log out
|
|
|
62 |
And I am on the "Page31" "page activity" page logged in as student1
|
|
|
63 |
And I am on "Course no group" course homepage
|
|
|
64 |
And I log out
|
|
|
65 |
And I am on the "Page31" "page activity" page logged in as student2
|
|
|
66 |
And I am on "Course no group" course homepage
|
|
|
67 |
And I log out
|
|
|
68 |
|
|
|
69 |
Scenario Outline: As a user in a course, I can view a link to the report logs if I am in the right group.
|
|
|
70 |
Given I log in as "<user>"
|
|
|
71 |
And I am on "<course>" course homepage
|
|
|
72 |
When I navigate to "Reports" in current page administration
|
|
|
73 |
And "Logs" "link" <shouldexist>
|
|
|
74 |
And I log out
|
|
|
75 |
Examples:
|
|
|
76 |
| course | user | shouldexist |
|
|
|
77 |
| Course separate group | teacher1 | should exist |
|
|
|
78 |
| Course separate group | teacher2 | should not exist |
|
|
|
79 |
| Course visible group | teacher1 | should exist |
|
|
|
80 |
| Course visible group | teacher2 | should exist |
|
|
|
81 |
| Course no group | teacher1 | should exist |
|
|
|
82 |
| Course no group | teacher2 | should exist |
|
|
|
83 |
|
|
|
84 |
Scenario Outline: As a non editing teacher not in a group, I can not view the report logs.
|
|
|
85 |
Given I log in as "<user>"
|
|
|
86 |
When I am on the "<course>" "report_log > Logs" page
|
|
|
87 |
Then I <shouldsee> "you need to be part of a group to see this page."
|
|
|
88 |
Examples:
|
|
|
89 |
| course | user | shouldsee |
|
|
|
90 |
| Course separate group | teacher1 | should not see |
|
|
|
91 |
| Course separate group | teacher2 | should see |
|
|
|
92 |
| Course visible group | teacher1 | should not see |
|
|
|
93 |
| Course visible group | teacher2 | should not see |
|
|
|
94 |
| Course no group | teacher1 | should not see |
|
|
|
95 |
| Course no group | teacher2 | should not see |
|