source: moodle/trunk/fuentes/grade/report/history/tests/behat/basic_functionality.feature @ 1331

Last change on this file since 1331 was 1331, checked in by jrpelegrina, 3 years ago

Updated to moodle 3.0.3

File size: 6.8 KB
Line 
1@gradereport @gradereport_history @_bug_phantomjs
2Feature: A teacher checks the grade history report in a course
3  In order to check the history of the grades
4  As a teacher
5  I need to check that the history report is correctly displaying changes
6
7  @javascript
8  Scenario: Check the history report displays results correctly
9    Given the following "courses" exist:
10      | fullname | shortname | category | groupmode |
11      | Course 1 | C1 | 0 | 1 |
12    And the following "users" exist:
13      | username | firstname | lastname | email |
14      | teacher1 | Teacher | 1 | teacher1@example.com |
15      | teacher2 | Teacher | 2 | teacher2@example.com |
16      | student1 | Student | 1 | student1@example.com |
17      | student2 | Student | 2 | student2@example.com |
18    And the following "course enrolments" exist:
19      | user | course | role |
20      | teacher1 | C1 | editingteacher |
21      | teacher2 | C1 | editingteacher |
22      | student1 | C1 | student |
23      | student2 | C1 | student |
24    And I log in as "teacher1"
25    And I follow "Course 1"
26    And I turn editing mode on
27    And I add a "Assignment" to section "1" and I fill the form with:
28      | Assignment name | The greatest assignment ever |
29      | Description | Write a behat test for Moodle - it's amazing! |
30    And I add a "Assignment" to section "1" and I fill the form with:
31      | Assignment name | Rewarding assignment |
32      | Description | After writing your behat test go grab a beer! |
33    And I navigate to "Grades" node in "Course administration"
34    And I turn editing mode on
35    And I give the grade "50.00" to the user "Student 1" for the grade item "The greatest assignment ever"
36    And I give the grade "60.00" to the user "Student 1" for the grade item "Rewarding assignment"
37    And I give the grade "50.00" to the user "Student 2" for the grade item "The greatest assignment ever"
38    And I give the grade "60.00" to the user "Student 2" for the grade item "Rewarding assignment"
39    And I press "Save changes"
40    And I log out
41    And I log in as "teacher2"
42    And I follow "Course 1"
43    And I navigate to "Grades" node in "Course administration"
44    And I turn editing mode on
45    And I give the grade "70.00" to the user "Student 1" for the grade item "The greatest assignment ever"
46    And I give the grade "80.00" to the user "Student 1" for the grade item "Rewarding assignment"
47    And I give the grade "70.00" to the user "Student 2" for the grade item "The greatest assignment ever"
48    And I give the grade "80.00" to the user "Student 2" for the grade item "Rewarding assignment"
49    And I press "Save changes"
50    When I follow "Grade history"
51    Then the following should exist in the "gradereport_history" table:
52      | First name/Surname | Grade item                    | Original grade | Revised grade | Grader    |
53      | Student 1          | The greatest assignment ever  |                | 50.00         | Teacher 1 |
54      | Student 1          | Rewarding assignment          |                | 60.00         | Teacher 1 |
55      | Student 2          | The greatest assignment ever  |                | 50.00         | Teacher 1 |
56      | Student 2          | Rewarding assignment          |                | 60.00         | Teacher 1 |
57      | Student 1          | The greatest assignment ever  | 50.00          | 70.00         | Teacher 2 |
58      | Student 1          | Rewarding assignment          | 60.00          | 80.00         | Teacher 2 |
59      | Student 2          | The greatest assignment ever  | 50.00          | 70.00         | Teacher 2 |
60      | Student 2          | Rewarding assignment          | 60.00          | 80.00         | Teacher 2 |
61    # Test filtering by student.
62    And I press "Select users"
63    And I set the field with xpath "//form/input[@class='usp-search-field']" to "Student 1"
64    And I press "Search"
65    And I set the field with xpath "//div[@class='usp-checkbox']/input" to "1"
66    And I press "Finish selecting users"
67    And I press "Submit"
68    And the following should exist in the "gradereport_history" table:
69      | First name/Surname | Grade item                    | Original grade | Revised grade | Grader    |
70      | Student 1          | The greatest assignment ever  |                | 50.00         | Teacher 1 |
71      | Student 1          | Rewarding assignment          |                | 60.00         | Teacher 1 |
72      | Student 1          | The greatest assignment ever  | 50.00          | 70.00         | Teacher 2 |
73      | Student 1          | Rewarding assignment          | 60.00          | 80.00         | Teacher 2 |
74    And the following should not exist in the "gradereport_history" table:
75      | Student 2          | The greatest assignment ever  |                | 50.00         | Teacher 1 |
76      | Student 2          | Rewarding assignment          |                | 60.00         | Teacher 1 |
77      | Student 2          | The greatest assignment ever  | 50.00          | 70.00         | Teacher 2 |
78      | Student 2          | Rewarding assignment          | 60.00          | 80.00         | Teacher 2 |
79    # Test filtering by assignment.
80    And I click on "The greatest assignment ever" "option" in the "#id_itemid" "css_element"
81    And I press "Submit"
82    And the following should exist in the "gradereport_history" table:
83      | First name/Surname | Grade item                    | Original grade | Revised grade | Grader    |
84      | Student 1          | The greatest assignment ever  |                | 50.00         | Teacher 1 |
85      | Student 1          | The greatest assignment ever  | 50.00          | 70.00         | Teacher 2 |
86    And the following should not exist in the "gradereport_history" table:
87      | Student 1          | Rewarding assignment          |                | 60.00         | Teacher 1 |
88      | Student 1          | Rewarding assignment          | 60.00          | 80.00         | Teacher 2 |
89    # Test filtering by grader.
90    And I click on "Teacher 1" "option" in the "#id_grader" "css_element"
91    And I press "Submit"
92    And the following should exist in the "gradereport_history" table:
93      | First name/Surname | Grade item                    | Original grade | Revised grade | Grader    |
94      | Student 1          | The greatest assignment ever  |                | 50.00         | Teacher 1 |
95    And the following should not exist in the "gradereport_history" table:
96      | Student 1          | The greatest assignment ever  | 50.00          | 70.00         | Teacher 2 |
97    # Test filtering by revised grades.
98    And I click on "id_revisedonly" "checkbox"
99    And I press "Submit"
100    And the following should exist in the "gradereport_history" table:
101      | First name/Surname | Grade item                    | Original grade | Revised grade | Grader    |
102      | Student 1          | The greatest assignment ever  |                | 50.00         | Teacher 1 |
Note: See TracBrowser for help on using the repository browser.