Skip to content

Commit

Permalink
MDL-57019 behat: new step to navigate to gradebook section
Browse files Browse the repository at this point in the history
  • Loading branch information
marinaglancy committed Nov 24, 2016
1 parent 65f0ef9 commit b0842f6
Show file tree
Hide file tree
Showing 51 changed files with 347 additions and 354 deletions.
13 changes: 4 additions & 9 deletions admin/tool/behat/tests/behat/data_generators.feature
Expand Up @@ -325,7 +325,7 @@ Feature: Set up contextual data for tests
And I am on site homepage
And I follow "Courses"
And I follow "Course 1"
And I click on "Grades" "link" in the "Navigation" "block"
And I go to "View > Grader report" in the course gradebook
Then I should see "Grade category 1"
And I should see "Grade sub category 2"

Expand All @@ -349,9 +349,7 @@ Feature: Set up contextual data for tests
When I log in as "admin"
And I am on site homepage
And I follow "Course 1"
And I click on "Grades" "link" in the "Navigation" "block"
And I expand "Setup" node
And I follow "Gradebook setup"
And I go to "Setup > Gradebook setup" in the course gradebook
Then I should see "Test Grade Item 1"
And I follow "Edit Test Grade Item 1"
And I expand all fieldsets
Expand Down Expand Up @@ -380,8 +378,7 @@ Feature: Set up contextual data for tests
When I log in as "admin"
And I am on site homepage
And I follow "Course 1"
And I click on "Grades" "link" in the "Navigation" "block"
And I follow "Scales"
And I go to "Scales" in the course gradebook
Then I should see "Test Scale 1"
And I should see "Disappointing, Good, Very good, Excellent"

