MDL-47960 behat: Fixed message node navigation
[moodle.git] / grade / report / singleview / tests / behat / singleview.feature
CommitLineData
8ec7b088 1@core @core_grades @gradereport_singleview
2fd9718d
ZD
2Feature: We can use Single view
3 As a teacher
8ec7b088
ZD
4 In order to view and edit grades
5 For users and activities for a course.
2fd9718d 6
8ec7b088 7 Background:
2fd9718d 8 Given the following "courses" exist:
8ec7b088
ZD
9 | fullname | shortname | category |
10 | Course 1 | C1 | 0 |
2fd9718d
ZD
11 And the following "users" exist:
12 | username | firstname | lastname | email | idnumber | alternatename |
f86233a4
ZD
13 | teacher1 | Teacher | 1 | teacher1@asd.com | t1 | fred |
14 | student1 | Student | 1 | student1@asd.com | s1 | james |
15 | student2 | Student | 2 | student1@asd.com | s2 | holly |
16 | student3 | Student | 3 | student1@asd.com | s3 | anna |
17 | student4 | Student | 4 | student1@asd.com | s4 | zac |
237f76ce
ZD
18 And the following "grade items" exist:
19 | itemname | course |
20 | new grade item 1 | C1 |
2fd9718d
ZD
21 And the following "course enrolments" exist:
22 | user | course | role |
23 | teacher1 | C1 | editingteacher |
24 | student1 | C1 | student |
25 | student2 | C1 | student |
26 | student3 | C1 | student |
27 | student4 | C1 | student |
28 And the following "grade categories" exist:
29 | fullname | course |
30 | Sub category 1 | C1|
31 | Sub category 2 | C1|
32 And the following "activities" exist:
33 | activity | course | idnumber | name | intro | grade |
34 | assign | C1 | a1 | Test assignment one | Submit something! | 300 |
35 | assign | C1 | a2 | Test assignment two | Submit something! | 100 |
36 | assign | C1 | a3 | Test assignment three | Submit something! | 150 |
37 | assign | C1 | a4 | Test assignment four | Submit nothing! | 150 |
0a55da57 38 And I log in as "teacher1"
2fd9718d
ZD
39 And I follow "Course 1"
40 And I follow "Grades"
41
237f76ce 42 @javascript
8ec7b088
ZD
43 Scenario: I can update grades, add feedback and exclude grades.
44 Given I click on "Single view" "option"
f86233a4 45 And I click on "Student 4" "option"
8ec7b088 46 And I click on "Override for Test assignment one" "checkbox"
0a55da57 47 When I set the following fields to these values:
8ec7b088
ZD
48 | Grade for Test assignment one | 10.00 |
49 | Feedback for Test assignment one | test data |
2fd9718d
ZD
50 And I click on "Exclude for Test assignment four" "checkbox"
51 And I press "Update"
f86233a4 52 Then the following should exist in the "generaltable" table:
2fd9718d
ZD
53 | Test assignment four |
54 | excluded |
f86233a4 55 And the following should exist in the "generaltable" table:
8ec7b088 56 | Test assignment one |
2fd9718d 57 | 10.00 |
f86233a4
ZD
58 And I click on "Show grades for Test assignment three" "link"
59 And I click on "Override for james (Student) 1" "checkbox"
2fd9718d 60 And I set the following fields to these values:
f86233a4
ZD
61 | Grade for james (Student) 1 | 12.05 |
62 | Feedback for james (Student) 1 | test data2 |
63 And I click on "Exclude for holly (Student) 2" "checkbox"
2fd9718d 64 And I press "Update"
f86233a4 65 And the following should exist in the "generaltable" table:
8ec7b088 66 | Test assignment three |
2fd9718d
ZD
67 | 12.05 |
68 | Excluded |
69
5f3decb5 70 Scenario: Single view links work on grade report.
8ec7b088
ZD
71 Given I follow "Single view for Test assignment one"
72 Then I should see "Test assignment one"
73 Then I follow "Grader report"
2fd9718d 74 And I follow "Single view for Student 1"
8ec7b088 75 Then I should see "Student 1"
2fd9718d 76
8ec7b088 77 Scenario: Navigation works in the Single view.
237f76ce 78 Given I follow "Single view for Student 1"
8ec7b088 79 Then I should see "Student 1"
f86233a4 80 And I follow "Student 2"
8ec7b088 81 Then I should see "Student 2"
f86233a4 82 And I follow "Student 1"
8ec7b088
ZD
83 Then I should see "Student 1"
84 And I click on "Show grades for Test assignment four" "link"
85 Then I should see "Test assignment four"
86 And I follow "Test assignment three"
87 Then I should see "Test assignment three"
88 And I follow "Test assignment four"
89 Then I should see "Test assignment four"
237f76ce
ZD
90
91 Scenario: Activities are clickable only when
92 it has a valid activity page.
93 Given I follow "Single view for Student 1"
94 And "new grade item 1" "link" should not exist in the "//tbody//tr[position()=1]//td[position()=2]" "xpath_element"
95 Then "Category total" "link" should not exist in the "//tbody//tr[position()=2]//td[position()=2]" "xpath_element"
96 And "Course total" "link" should not exist in the "//tbody//tr[position()=last()]//td[position()=2]" "xpath_element"