Expand Down Expand Up @@ -432,9 +429,7 @@ Feature: Set up contextual data for tests
When I log in as "admin"
And I am on site homepage
And I follow "Course 1"
And I click on "Grades" "link" in the "Navigation" "block"
And I expand "Setup" node
And I follow "Gradebook setup"
And I go to "Setup > Gradebook setup" in the course gradebook
Then I should see "Test Outcome Grade Item 1"
And I follow "Edit Test Outcome Grade Item 1"
And the field "Outcome" matches value "Grade outcome 1"
Expand Down
2 changes: 1 addition & 1 deletion admin/tool/recyclebin/tests/behat/backup_user_data.feature
Expand Up @@ -65,6 +65,6 @@ Feature: Backup user data
And I log out
And I log in as "student1"
And I follow "Course 1"
When I click on "Grades" "link" in the "Navigation" "block"
When I go to "User report" in the course gradebook
Then "Quiz 1" row "Grade" column of "user-grade" table should contain "5"
And "Quiz 1" row "Percentage" column of "user-grade" table should contain "50"
Expand Up @@ -50,7 +50,7 @@ Feature: The activity results block displays student scores
And I press "Save and return to course"
And I follow "Course 1"
And I should see "Test page name"
And I click on "Grades" "link" in the "Navigation" "block"
And I go to "View > Grader report" in the course gradebook
And I turn editing mode on
And I give the grade "90.00" to the user "Student 1" for the grade item "Test assignment 1"
And I give the grade "80.00" to the user "Student 2" for the grade item "Test assignment 1"
Expand Down
Expand Up @@ -32,7 +32,7 @@ Feature: The activity results block displays student scores
| Description | Offline text |
| assignsubmission_file_enabled | 0 |
And I follow "Course 1"
And I click on "Grades" "link" in the "Navigation" "block"
And I go to "View > Grader report" in the course gradebook
And I turn editing mode on
And I give the grade "90.00" to the user "Student 1" for the grade item "Test assignment"
And I give the grade "80.00" to the user "Student 2" for the grade item "Test assignment"
Expand Down
Expand Up @@ -26,8 +26,7 @@ Feature: The activity results block displays student scores as scales
| student5 | C1 | student |
And I log in as "teacher1"
And I follow "Course 1"
And I click on "Grades" "link" in the "Navigation" "block"
And I navigate to "Scales" node in "Grade administration"
And I go to "Scales" in the course gradebook
And I press "Add a new scale"
And I set the following fields to these values:
| Name | My Scale |
Expand All @@ -42,7 +41,7 @@ Feature: The activity results block displays student scores as scales
| id_grade_modgrade_type | Scale |
| id_grade_modgrade_scale | My Scale |
And I follow "Course 1"
And I click on "Grades" "link" in the "Navigation" "block"
And I go to "View > Grader report" in the course gradebook
And I turn editing mode on
And I give the grade "Excellent!" to the user "Student 1" for the grade item "Test assignment"
And I give the grade "Very good" to the user "Student 2" for the grade item "Test assignment"
Expand Down
Expand Up @@ -43,8 +43,7 @@ Feature: The activity results block displays student scores as scales
| student6 | G3 |
And I log in as "teacher1"
And I follow "Course 1"
And I click on "Grades" "link" in the "Navigation" "block"
And I navigate to "Scales" node in "Grade administration"
And I go to "Scales" in the course gradebook
And I press "Add a new scale"
And I set the following fields to these values:
| Name | My Scale |
Expand All @@ -60,7 +59,7 @@ Feature: The activity results block displays student scores as scales
| id_grade_modgrade_scale | My Scale |
| Group mode | Separate groups |
And I follow "Course 1"
And I click on "Grades" "link" in the "Navigation" "block"
And I go to "View > Grader report" in the course gradebook
And I turn editing mode on
And I give the grade "Excellent!" to the user "Student 1" for the grade item "Test assignment"
And I give the grade "Very good" to the user "Student 2" for the grade item "Test assignment"
Expand Down
Expand Up @@ -50,7 +50,7 @@ Feature: The activity results block displays student scores
| assignsubmission_file_enabled | 0 |
| Group mode | Separate groups |
And I follow "Course 1"
And I click on "Grades" "link" in the "Navigation" "block"
And I go to "View > Grader report" in the course gradebook
And I turn editing mode on
And I give the grade "100.00" to the user "Student 1" for the grade item "Test assignment"
And I give the grade "90.00" to the user "Student 2" for the grade item "Test assignment"
Expand Down
Expand Up @@ -50,7 +50,7 @@ Feature: The activity results block displays student scores
| assignsubmission_file_enabled | 0 |
| Group mode | Visible groups |
And I follow "Course 1"
And I click on "Grades" "link" in the "Navigation" "block"
And I go to "View > Grader report" in the course gradebook
And I turn editing mode on
And I give the grade "100.00" to the user "Student 1" for the grade item "Test assignment"
And I give the grade "90.00" to the user "Student 2" for the grade item "Test assignment"
Expand Down
Expand Up @@ -32,7 +32,7 @@ Feature: The activity results block displays student scores
| Description | Offline text |
| assignsubmission_file_enabled | 0 |
And I follow "Course 1"
And I click on "Grades" "link" in the "Navigation" "block"
And I go to "View > Grader report" in the course gradebook
And I turn editing mode on
And I give the grade "90.00" to the user "Student 1" for the grade item "Test assignment"
And I give the grade "80.00" to the user "Student 2" for the grade item "Test assignment"
Expand Down
Expand Up @@ -26,8 +26,7 @@ Feature: The activity results block displays student scores as scales
| student5 | C1 | student |
And I log in as "teacher1"
And I follow "Course 1"
And I click on "Grades" "link" in the "Navigation" "block"
And I navigate to "Scales" node in "Grade administration"
And I go to "Scales" in the course gradebook
And I press "Add a new scale"
And I set the following fields to these values:
| Name | My Scale |
Expand All @@ -42,7 +41,7 @@ Feature: The activity results block displays student scores as scales
| id_grade_modgrade_type | Scale |
| id_grade_modgrade_scale | My Scale |
And I follow "Course 1"
And I click on "Grades" "link" in the "Navigation" "block"
And I go to "View > Grader report" in the course gradebook
And I turn editing mode on
And I give the grade "Excellent!" to the user "Student 1" for the grade item "Test assignment"
And I give the grade "Very good" to the user "Student 2" for the grade item "Test assignment"
Expand Down
Expand Up @@ -43,8 +43,7 @@ Feature: The activity results block displays student scores as scales
| student6 | G3 |
And I log in as "teacher1"
And I follow "Course 1"
And I click on "Grades" "link" in the "Navigation" "block"
And I navigate to "Scales" node in "Grade administration"
And I go to "Scales" in the course gradebook
And I press "Add a new scale"
And I set the following fields to these values:
| Name | My Scale |
Expand All @@ -60,7 +59,7 @@ Feature: The activity results block displays student scores as scales
| id_grade_modgrade_scale | My Scale |
| Group mode | Separate groups |
And I follow "Course 1"
And I click on "Grades" "link" in the "Navigation" "block"
And I go to "View > Grader report" in the course gradebook
And I turn editing mode on
And I give the grade "Excellent!" to the user "Student 1" for the grade item "Test assignment"
And I give the grade "Very good" to the user "Student 2" for the grade item "Test assignment"
Expand Down
Expand Up @@ -50,7 +50,7 @@ Feature: The activity results block displays student scores
| assignsubmission_file_enabled | 0 |
| Group mode | Separate groups |
And I follow "Course 1"
And I click on "Grades" "link" in the "Navigation" "block"
And I go to "View > Grader report" in the course gradebook
And I turn editing mode on
And I give the grade "100.00" to the user "Student 1" for the grade item "Test assignment"
And I give the grade "90.00" to the user "Student 2" for the grade item "Test assignment"
Expand Down
Expand Up @@ -50,7 +50,7 @@ Feature: The activity results block displays student scores
| assignsubmission_file_enabled | 0 |
| Group mode | Visible groups |
And I follow "Course 1"
And I click on "Grades" "link" in the "Navigation" "block"
And I go to "View > Grader report" in the course gradebook
And I turn editing mode on
And I give the grade "100.00" to the user "Student 1" for the grade item "Test assignment"
And I give the grade "90.00" to the user "Student 2" for the grade item "Test assignment"
Expand Down
14 changes: 5 additions & 9 deletions grade/export/txt/tests/behat/export.feature
Expand Up @@ -22,15 +22,14 @@ Feature: I need to export grades as text
| assign | C1 | a2 | Test assignment name 2 | Submit your online text | 1 |
And I log in as "teacher1"
And I follow "Course 1"
And I click on "Grades" "link" in the "Navigation" "block"
And I go to "View > Grader report" in the course gradebook
And I turn editing mode on
And I give the grade "80.00" to the user "Student 1" for the grade item "Test assignment name"
And I press "Save changes"

@javascript
Scenario: Export grades as text
When I follow "Export"
And I follow "Plain text file"
When I go to "Export > Plain text file" in the course gradebook
And I expand all fieldsets
And I click on "Course total" "checkbox"
And I set the field "Grade export decimal points" to "1"
Expand All @@ -42,8 +41,7 @@ Feature: I need to export grades as text

@javascript
Scenario: Export grades as text using real
When I follow "Export"
And I follow "Plain text file"
When I go to "Export > Plain text file" in the course gradebook
And I expand all fieldsets
And I set the following fields to these values:
| Real | 1 |
Expand All @@ -54,8 +52,7 @@ Feature: I need to export grades as text

@javascript
Scenario: Export grades as text using percentages and letters
When I follow "Export"
And I follow "Plain text file"
When I go to "Export > Plain text file" in the course gradebook
And I set the following fields to these values:
| Percentage | 1 |
| Letter | 1 |
Expand All @@ -68,8 +65,7 @@ Feature: I need to export grades as text

@javascript
Scenario: Export grades as text using real, percentages and letters
When I follow "Export"
And I follow "Plain text file"
When I go to "Export > Plain text file" in the course gradebook
And I set the following fields to these values:
| Real | 1 |
| Percentage | 1 |
Expand Down
4 changes: 2 additions & 2 deletions grade/export/xml/tests/behat/export.feature
Expand Up @@ -21,14 +21,14 @@ Feature: I need to export grades as xml
| assign | C1 | a1 | Test assignment name | Submit something! |
And I log in as "teacher1"
And I follow "Course 1"
And I click on "Grades" "link" in the "Navigation" "block"
And I go to "View > Grader report" in the course gradebook
And I turn editing mode on
And I give the grade "80.00" to the user "Student 1" for the grade item "Test assignment name"
And I press "Save changes"

@javascript
Scenario: Export grades as text
When I navigate to "XML file" node in "Grade administration > Export"
When I go to "Export > XML file" in the course gradebook
And I expand all fieldsets
And I set the field "Grade export decimal points" to "1"
And I press "Download"
Expand Down
18 changes: 14 additions & 4 deletions grade/lib.php
Expand Up @@ -813,13 +813,23 @@ function grade_print_tabs($active_type, $active_plugin, $plugin_info, $return=fa
}
}

$tabs[] = $top_row;
$tabs[] = $bottom_row;
// Do not display rows that contain only one item, they are not helpful.
if (count($top_row) > 1) {
$tabs[] = $top_row;
}
if (count($bottom_row) > 1) {
$tabs[] = $bottom_row;
}
if (empty($tabs)) {
return;
}

$rv = html_writer::div(print_tabs($tabs, $active_plugin, $inactive, $activated, true), 'grade-navigation');

if ($return) {
return print_tabs($tabs, $active_plugin, $inactive, $activated, true);
return $rv;
} else {
print_tabs($tabs, $active_plugin, $inactive, $activated);
echo $rv;
}
}

Expand Down
16 changes: 9 additions & 7 deletions grade/report/grader/tests/behat/ajax_grader.feature
Expand Up @@ -55,7 +55,7 @@ Feature: Using the AJAX grading feature of Grader report to update grades and fe
| grade_report_showquickfeedback | 0 |
And I log in as "teacher1"
And I follow "Course 1"
And I click on "Grades" "link" in the "Navigation" "block"
And I go to "View > Grader report" in the course gradebook
And I click on student "Student 2" for grade item "Item VU"
Then I should see a grade field for "Student 2" and grade item "Item VU"
And I should not see a feedback field for "Student 2" and grade item "Item VU"
Expand Down Expand Up @@ -93,7 +93,7 @@ Feature: Using the AJAX grading feature of Grader report to update grades and fe
And the following should exist in the "user-grades" table:
| -1- | -16- |
| Student 1 | 90.00 |
And I navigate to "Grader report" node in "Grade administration"
And I go to "View > Grader report" in the course gradebook
And the following should exist in the "user-grades" table:
| -1- | -6- | -7- | -13- | -16- |
| Student 1 | - | - | - | 90.00 |
Expand All @@ -107,7 +107,7 @@ Feature: Using the AJAX grading feature of Grader report to update grades and fe
| grade_report_showquickfeedback | 1 |
And I log in as "teacher1"
And I follow "Course 1"
And I click on "Grades" "link" in the "Navigation" "block"
And I go to "View > Grader report" in the course gradebook
And I click on student "Student 2" for grade item "Item VU"
Then I should see a grade field for "Student 2" and grade item "Item VU"
And I should see a feedback field for "Student 2" and grade item "Item VU"
Expand All @@ -126,7 +126,9 @@ Feature: Using the AJAX grading feature of Grader report to update grades and fe
And I set the field "ajaxgrade" to "Very good"
And I set the field "ajaxfeedback" to "Student 2 SU feedback"
And I press key "13" in the field "ajaxfeedback"
And I navigate to "Grader report" node in "Grade administration"
# Reload grader report:
And I go to "View > User report" in the course gradebook
And I go to "View > Grader report" in the course gradebook
And the following should exist in the "user-grades" table:
| -1- | -7- | -13- | -16- |
| Student 2 | 33.00 | Very good | 36.00 |
Expand All @@ -142,7 +144,7 @@ Feature: Using the AJAX grading feature of Grader report to update grades and fe
| grade_report_showquickfeedback | 1 |
And I log in as "teacher1"
And I follow "Course 1"
And I click on "Grades" "link" in the "Navigation" "block"
And I go to "View > Grader report" in the course gradebook
And I click on student "Student 2" for grade item "Item VU"
Then I should see a grade field for "Student 2" and grade item "Item VU"
And I should see a feedback field for "Student 2" and grade item "Item VU"
Expand All @@ -162,7 +164,7 @@ Feature: Using the AJAX grading feature of Grader report to update grades and fe
| grade_report_showquickfeedback | 1 |
And I log in as "teacher1"
And I follow "Course 1"
And I click on "Grades" "link" in the "Navigation" "block"
And I go to "View > Grader report" in the course gradebook
And I turn editing mode on
Then I should not see a grade field for "Student 2" and grade item "Item VL"
And I should not see a feedback field for "Student 2" and grade item "Item VL"
Expand Down Expand Up @@ -193,7 +195,7 @@ Feature: Using the AJAX grading feature of Grader report to update grades and fe
| grade_report_showquickfeedback | 1 |
And I log in as "teacher1"
And I follow "Course 1"
And I click on "Grades" "link" in the "Navigation" "block"
And I go to "View > Grader report" in the course gradebook
And I turn editing mode on
And I change window size to "large"
And I set "=[[i1]] + [[i3]] + [[gsc]]" calculation for grade item "Calc Item" with idnumbers:
Expand Down
6 changes: 3 additions & 3 deletions grade/report/grader/tests/behat/switch_views.feature
Expand Up @@ -46,7 +46,7 @@ Feature: We can change what we are viewing on the grader report
And I log out
And I log in as "teacher1"
And I follow "Course 1"
And I click on "Grades" "link" in the "Navigation" "block"
And I go to "View > Grader report" in the course gradebook
And I turn editing mode on
And I give the grade "80.00" to the user "Student 1" for the grade item "Test assignment name 1"
And I give the grade "90.00" to the user "Student 1" for the grade item "Test assignment name 2"
Expand All @@ -60,7 +60,7 @@ Feature: We can change what we are viewing on the grader report
And I open "Test assignment name 2" actions menu
And I click on "Hide" "link" in the "Test assignment name 2" activity
And I follow "Course 1"
And I click on "Grades" "link" in the "Navigation" "block"
And I go to "View > Grader report" in the course gradebook
And I should see "Test assignment name 1"
And I should see "Test assignment name 2"
And I should see "Course total"
Expand Down Expand Up @@ -96,7 +96,7 @@ Feature: We can change what we are viewing on the grader report
And I log out
And I log in as "teacher1"
And I follow "Course 1"
And I click on "Grades" "link" in the "Navigation" "block"
And I go to "View > Grader report" in the course gradebook
And I should see "Test assignment name 1"
And I should see "Test assignment name 2"
And I should see "Course total"
Expand Down
4 changes: 2 additions & 2 deletions grade/report/history/tests/behat/basic_functionality.feature
Expand Up @@ -30,7 +30,7 @@ Feature: A teacher checks the grade history report in a course
And I add a "Assignment" to section "1" and I fill the form with:
| Assignment name | Rewarding assignment |
| Description | After writing your behat test go grab a beer! |
And I click on "Grades" "link" in the "Navigation" "block"
And I go to "View > Grader report" in the course gradebook
And I turn editing mode on
And I give the grade "50.00" to the user "Student 1" for the grade item "The greatest assignment ever"
And I give the grade "60.00" to the user "Student 1" for the grade item "Rewarding assignment"
Expand All @@ -40,7 +40,7 @@ Feature: A teacher checks the grade history report in a course
And I log out
And I log in as "teacher2"
And I follow "Course 1"
And I click on "Grades" "link" in the "Navigation" "block"
And I go to "View > Grader report" in the course gradebook
And I turn editing mode on
And I give the grade "70.00" to the user "Student 1" for the grade item "The greatest assignment ever"
And I give the grade "80.00" to the user "Student 1" for the grade item "Rewarding assignment"
Expand Down

0 comments on commit b0842f6

Please sign in to comment.