From 4c6b06ff3d84973f834ffd031bee34382957dab7 Mon Sep 17 00:00:00 2001 From: Angelia Dela Cruz Date: Wed, 12 Jul 2023 15:00:31 +0800 Subject: [PATCH] MDL-78684 Behat: Replace gradebook navigation to use page resolvers This commit also does other things such as: - Replace manual steps to setup gradebook by data generators - Added support for outcomes and scales page resolvers - Behat clean up --- .../behat/tests/behat/data_generators.feature | 34 +++-------- .../tests/behat/backup_user_data.feature | 5 +- .../tests/behat/addblockinactivity.feature | 47 +++++---------- .../behat/highscoreswithoutgroups.feature | 24 ++++---- .../tests/behat/highscoreswithscales.feature | 13 ++-- .../highscoreswithscalesandgroups.feature | 29 +++------ .../highscoreswithseperategroups.feature | 60 +++++++------------ .../behat/highscoreswithvisiblegroups.feature | 5 +- .../behat/lowscoreswithoutgroups.feature | 27 ++++----- .../tests/behat/lowscoreswithscales.feature | 13 ++-- .../lowscoreswithscalesandgroups.feature | 48 +++++++-------- .../behat/lowscoreswithseperategroups.feature | 55 ++++++----------- .../behat/lowscoreswithvisiblegroups.feature | 31 +++------- grade/export/txt/tests/behat/export.feature | 10 ++-- grade/export/xml/tests/behat/export.feature | 16 +++-- .../grader/tests/behat/switch_views.feature | 3 +- .../tests/behat/basic_functionality.feature | 15 ++--- .../singleview/tests/behat/singleview.feature | 14 ++--- .../report/user/tests/behat/user_view.feature | 4 +- .../user/tests/behat/view_usereport.feature | 8 +-- grade/tests/behat/behat_grades.php | 12 ++++ grade/tests/behat/grade_UI_settings.feature | 10 +--- grade/tests/behat/grade_aggregation.feature | 37 ++++-------- .../behat/grade_aggregation_changes.feature | 3 +- .../grade_calculated_grade_items.feature | 4 +- ...de_calculated_grade_items_20150627.feature | 4 +- .../behat/grade_calculated_weights.feature | 5 +- ...ade_contribution_with_extra_credit.feature | 8 +-- .../behat/grade_grade_minmax_change.feature | 7 +-- grade/tests/behat/grade_hidden_items.feature | 16 ++--- ...grade_hidden_items_locked_category.feature | 29 ++------- .../behat/grade_item_duplication.feature | 4 +- .../tests/behat/grade_item_validation.feature | 3 +- .../tests/behat/grade_letter_boundary.feature | 4 +- .../grade_letter_boundary_20160518.feature | 4 +- .../tests/behat/grade_letter_logging.feature | 4 +- grade/tests/behat/grade_mingrade.feature | 8 +-- grade/tests/behat/grade_minmax.feature | 8 +-- .../behat/grade_natural_exclude_empty.feature | 4 +- ...ade_natural_exclude_empty_20150619.feature | 4 +- .../behat/grade_natural_normalisation.feature | 4 +- ...ade_natural_normalisation_20150619.feature | 4 +- .../grade_regrade_do_not_override.feature | 7 +-- .../behat/grade_scales_aggregation.feature | 17 ++---- .../behat/grade_single_item_scales.feature | 4 +- grade/tests/behat/grade_view.feature | 5 +- .../tests/behat/outcome_grading.feature | 25 +++----- mod/assign/tests/behat/quickgrading.feature | 47 ++++----------- .../tests/behat/steps_blind_marking.feature | 10 +--- .../tests/behat/sending_attempt.feature | 4 +- .../tests/behat/user_grade_navigation.feature | 21 +++---- 51 files changed, 256 insertions(+), 531 deletions(-) diff --git a/admin/tool/behat/tests/behat/data_generators.feature b/admin/tool/behat/tests/behat/data_generators.feature index 9423a39d6d6..d1e9edc77d7 100644 --- a/admin/tool/behat/tests/behat/data_generators.feature +++ b/admin/tool/behat/tests/behat/data_generators.feature @@ -105,8 +105,7 @@ Feature: Set up contextual data for tests And the following "course enrolments" exist: | user | course | role | | student1 | C1 | student | - When I log in as "student1" - And I am on "Course 1" course homepage + When I am on the "Course 1" course page logged in as student1 Then I should see "Topic 1" Scenario: Add role assigns @@ -140,17 +139,11 @@ Feature: Set up contextual data for tests When I log in as "user1" And I am on site homepage Then "Edit settings" "link" should exist in current page administration - And I log out - And I log in as "user2" - And I am on "Course 1" course homepage + And I am on the "Course 1" course page logged in as user2 And "Turn editing on" "button" should exist - And I log out - And I log in as "user3" - And I am on "Course 1" course homepage + And I am on the "Course 1" course page logged in as user3 And "Turn editing on" "button" should exist - And I log out - And I log in as "user4" - And I am on "Course 1" course homepage + And I am on the "Course 1" course page logged in as user4 And "Turn editing on" "button" should exist And I log out And I log in as "user5" @@ -192,8 +185,7 @@ Feature: Set up contextual data for tests And the following "activities" exist: | activity | name | intro | course | idnumber | grade | | assign | Test assignment name with scale | Test assignment description | C1 | assign1 | Test Scale 1 | - When I log in as "admin" - And I am on "Course 1" course homepage + When I am on the "Course 1" course page logged in as admin Then I should see "Test assignment name" # Assignment 2.2 module type is disabled by default # And I should see "Test assignment22 name" @@ -311,9 +303,7 @@ Feature: Set up contextual data for tests And the following "grade categories" exist: | fullname | course | gradecategory | | Grade sub category 2 | C1 | Grade category 1 | - When I log in as "admin" - And I am on "Course 1" course homepage - And I navigate to "View > Grader report" in the course gradebook + When I am on the "Course 1" "grades > Grader report > View" page logged in as "admin" Then I should see "Grade category 1" And I should see "Grade sub category 2" @@ -334,9 +324,7 @@ Feature: Set up contextual data for tests | itemname | course | gradecategory | | Test Grade Item 2 | C1 | Grade category 1 | | Test Grade Item 3 | C1 | Grade sub category 2 | - When I log in as "admin" - And I am on "Course 1" course homepage - And I navigate to "Setup > Gradebook setup" in the course gradebook + When I am on the "Course 1" "grades > gradebook setup" page logged in as "admin" Then I should see "Test Grade Item 1" And I follow "Edit Test Grade Item 1" And I expand all fieldsets @@ -362,9 +350,7 @@ Feature: Set up contextual data for tests And the following "scales" exist: | name | scale | | Test Scale 1 | Disappointing, Good, Very good, Excellent | - When I log in as "admin" - And I am on "Course 1" course homepage - And I navigate to "Scales" in the course gradebook + When I am on the "Course 1" "grades > scales" page logged in as admin Then I should see "Test Scale 1" And I should see "Disappointing, Good, Very good, Excellent" @@ -383,9 +369,7 @@ Feature: Set up contextual data for tests | Grade outcome 2 | OT2 | C1 | Test Scale 1 | And the following config values are set as admin: | enableoutcomes | 1 | - When I log in as "admin" - And I am on "Course 1" course homepage - And I follow "Outcomes" + When I am on the "Course 1" "grades > outcomes" page logged in as admin Then I should see "Grade outcome 1" in the "#addoutcomes" "css_element" And I should see "Grade outcome 2" in the "#removeoutcomes" "css_element" And I follow "Edit outcomes" diff --git a/admin/tool/recyclebin/tests/behat/backup_user_data.feature b/admin/tool/recyclebin/tests/behat/backup_user_data.feature index 833845917b1..e0709b7dc78 100644 --- a/admin/tool/recyclebin/tests/behat/backup_user_data.feature +++ b/admin/tool/recyclebin/tests/behat/backup_user_data.feature @@ -59,9 +59,6 @@ Feature: Backup user data And I navigate to "Recycle bin" in current page administration And I should see "Quiz 1" And I click on "Restore" "link" in the "region-main" "region" - And I log out - And I log in as "student1" - And I am on "Course 1" course homepage - When I navigate to "User report" in the course gradebook + When I am on the "Course 1" "grades > User report > View" page logged in as "student1" 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" diff --git a/blocks/activity_results/tests/behat/addblockinactivity.feature b/blocks/activity_results/tests/behat/addblockinactivity.feature index 3191e13411d..75c0a11eb6d 100644 --- a/blocks/activity_results/tests/behat/addblockinactivity.feature +++ b/blocks/activity_results/tests/behat/addblockinactivity.feature @@ -24,40 +24,23 @@ Feature: The activity results block displays student scores | student3 | C1 | student | | student4 | C1 | student | | student5 | C1 | student | + And the following "activities" exist: + | activity | name | intro | course | section | idnumber | assignsubmission_file_enabled | + | assign | Test assignment 1 | Offline text | C1 | 1 | assign1 | 0 | + | assign | Test assignment 2 | Offline text | C1 | 1 | assign2 | 0 | + | assign | Test assignment 3 | Offline text | C1 | 1 | assign3 | 0 | + And the following "activities" exist: + | activity | name | content | course | section | idnumber | + | page | Test page name | This is a page | C1 | 1 | page1 | + And the following "grade grades" exist: + | gradeitem | user | grade | + | Test assignment 1 | student1 | 90.00 | + | Test assignment 1 | student2 | 80.00 | + | Test assignment 1 | student3 | 70.00 | + | Test assignment 1 | student4 | 60.00 | + | Test assignment 1 | student5 | 50.00 | And I log in as "teacher1" And I am on "Course 1" course homepage with editing mode on - And I add a "Assignment" to section "1" and I fill the form with: - | Assignment name | Test assignment 1 | - | Description | Offline text | - | assignsubmission_file_enabled | 0 | - And I am on "Course 1" course homepage - And I add a "Assignment" to section "1" and I fill the form with: - | Assignment name | Test assignment 2 | - | Description | Offline text | - | assignsubmission_file_enabled | 0 | - And I am on "Course 1" course homepage - And I add a "Assignment" to section "1" and I fill the form with: - | Assignment name | Test assignment 3 | - | Description | Offline text | - | assignsubmission_file_enabled | 0 | - And I am on "Course 1" course homepage - And I add a "Page" to section "1" - And I set the following fields to these values: - | Name | Test page name | - | Description | Test page description | - | Page content | This is a page | - And I press "Save and return to course" - And I am on "Course 1" course homepage - And I should see "Test page name" - And I navigate 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" - And I give the grade "70.00" to the user "Student 3" for the grade item "Test assignment 1" - And I give the grade "60.00" to the user "Student 4" for the grade item "Test assignment 1" - And I give the grade "50.00" to the user "Student 5" for the grade item "Test assignment 1" - And I press "Save changes" - And I am on "Course 1" course homepage Scenario: Configure the block on a non-graded activity to show 3 high scores Given I follow "Test page name" diff --git a/blocks/activity_results/tests/behat/highscoreswithoutgroups.feature b/blocks/activity_results/tests/behat/highscoreswithoutgroups.feature index 9a18affe494..3300e4131d9 100644 --- a/blocks/activity_results/tests/behat/highscoreswithoutgroups.feature +++ b/blocks/activity_results/tests/behat/highscoreswithoutgroups.feature @@ -24,22 +24,18 @@ Feature: The activity results block displays student high scores | student3 | C1 | student | | student4 | C1 | student | | student5 | C1 | student | + And the following "activities" exist: + | activity | name | intro | course | section | idnumber | assignsubmission_file_enabled | + | assign | Test assignment | Offline text | C1 | 1 | assign1 | 0 | + And the following "grade grades" exist: + | gradeitem | user | grade | + | Test assignment | student1 | 90.00 | + | Test assignment | student2 | 80.00 | + | Test assignment | student3 | 70.00 | + | Test assignment | student4 | 60.00 | + | Test assignment | student5 | 50.00 | And I log in as "teacher1" And I am on "Course 1" course homepage with editing mode on - And I add a "Assignment" to section "1" and I fill the form with: - | Assignment name | Test assignment | - | Description | Offline text | - | assignsubmission_file_enabled | 0 | - And I am on "Course 1" course homepage - And I navigate 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" - And I give the grade "70.00" to the user "Student 3" for the grade item "Test assignment" - And I give the grade "60.00" to the user "Student 4" for the grade item "Test assignment" - And I give the grade "50.00" to the user "Student 5" for the grade item "Test assignment" - And I press "Save changes" - And I am on "Course 1" course homepage Scenario: Configure the block on the course page to show 0 high scores Given I add the "Activity results" block diff --git a/blocks/activity_results/tests/behat/highscoreswithscales.feature b/blocks/activity_results/tests/behat/highscoreswithscales.feature index 76d5b2ac88d..2432968033a 100644 --- a/blocks/activity_results/tests/behat/highscoreswithscales.feature +++ b/blocks/activity_results/tests/behat/highscoreswithscales.feature @@ -24,14 +24,10 @@ Feature: The activity results block displays students high scores in group as sc | student3 | C1 | student | | student4 | C1 | student | | student5 | C1 | student | + And the following "scales" exist: + | name | scale | + | My Scale | Disappointing, Not good enough, Average, Good, Very good, Excellent! | And I log in as "teacher1" - And I am on "Course 1" course homepage - And I navigate 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 | - | Scale | Disappointing, Not good enough, Average, Good, Very good, Excellent! | - And I press "Save changes" And I am on "Course 1" course homepage with editing mode on And I add a "Assignment" to section "1" and I fill the form with: | Assignment name | Test assignment | @@ -39,8 +35,7 @@ Feature: The activity results block displays students high scores in group as sc | assignsubmission_file_enabled | 0 | | id_grade_modgrade_type | Scale | | id_grade_modgrade_scale | My Scale | - And I am on "Course 1" course homepage - And I navigate to "View > Grader report" in the course gradebook + And I am on the "Course 1" "grades > Grader report > View" page 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" diff --git a/blocks/activity_results/tests/behat/highscoreswithscalesandgroups.feature b/blocks/activity_results/tests/behat/highscoreswithscalesandgroups.feature index bb9cb706e06..d7ba375fe64 100644 --- a/blocks/activity_results/tests/behat/highscoreswithscalesandgroups.feature +++ b/blocks/activity_results/tests/behat/highscoreswithscalesandgroups.feature @@ -41,14 +41,10 @@ Feature: The activity results block displays student in group high scores as sca | student4 | G2 | | student5 | G3 | | student6 | G3 | + And the following "scales" exist: + | name | scale | + | My Scale | Disappointing, Not good enough, Average, Good, Very good, Excellent! | And I log in as "teacher1" - And I am on "Course 1" course homepage - And I navigate 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 | - | Scale | Disappointing, Not good enough, Average, Good, Very good, Excellent! | - And I press "Save changes" And I am on "Course 1" course homepage with editing mode on And I add a "Assignment" to section "1" and I fill the form with: | Assignment name | Test assignment | @@ -57,8 +53,7 @@ Feature: The activity results block displays student in group high scores as sca | id_grade_modgrade_type | Scale | | id_grade_modgrade_scale | My Scale | | Group mode | Separate groups | - And I am on "Course 1" course homepage - And I navigate to "View > Grader report" in the course gradebook + And I am on the "Course 1" "grades > Grader report > View" page 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" @@ -80,9 +75,7 @@ Feature: The activity results block displays student in group high scores as sca And I press "Save changes" Then I should see "Group 1" in the "Activity results" "block" And I should see "Excellent!" in the "Activity results" "block" - And I log out - And I log in as "student1" - And I am on "Course 1" course homepage + Then I am on the "Course 1" course page logged in as student1 And I should see "Student 1" in the "Activity results" "block" And I should see "Excellent!" in the "Activity results" "block" @@ -101,9 +94,7 @@ Feature: The activity results block displays student in group high scores as sca And I should see "Very good" in the "Activity results" "block" And I should see "Group 3" in the "Activity results" "block" And I should see "Good" in the "Activity results" "block" - And I log out - And I log in as "student3" - And I am on "Course 1" course homepage + And I am on the "Course 1" course page logged in as student3 And I should see "Student 3" in the "Activity results" "block" And I should see "Very good" in the "Activity results" "block" And I should see "Student 4" in the "Activity results" "block" @@ -124,10 +115,8 @@ Feature: The activity results block displays student in group high scores as sca And I should see "Excellent!" in the "Activity results" "block" And I should see "Very good" in the "Activity results" "block" And I should see "Good" in the "Activity results" "block" - And I log out # Students cannot see user identity fields. - And I log in as "student1" - And I am on "Course 1" course homepage + And I am on the "Course 1" course page logged in as student1 And I should see "User" in the "Activity results" "block" And I should not see "User S1" in the "Activity results" "block" And I should see "Excellent!" in the "Activity results" "block" @@ -147,9 +136,7 @@ Feature: The activity results block displays student in group high scores as sca And I should see "Excellent!" in the "Activity results" "block" And I should see "Very good" in the "Activity results" "block" And I should see "Good" in the "Activity results" "block" - And I log out - And I log in as "student1" - And I am on "Course 1" course homepage + And I am on the "Course 1" course page logged in as student1 And I should see "User" in the "Activity results" "block" And I should see "Excellent!" in the "Activity results" "block" And I should see "Very good" in the "Activity results" "block" diff --git a/blocks/activity_results/tests/behat/highscoreswithseperategroups.feature b/blocks/activity_results/tests/behat/highscoreswithseperategroups.feature index 754a6140ecd..f5f5bc341e6 100644 --- a/blocks/activity_results/tests/behat/highscoreswithseperategroups.feature +++ b/blocks/activity_results/tests/behat/highscoreswithseperategroups.feature @@ -41,24 +41,24 @@ Feature: The activity results block displays student in separate groups scores | student4 | G2 | | student5 | G3 | | student6 | G3 | + And the following "activity" exists: + | activity | assign | + | course | C1 | + | idnumber | 0001 | + | name | Test assignment | + | section | 1 | + | assignsubmission_file_enabled | 0 | + | groupmode | 1 | + And the following "grade grades" exist: + | gradeitem | user | grade | + | Test assignment | student1 | 100.00 | + | Test assignment | student2 | 90.00 | + | Test assignment | student3 | 90.00 | + | Test assignment | student4 | 80.00 | + | Test assignment | student5 | 80.00 | + | Test assignment | student6 | 70.00 | And I log in as "teacher1" And I am on "Course 1" course homepage with editing mode on - And I add a "Assignment" to section "1" and I fill the form with: - | Assignment name | Test assignment | - | Description | Offline text | - | assignsubmission_file_enabled | 0 | - | Group mode | Separate groups | - And I am on "Course 1" course homepage - And I navigate 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" - And I give the grade "90.00" to the user "Student 3" for the grade item "Test assignment" - And I give the grade "80.00" to the user "Student 4" for the grade item "Test assignment" - And I give the grade "80.00" to the user "Student 5" for the grade item "Test assignment" - And I give the grade "70.00" to the user "Student 6" for the grade item "Test assignment" - And I press "Save changes" - And I am on "Course 1" course homepage Scenario: Configure the block on the course page to show 1 high score Given I add the "Activity results" block @@ -86,9 +86,7 @@ Feature: The activity results block displays student in separate groups scores And I press "Save changes" Then I should see "Group 1" in the "Activity results" "block" And I should see "95.00/100.00" in the "Activity results" "block" - And I log out - And I log in as "student1" - And I am on "Course 1" course homepage + And I am on the "Course 1" course page logged in as student1 And I should see "Student 1" in the "Activity results" "block" And I should see "100.00/100.00" in the "Activity results" "block" @@ -104,9 +102,7 @@ Feature: The activity results block displays student in separate groups scores And I press "Save changes" Then I should see "Group 1" in the "Activity results" "block" And I should see "95.00" in the "Activity results" "block" - And I log out - And I log in as "student1" - And I am on "Course 1" course homepage + And I am on the "Course 1" course page logged in as student1 And I should see "Student 1" in the "Activity results" "block" And I should see "100.00" in the "Activity results" "block" @@ -127,9 +123,7 @@ Feature: The activity results block displays student in separate groups scores And I should see "85%" in the "Activity results" "block" And I should see "Group 3" in the "Activity results" "block" And I should see "75%" in the "Activity results" "block" - And I log out - And I log in as "student1" - And I am on "Course 1" course homepage + And I am on the "Course 1" course page logged in as student1 And I should see "Student 1" in the "Activity results" "block" And I should see "100%" in the "Activity results" "block" And I should see "Student 2" in the "Activity results" "block" @@ -151,9 +145,7 @@ Feature: The activity results block displays student in separate groups scores And I should see "85.00/100.00" in the "Activity results" "block" And I should see "Group 3" in the "Activity results" "block" And I should see "75.00/100.00" in the "Activity results" "block" - And I log out - And I log in as "student3" - And I am on "Course 1" course homepage + And I am on the "Course 1" course page logged in as student3 And I should see "Student 3" in the "Activity results" "block" And I should see "90.00/100.00" in the "Activity results" "block" And I should see "Student 4" in the "Activity results" "block" @@ -175,9 +167,7 @@ Feature: The activity results block displays student in separate groups scores And I should see "85.00" in the "Activity results" "block" And I should see "Group 3" in the "Activity results" "block" And I should see "75.00" in the "Activity results" "block" - And I log out - And I log in as "student1" - And I am on "Course 1" course homepage + And I am on the "Course 1" course page logged in as student1 And I should see "Student 1" in the "Activity results" "block" And I should see "100.00" in the "Activity results" "block" And I should see "Student 2" in the "Activity results" "block" @@ -199,10 +189,8 @@ Feature: The activity results block displays student in separate groups scores And I should see "95.00%" in the "Activity results" "block" And I should see "85.00%" in the "Activity results" "block" And I should see "75.00%" in the "Activity results" "block" - And I log out # Students cannot see user identity fields. - And I log in as "student1" - And I am on "Course 1" course homepage + And I am on the "Course 1" course page logged in as student1 And I should see "User" in the "Activity results" "block" And I should not see "User S1" in the "Activity results" "block" And I should see "100.00%" in the "Activity results" "block" @@ -223,9 +211,7 @@ Feature: The activity results block displays student in separate groups scores And I should see "95.00%" in the "Activity results" "block" And I should see "85.00%" in the "Activity results" "block" And I should see "75.00%" in the "Activity results" "block" - And I log out - And I log in as "student1" - And I am on "Course 1" course homepage + And I am on the "Course 1" course page logged in as student1 And I should see "User" in the "Activity results" "block" And I should see "100.00%" in the "Activity results" "block" And I should see "90.00%" in the "Activity results" "block" diff --git a/blocks/activity_results/tests/behat/highscoreswithvisiblegroups.feature b/blocks/activity_results/tests/behat/highscoreswithvisiblegroups.feature index 3eca15e95e6..9fee7f0fb96 100644 --- a/blocks/activity_results/tests/behat/highscoreswithvisiblegroups.feature +++ b/blocks/activity_results/tests/behat/highscoreswithvisiblegroups.feature @@ -48,8 +48,7 @@ Feature: The activity results block displays student in visible groups scores | Description | Offline text | | assignsubmission_file_enabled | 0 | | Group mode | Visible groups | - And I am on "Course 1" course homepage - And I navigate to "View > Grader report" in the course gradebook + And I am on the "Course 1" "grades > Grader report > View" page logged in as teacher1 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" @@ -58,7 +57,7 @@ Feature: The activity results block displays student in visible groups scores And I give the grade "80.00" to the user "Student 5" for the grade item "Test assignment" And I give the grade "70.00" to the user "Student 6" for the grade item "Test assignment" And I press "Save changes" - And I am on "Course 1" course homepage + And I am on "Course 1" course homepage with editing mode on Scenario: Configure the block on the course page to show 1 high score Given I add the "Activity results" block diff --git a/blocks/activity_results/tests/behat/lowscoreswithoutgroups.feature b/blocks/activity_results/tests/behat/lowscoreswithoutgroups.feature index 6c24497b142..d613239428c 100644 --- a/blocks/activity_results/tests/behat/lowscoreswithoutgroups.feature +++ b/blocks/activity_results/tests/behat/lowscoreswithoutgroups.feature @@ -24,22 +24,21 @@ Feature: The activity results block displays student low scores | student3 | C1 | student | | student4 | C1 | student | | student5 | C1 | student | + And the following "activity" exists: + | activity | assign | + | course | C1 | + | idnumber | 0001 | + | name | Test assignment | + | assignsubmission_file_enabled | 0 | + And the following "grade grades" exist: + | gradeitem | user | grade | + | Test assignment | student1 | 90.00 | + | Test assignment | student2 | 80.00 | + | Test assignment | student3 | 70.00 | + | Test assignment | student4 | 60.00 | + | Test assignment | student5 | 50.00 | And I log in as "teacher1" And I am on "Course 1" course homepage with editing mode on - And I add a "Assignment" to section "1" and I fill the form with: - | Assignment name | Test assignment | - | Description | Offline text | - | assignsubmission_file_enabled | 0 | - And I am on "Course 1" course homepage - And I navigate 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" - And I give the grade "70.00" to the user "Student 3" for the grade item "Test assignment" - And I give the grade "60.00" to the user "Student 4" for the grade item "Test assignment" - And I give the grade "50.00" to the user "Student 5" for the grade item "Test assignment" - And I press "Save changes" - And I am on "Course 1" course homepage Scenario: Configure the block on the course page to show 1 low score Given I add the "Activity results" block diff --git a/blocks/activity_results/tests/behat/lowscoreswithscales.feature b/blocks/activity_results/tests/behat/lowscoreswithscales.feature index e4880575f3b..7f26c95dbf6 100644 --- a/blocks/activity_results/tests/behat/lowscoreswithscales.feature +++ b/blocks/activity_results/tests/behat/lowscoreswithscales.feature @@ -24,14 +24,10 @@ Feature: The activity results block displays student low scores as scales | student3 | C1 | student | | student4 | C1 | student | | student5 | C1 | student | + And the following "scales" exist: + | name | scale | + | My Scale | Disappointing, Not good enough, Average, Good, Very good, Excellent! | And I log in as "teacher1" - And I am on "Course 1" course homepage - And I navigate 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 | - | Scale | Disappointing, Not good enough, Average, Good, Very good, Excellent! | - And I press "Save changes" And I am on "Course 1" course homepage with editing mode on And I add a "Assignment" to section "1" and I fill the form with: | Assignment name | Test assignment | @@ -39,8 +35,7 @@ Feature: The activity results block displays student low scores as scales | assignsubmission_file_enabled | 0 | | id_grade_modgrade_type | Scale | | id_grade_modgrade_scale | My Scale | - And I am on "Course 1" course homepage - And I navigate to "View > Grader report" in the course gradebook + And I am on the "Course 1" "grades > Grader report > View" page 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" diff --git a/blocks/activity_results/tests/behat/lowscoreswithscalesandgroups.feature b/blocks/activity_results/tests/behat/lowscoreswithscalesandgroups.feature index a1e378a85dd..a8f3af359ea 100644 --- a/blocks/activity_results/tests/behat/lowscoreswithscalesandgroups.feature +++ b/blocks/activity_results/tests/behat/lowscoreswithscalesandgroups.feature @@ -41,24 +41,24 @@ Feature: The activity results block displays students in groups low scores as sc | student4 | G2 | | student5 | G3 | | student6 | G3 | - And I log in as "teacher1" - And I am on "Course 1" course homepage - And I navigate to "Scales" in the course gradebook - And I press "Add a new scale" + And the following "activity" exists: + | activity | assign | + | course | C1 | + | idnumber | 0001 | + | name | Test assignment | + | description | Offline text | + | assignsubmission_file_enabled | 0 | + | groupmode | 1 | + And the following "scales" exist: + | name | scale | + | My Scale | Disappointing, Not good enough, Average, Good, Very good, Excellent! | + And I change window size to "large" + And I am on the "Test assignment" "assign activity editing" page logged in as teacher1 And I set the following fields to these values: - | Name | My Scale | - | Scale | Disappointing, Not good enough, Average, Good, Very good, Excellent! | - And I press "Save changes" - And I am on "Course 1" course homepage with editing mode on - And I add a "Assignment" to section "1" and I fill the form with: - | Assignment name | Test assignment | - | Description | Offline text | - | assignsubmission_file_enabled | 0 | | id_grade_modgrade_type | Scale | | id_grade_modgrade_scale | My Scale | - | Group mode | Separate groups | - And I am on "Course 1" course homepage - And I navigate to "View > Grader report" in the course gradebook + And I press "Save and return to course" + And I am on the "Course 1" "grades > Grader report > View" page 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" @@ -67,7 +67,7 @@ Feature: The activity results block displays students in groups low scores as sc And I give the grade "Good" to the user "Student 5" for the grade item "Test assignment" And I give the grade "Average" to the user "Student 6" for the grade item "Test assignment" And I press "Save changes" - And I am on "Course 1" course homepage + And I am on "Course 1" course homepage with editing mode on Scenario: Try to configure the block on the course page to show 1 low score Given I add the "Activity results" block @@ -80,9 +80,7 @@ Feature: The activity results block displays students in groups low scores as sc And I press "Save changes" Then I should see "Group 3" in the "Activity results" "block" And I should see "Good" in the "Activity results" "block" - And I log out - And I log in as "student5" - And I am on "Course 1" course homepage + And I am on the "Course 1" course page logged in as student5 And I should see "Student 6" in the "Activity results" "block" And I should see "Average" in the "Activity results" "block" @@ -99,9 +97,7 @@ Feature: The activity results block displays students in groups low scores as sc And I should see "Very good" in the "Activity results" "block" And I should see "Group 3" in the "Activity results" "block" And I should see "Good" in the "Activity results" "block" - And I log out - And I log in as "student3" - And I am on "Course 1" course homepage + And I am on the "Course 1" course page logged in as student3 And I should see "Student 3" in the "Activity results" "block" And I should see "Very good" in the "Activity results" "block" And I should see "Student 4" in the "Activity results" "block" @@ -121,10 +117,8 @@ Feature: The activity results block displays students in groups low scores as sc Then I should see "Group" in the "Activity results" "block" And I should see "Very good" in the "Activity results" "block" And I should see "Good" in the "Activity results" "block" - And I log out # Students cannot see user identity fields. - And I log in as "student5" - And I am on "Course 1" course homepage + And I am on the "Course 1" course page logged in as student5 And I should see "User" in the "Activity results" "block" And I should not see "User S5" in the "Activity results" "block" And I should see "Good" in the "Activity results" "block" @@ -143,9 +137,7 @@ Feature: The activity results block displays students in groups low scores as sc Then I should see "Group" in the "Activity results" "block" And I should see "Very good" in the "Activity results" "block" And I should see "Good" in the "Activity results" "block" - And I log out - And I log in as "student5" - And I am on "Course 1" course homepage + And I am on the "Course 1" course page logged in as student5 And I should see "User" in the "Activity results" "block" And I should see "Good" in the "Activity results" "block" And I should see "Average" in the "Activity results" "block" diff --git a/blocks/activity_results/tests/behat/lowscoreswithseperategroups.feature b/blocks/activity_results/tests/behat/lowscoreswithseperategroups.feature index 5575855345c..9f8753c48cc 100644 --- a/blocks/activity_results/tests/behat/lowscoreswithseperategroups.feature +++ b/blocks/activity_results/tests/behat/lowscoreswithseperategroups.feature @@ -41,24 +41,19 @@ Feature: The activity results block displays students in separate groups scores | student4 | G2 | | student5 | G3 | | student6 | G3 | + And the following "activities" exist: + | activity | course | idnumber | name | assignsubmission_file_enabled | groupmode | + | assign | C1 | a1 | Test assignment | 0 | 1 | + And the following "grade grades" exist: + | gradeitem | user | grade | + | Test assignment | student1 | 100.00 | + | Test assignment | student2 | 90.00 | + | Test assignment | student3 | 90.00 | + | Test assignment | student4 | 80.00 | + | Test assignment | student5 | 80.00 | + | Test assignment | student6 | 70.00 | And I log in as "teacher1" And I am on "Course 1" course homepage with editing mode on - And I add a "Assignment" to section "1" and I fill the form with: - | Assignment name | Test assignment | - | Description | Offline text | - | assignsubmission_file_enabled | 0 | - | Group mode | Separate groups | - And I am on "Course 1" course homepage - And I navigate 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" - And I give the grade "90.00" to the user "Student 3" for the grade item "Test assignment" - And I give the grade "80.00" to the user "Student 4" for the grade item "Test assignment" - And I give the grade "80.00" to the user "Student 5" for the grade item "Test assignment" - And I give the grade "70.00" to the user "Student 6" for the grade item "Test assignment" - And I press "Save changes" - And I am on "Course 1" course homepage Scenario: Configure the block on the course page to show 1 low score Given I add the "Activity results" block @@ -86,9 +81,7 @@ Feature: The activity results block displays students in separate groups scores And I press "Save changes" Then I should see "Group 3" in the "Activity results" "block" And I should see "75.00/100.00" in the "Activity results" "block" - And I log out - And I log in as "student5" - And I am on "Course 1" course homepage + And I am on the "Course 1" course page logged in as student5 And I should see "Student 6" in the "Activity results" "block" And I should see "70.00/100.00" in the "Activity results" "block" @@ -104,9 +97,7 @@ Feature: The activity results block displays students in separate groups scores And I press "Save changes" Then I should see "Group 3" in the "Activity results" "block" And I should see "75.00" in the "Activity results" "block" - And I log out - And I log in as "student5" - And I am on "Course 1" course homepage + And I am on the "Course 1" course page logged in as student5 And I should see "Student 6" in the "Activity results" "block" And I should see "70.00" in the "Activity results" "block" @@ -125,9 +116,7 @@ Feature: The activity results block displays students in separate groups scores And I should see "85%" in the "Activity results" "block" And I should see "Group 3" in the "Activity results" "block" And I should see "75%" in the "Activity results" "block" - And I log out - And I log in as "student5" - And I am on "Course 1" course homepage + And I am on the "Course 1" course page logged in as student5 And I should see "Student 6" in the "Activity results" "block" And I should see "70%" in the "Activity results" "block" And I should see "Student 5" in the "Activity results" "block" @@ -147,9 +136,7 @@ Feature: The activity results block displays students in separate groups scores And I should see "85.00/100.00" in the "Activity results" "block" And I should see "Group 3" in the "Activity results" "block" And I should see "75.00/100.00" in the "Activity results" "block" - And I log out - And I log in as "student3" - And I am on "Course 1" course homepage + And I am on the "Course 1" course page logged in as student3 And I should see "Student 3" in the "Activity results" "block" And I should see "90.00/100.00" in the "Activity results" "block" And I should see "Student 4" in the "Activity results" "block" @@ -169,9 +156,7 @@ Feature: The activity results block displays students in separate groups scores And I should see "85.00" in the "Activity results" "block" And I should see "Group 3" in the "Activity results" "block" And I should see "75.00" in the "Activity results" "block" - And I log out - And I log in as "student5" - And I am on "Course 1" course homepage + And I am on the "Course 1" course page logged in as student5 And I should see "Student 5" in the "Activity results" "block" And I should see "80.00" in the "Activity results" "block" And I should see "Student 6" in the "Activity results" "block" @@ -192,10 +177,8 @@ Feature: The activity results block displays students in separate groups scores Then I should see "Group" in the "Activity results" "block" And I should see "85.00%" in the "Activity results" "block" And I should see "75.00%" in the "Activity results" "block" - And I log out # Students cannot see user identity fields. - And I log in as "student1" - And I am on "Course 1" course homepage + And I am on the "Course 1" course page logged in as student1 And I should see "User" in the "Activity results" "block" And I should not see "User S1" in the "Activity results" "block" And I should see "100.00%" in the "Activity results" "block" @@ -215,9 +198,7 @@ Feature: The activity results block displays students in separate groups scores Then I should see "Group" in the "Activity results" "block" And I should see "85.00%" in the "Activity results" "block" And I should see "75.00%" in the "Activity results" "block" - And I log out - And I log in as "student1" - And I am on "Course 1" course homepage + And I am on the "Course 1" course page logged in as student1 And I should see "User" in the "Activity results" "block" And I should see "100.00%" in the "Activity results" "block" And I should see "90.00%" in the "Activity results" "block" diff --git a/blocks/activity_results/tests/behat/lowscoreswithvisiblegroups.feature b/blocks/activity_results/tests/behat/lowscoreswithvisiblegroups.feature index ee5cb5e22d1..298025e3e6a 100644 --- a/blocks/activity_results/tests/behat/lowscoreswithvisiblegroups.feature +++ b/blocks/activity_results/tests/behat/lowscoreswithvisiblegroups.feature @@ -48,8 +48,7 @@ Feature: The activity results block displays student in visible groups low score | Description | Offline text | | assignsubmission_file_enabled | 0 | | Group mode | Visible groups | - And I am on "Course 1" course homepage - And I navigate to "View > Grader report" in the course gradebook + And I am on the "Course 1" "grades > grader report > View" page 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" @@ -84,9 +83,7 @@ Feature: The activity results block displays student in visible groups low score | id_config_nameformat | Display full names | | id_config_usegroups | Yes | And I press "Save changes" - And I log out - Then I log in as "student1" - And I am on "Course 1" course homepage + Then I am on the "Course 1" course page logged in as student1 And I should see "Group 3" in the "Activity results" "block" And I should see "75.00/100.00" in the "Activity results" "block" @@ -100,9 +97,7 @@ Feature: The activity results block displays student in visible groups low score | id_config_nameformat | Display full names | | id_config_usegroups | Yes | And I press "Save changes" - And I log out - Then I log in as "student1" - And I am on "Course 1" course homepage + Then I am on the "Course 1" course page logged in as student1 And I should see "Group 3" in the "Activity results" "block" And I should see "75.00" in the "Activity results" "block" @@ -121,9 +116,7 @@ Feature: The activity results block displays student in visible groups low score And I should see "85%" in the "Activity results" "block" And I should see "Group 3" in the "Activity results" "block" And I should see "75%" in the "Activity results" "block" - And I log out - And I log in as "student5" - And I am on "Course 1" course homepage + And I am on the "Course 1" course page logged in as student5 Then I should see "Group 2" in the "Activity results" "block" And I should see "85%" in the "Activity results" "block" And I should see "Group 3" in the "Activity results" "block" @@ -139,9 +132,7 @@ Feature: The activity results block displays student in visible groups low score | id_config_nameformat | Display full names | | id_config_usegroups | Yes | And I press "Save changes" - And I log out - Then I log in as "student1" - And I am on "Course 1" course homepage + Then I am on the "Course 1" course page logged in as student1 And I should see "Group 2" in the "Activity results" "block" And I should see "85.00/100.00" in the "Activity results" "block" And I should see "Group 3" in the "Activity results" "block" @@ -157,9 +148,7 @@ Feature: The activity results block displays student in visible groups low score | id_config_nameformat | Display full names | | id_config_usegroups | Yes | And I press "Save changes" - And I log out - Then I log in as "student1" - And I am on "Course 1" course homepage + Then I am on the "Course 1" course page logged in as student1 And I should see "Group 2" in the "Activity results" "block" And I should see "85.00" in the "Activity results" "block" And I should see "Group 3" in the "Activity results" "block" @@ -177,9 +166,7 @@ Feature: The activity results block displays student in visible groups low score | id_config_nameformat | Display only ID numbers | | id_config_usegroups | Yes | And I press "Save changes" - And I log out - Then I log in as "student1" - And I am on "Course 1" course homepage + Then I am on the "Course 1" course page logged in as student1 And I should see "Group" in the "Activity results" "block" And I should see "85.00%" in the "Activity results" "block" And I should see "75.00%" in the "Activity results" "block" @@ -194,9 +181,7 @@ Feature: The activity results block displays student in visible groups low score | id_config_nameformat | Anonymous results | | id_config_usegroups | Yes | And I press "Save changes" - And I log out - Then I log in as "student1" - And I am on "Course 1" course homepage + Then I am on the "Course 1" course page logged in as student1 And I should see "Group" in the "Activity results" "block" And I should see "85.00%" in the "Activity results" "block" And I should see "75.00%" in the "Activity results" "block" diff --git a/grade/export/txt/tests/behat/export.feature b/grade/export/txt/tests/behat/export.feature index 5fee9485885..dc25c2e37ac 100644 --- a/grade/export/txt/tests/behat/export.feature +++ b/grade/export/txt/tests/behat/export.feature @@ -20,12 +20,10 @@ Feature: I need to export grades as text | activity | course | idnumber | name | intro | assignsubmission_onlinetext_enabled | | assign | C1 | a1 | Test assignment name | Submit your online text | 1 | | assign | C1 | a2 | Test assignment name 2 | Submit your online text | 1 | - And I log in as "teacher1" - And I am on "Course 1" course homepage - And I navigate 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" + And the following "grade grades" exist: + | gradeitem | user | grade | + | Test assignment name | student1 | 80.00 | + And I am on the "Course 1" course page logged in as teacher1 @javascript Scenario: Export grades as text diff --git a/grade/export/xml/tests/behat/export.feature b/grade/export/xml/tests/behat/export.feature index c9515c8af17..c971b6f4c58 100644 --- a/grade/export/xml/tests/behat/export.feature +++ b/grade/export/xml/tests/behat/export.feature @@ -19,15 +19,13 @@ Feature: I need to export grades as xml | student1 | C1 | student | | student2 | C1 | student | And the following "activities" exist: - | activity | course | idnumber | name | intro | - | assign | C1 | a1 | Test assignment name | Submit something! | - And I log in as "teacher1" - And I am on "Course 1" course homepage - And I navigate 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 give the grade "42.00" to the user "Student 2" for the grade item "Test assignment name" - And I press "Save changes" + | activity | course | idnumber | name | + | assign | C1 | a1 | Test assignment name | + And the following "grade grades" exist: + | gradeitem | user | grade | + | Test assignment name | student1 | 80.00 | + | Test assignment name | student2 | 42.00 | + And I am on the "Course 1" course page logged in as teacher1 @javascript Scenario: Export grades as XML diff --git a/grade/report/grader/tests/behat/switch_views.feature b/grade/report/grader/tests/behat/switch_views.feature index 7e307d311a3..665d6a7b3ba 100644 --- a/grade/report/grader/tests/behat/switch_views.feature +++ b/grade/report/grader/tests/behat/switch_views.feature @@ -75,8 +75,7 @@ Feature: We can change what we are viewing on the grader report And the following "role capability" exists: | role | editingteacher | | moodle/grade:viewhidden | prevent | - And I am on the "C1" "course" page logged in as "teacher1" - And I navigate to "View > Grader report" in the course gradebook + And I am on the "Course 1" "grades > Grader report > View" page logged in as "teacher1" Then I should see "Test assignment name 1" in the "user-grades" "table" And I should see "Test assignment name 2" in the "user-grades" "table" And I should see "Manual grade" diff --git a/grade/report/history/tests/behat/basic_functionality.feature b/grade/report/history/tests/behat/basic_functionality.feature index bb5ecbc0b5c..e8c04c10e71 100644 --- a/grade/report/history/tests/behat/basic_functionality.feature +++ b/grade/report/history/tests/behat/basic_functionality.feature @@ -22,22 +22,17 @@ Feature: A teacher checks the grade history report in a course | student1 | C1 | student | | student2 | C1 | student | And the following "activities" exist: - | activity | course | section | name | intro | - | assign | C1 | 1 | The greatest assignment ever | Write a behat test for Moodle - it's amazing | - | assign | C1 | 1 | Rewarding assignment | After writing your behat test go grab a beer! | - And I log in as "teacher1" - And I am on "Course 1" course homepage with editing mode on - And I navigate to "View > Grader report" in the course gradebook + | activity | course | name | + | assign | C1 | The greatest assignment ever | + | assign | C1 | Rewarding assignment | + And I am on the "Course 1" "grades > Grader report > View" page logged in as "teacher1" 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" And I give the grade "50.00" to the user "Student 2" for the grade item "The greatest assignment ever" And I give the grade "60.00" to the user "Student 2" for the grade item "Rewarding assignment" And I press "Save changes" - And I log out - And I log in as "teacher2" - And I am on "Course 1" course homepage - And I navigate to "View > Grader report" in the course gradebook + And I am on the "Course 1" "grades > Grader report > View" page logged in as "teacher2" 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" diff --git a/grade/report/singleview/tests/behat/singleview.feature b/grade/report/singleview/tests/behat/singleview.feature index b04c8a72e8c..e45975e3013 100644 --- a/grade/report/singleview/tests/behat/singleview.feature +++ b/grade/report/singleview/tests/behat/singleview.feature @@ -1,4 +1,4 @@ -@core @core_grades @gradereport_singleview +@core @core_grades @gradereport_singleview @javascript Feature: We can use Single view As a teacher In order to view and edit grades @@ -7,7 +7,7 @@ Feature: We can use Single view Background: Given the following "courses" exist: | fullname | shortname | category | - | Course 1 | C1 | 0 | + | Course 1 | C1 | 0 | And the following "users" exist: | username | firstname | lastname | email | idnumber | middlename | alternatename | firstnamephonetic | lastnamephonetic | | teacher1 | Teacher | 1 | teacher1@example.com | t1 | | fred | | | @@ -53,11 +53,8 @@ Feature: We can use Single view And the following config values are set as admin: | fullnamedisplay | firstnamephonetic,lastnamephonetic | | alternativefullnameformat | middlename, alternatename, firstname, lastname | - And I log in as "teacher1" - And I am on "Course 1" course homepage - Given I navigate to "View > Grader report" in the course gradebook + And I am on the "Course 1" "grades > Grader report > View" page logged in as "teacher1" - @javascript Scenario: I can update grades, add feedback and exclude grades. Given I navigate to "View > Single view" in the course gradebook And I select "Student" from the "Select user..." singleselect @@ -97,10 +94,7 @@ Feature: We can use Single view And the following should exist in the "generaltable" table: | First name (Alternate name) Surname | Grade | | Ann, Jill, Grainne, Beauchamp | Very good | - And I log out - And I log in as "teacher2" - And I am on "Course 1" course homepage - Given I navigate to "View > Single view" in the course gradebook + And I am on the "Course 1" "grades > Single view > View" page logged in as "teacher2" And I select "Student" from the "Select user..." singleselect And the "Exclude for Test assignment one" "checkbox" should be disabled And the "Override for Test assignment one" "checkbox" should be enabled diff --git a/grade/report/user/tests/behat/user_view.feature b/grade/report/user/tests/behat/user_view.feature index 5a8f4f7ed4e..ecbe4129316 100644 --- a/grade/report/user/tests/behat/user_view.feature +++ b/grade/report/user/tests/behat/user_view.feature @@ -30,9 +30,7 @@ Feature: View the user report as the student will see it | activity | course | idnumber | name | intro | grade | | assign | C1 | a5 | Test assignment five | Submit something! | 100 | | assign | C1 | a6 | Test assignment six | Submit something! | 100 | - And I log in as "teacher1" - And I am on "Course 1" course homepage - And I navigate to "Setup > Gradebook setup" in the course gradebook + When I am on the "C1" "grades > gradebook setup" page logged in as "teacher1" And I hide the grade item "Test assignment six" And I hide the grade item "Sub category 2" And I navigate to "View > Grader report" in the course gradebook diff --git a/grade/report/user/tests/behat/view_usereport.feature b/grade/report/user/tests/behat/view_usereport.feature index 854b76ae500..e97e70d3b93 100644 --- a/grade/report/user/tests/behat/view_usereport.feature +++ b/grade/report/user/tests/behat/view_usereport.feature @@ -5,12 +5,10 @@ Feature: We can use the user report Background: Given the following "courses" exist: - | fullname | shortname | category | - | Course 1 | C1 | 0 | + | fullname | shortname | category | groupmode | + | Course 1 | C1 | 0 | 1 | Scenario: Verify we can view a user grade report with no users enrolled. - Given I log in as "admin" - And I am on "Course 1" course homepage - And I navigate to "View > User report" in the course gradebook + When I am on the "Course 1" "grades > User report > View" page logged in as "admin" And I select "All users (0)" from the "Select all or one user" singleselect Then I should see "There are no students enrolled in this course." diff --git a/grade/tests/behat/behat_grades.php b/grade/tests/behat/behat_grades.php index e9958eceeb1..22079cb3f6e 100644 --- a/grade/tests/behat/behat_grades.php +++ b/grade/tests/behat/behat_grades.php @@ -35,6 +35,8 @@ class behat_grades extends behat_base { * | [report] view | Course name | The view page for the specified course and report | * | gradebook setup | Course name | The gradebook setup page for the specified course | * | course grade settings | Course name | The grade settings page | + * | outcomes | Course name | The grade outcomes page | + * | scales | Course name | The grade scales page | * * @param string $type identifies which type of page this is - for example "Grader > View" * @param string $identifier identifies the particular page - for example "Course name" @@ -86,6 +88,16 @@ class behat_grades extends behat_base { "/grade/edit/settings/index.php", ['id' => $this->get_course_id($identifier)] ); + case 'outcomes': + return new moodle_url( + "/grade/edit/outcome/course.php", + ['id' => $this->get_course_id($identifier)] + ); + case 'scales': + return new moodle_url( + "/grade/edit/scale/index.php", + ['id' => $this->get_course_id($identifier)] + ); default: throw new \coding_exception( "Unknown page type '$type' for page identifier '$identifier'" diff --git a/grade/tests/behat/grade_UI_settings.feature b/grade/tests/behat/grade_UI_settings.feature index e609e75e828..a5a9f116a3e 100644 --- a/grade/tests/behat/grade_UI_settings.feature +++ b/grade/tests/behat/grade_UI_settings.feature @@ -17,9 +17,7 @@ Feature: Site settings can be used to hide parts of the gradebook UI And the following "activities" exist: | activity | course | idnumber | name | intro | | assign | C1 | assign1 | Assignment1 | Assignment 1 intro | - And I log in as "admin" - And I am on "Course 1" course homepage - And I navigate to "View > Grader report" in the course gradebook + And I am on the "Course 1" "grades > Grader report > View" page logged in as "admin" And I turn editing mode on @javascript @@ -29,8 +27,7 @@ Feature: Site settings can be used to hide parts of the gradebook UI Then I navigate to "Grades > General settings" in site administration And I set the field "Show minimum grade" to "0" And I press "Save changes" - And I am on "Course 1" course homepage - And I navigate to "View > Grader report" in the course gradebook + And I am on the "Course 1" "grades > Grader report > View" page And I click on "Edit assign Assignment1" "link" And I should not see "Minimum grade" @@ -50,6 +47,5 @@ Feature: Site settings can be used to hide parts of the gradebook UI Then I navigate to "Grades > Grade category settings" in site administration And I set the field "Allow category grades to be manually overridden" to "0" And I press "Save changes" - And I am on "Course 1" course homepage - And I navigate to "View > Grader report" in the course gradebook + And I am on the "Course 1" "grades > Grader report > View" page And "tr .course input[type='text']" "css_element" should not exist diff --git a/grade/tests/behat/grade_aggregation.feature b/grade/tests/behat/grade_aggregation.feature index ce5cb455584..385c8020e6b 100644 --- a/grade/tests/behat/grade_aggregation.feature +++ b/grade/tests/behat/grade_aggregation.feature @@ -39,20 +39,18 @@ Feature: We can use calculated grade totals And I log in as "admin" And I set the following administration settings values: | grade_aggregations_visible | Mean of grades,Weighted mean of grades,Simple weighted mean of grades,Mean of grades (with extra credits),Median of grades,Lowest grade,Highest grade,Mode of grades,Natural | - And I log out - And I log in as "teacher1" - And I am on "Course 1" course homepage - And I navigate to "View > Grader report" in the course gradebook + And the following "grade grades" exist: + | gradeitem | user | grade | + | Test assignment one | student1 | 60.00 | + | Test assignment two | student1 | 20.00 | + | Test assignment three | student1 | 40.00 | + | Test assignment five | student1 | 10.00 | + | Test assignment six | student1 | 5.00 | + | Test assignment eight | student1 | 10.00 | + | Test assignment nine | student1 | 5.00 | + And I am on the "Course 1" "grades > Grader report > View" page logged in as "teacher1" And I turn editing mode on And I change window size to "large" - And I give the grade "60.00" to the user "Student 1" for the grade item "Test assignment one" - And I give the grade "20.00" to the user "Student 1" for the grade item "Test assignment two" - And I give the grade "40.00" to the user "Student 1" for the grade item "Test assignment three" - And I give the grade "10.00" to the user "Student 1" for the grade item "Test assignment five" - And I give the grade "5.00" to the user "Student 1" for the grade item "Test assignment six" - And I give the grade "10.00" to the user "Student 1" for the grade item "Test assignment eight" - And I give the grade "5.00" to the user "Student 1" for the grade item "Test assignment nine" - And I press "Save changes" And I set the following settings for grade item "Test assignment two": | Hidden | 1 | And I set the following settings for grade item "Test assignment five": @@ -254,10 +252,7 @@ Feature: We can use calculated grade totals Then I should see "114.82 (18.27 %)" in the "overview-grade" "table" And I click on "Course 1" "link" in the "region-main" "region" And "Test outcome item one" row "Grade" column of "user-grade" table should contain "Excellent (100.00 %)" - And I log out - And I log in as "teacher1" - And I am on "Course 1" course homepage - And I navigate to "Setup > Gradebook setup" in the course gradebook + And I am on the "Course 1" "grades > gradebook setup" page logged in as "teacher1" And I set the following settings for grade item "Test outcome item one": | Extra credit | 1 | And I log out @@ -266,10 +261,7 @@ Feature: We can use calculated grade totals Then I should see "114.00 (18.39 %)" in the "overview-grade" "table" And I click on "Course 1" "link" in the "region-main" "region" And "Test outcome item one" row "Grade" column of "user-grade" table should contain "Excellent (100.00 %)" - And I log out - And I log in as "teacher1" - And I am on "Course 1" course homepage - And I navigate to "Setup > Gradebook setup" in the course gradebook + And I am on the "Course 1" "grades > gradebook setup" page logged in as "teacher1" And I set the following settings for grade item "Course 1": | Aggregation | Natural | | Include outcomes in aggregation | 0 | @@ -368,10 +360,7 @@ Feature: We can use calculated grade totals | Test assignment four | 30.93 % | - | 0–150 | 0.00 % | Scenario: Natural aggregation with drop lowest - When I log out - And I log in as "admin" - And I am on "Course 1" course homepage - And I navigate to "View > Grader report" in the course gradebook + When I am on the "Course 1" "grades > Grader report > View" page logged in as "admin" And I turn editing mode on And I set the following settings for grade item "Sub category 1": | Aggregation | Natural | diff --git a/grade/tests/behat/grade_aggregation_changes.feature b/grade/tests/behat/grade_aggregation_changes.feature index 68835bb361e..571a419733e 100644 --- a/grade/tests/behat/grade_aggregation_changes.feature +++ b/grade/tests/behat/grade_aggregation_changes.feature @@ -33,8 +33,7 @@ Feature: Changing the aggregation of an item affects its weight and extra credit And I log in as "admin" And I set the following administration settings values: | grade_aggregations_visible | Mean of grades,Weighted mean of grades,Simple weighted mean of grades,Mean of grades (with extra credits),Median of grades,Lowest grade,Highest grade,Mode of grades,Natural | - And I am on "Course 1" course homepage - And I navigate to "View > Grader report" in the course gradebook + And I am on the "Course 1" "grades > Grader report > View" page And I turn editing mode on And I follow "Edit Cat mean" And I set the following fields to these values: diff --git a/grade/tests/behat/grade_calculated_grade_items.feature b/grade/tests/behat/grade_calculated_grade_items.feature index e3cca8d185f..8d3091438a1 100644 --- a/grade/tests/behat/grade_calculated_grade_items.feature +++ b/grade/tests/behat/grade_calculated_grade_items.feature @@ -18,9 +18,7 @@ Feature: Calculated grade items can be used in the gradebook | teacher1 | C1 | editingteacher | | student1 | C1 | student | | student2 | C1 | student | - And I log in as "admin" - And I am on "Course 1" course homepage - And I navigate to "Setup > Gradebook setup" in the course gradebook + And I am on the "Course 1" "grades > gradebook setup" page logged in as "admin" @javascript Scenario: The max grade for a category item, with a calculation using Natural aggregation, can be changed diff --git a/grade/tests/behat/grade_calculated_grade_items_20150627.feature b/grade/tests/behat/grade_calculated_grade_items_20150627.feature index 88558150a30..4668d133e8c 100644 --- a/grade/tests/behat/grade_calculated_grade_items_20150627.feature +++ b/grade/tests/behat/grade_calculated_grade_items_20150627.feature @@ -19,9 +19,7 @@ Feature: Gradebook calculations for calculated grade items before the fix 201506 | teacher1 | C1 | editingteacher | | student1 | C1 | student | | student2 | C1 | student | - And I log in as "admin" - And I am on "Course 1" course homepage - And I navigate to "Setup > Gradebook setup" in the course gradebook + And I am on the "Course 1" "grades > gradebook setup" page logged in as "admin" @javascript Scenario: The max grade for a category item, with a calculation using Natural aggregation, can be changed diff --git a/grade/tests/behat/grade_calculated_weights.feature b/grade/tests/behat/grade_calculated_weights.feature index 72fee663783..36abe891ca8 100644 --- a/grade/tests/behat/grade_calculated_weights.feature +++ b/grade/tests/behat/grade_calculated_weights.feature @@ -29,10 +29,7 @@ Feature: We can understand the gradebook user report And I log in as "admin" And I set the following administration settings values: | grade_aggregations_visible | Mean of grades,Weighted mean of grades,Simple weighted mean of grades,Mean of grades (with extra credits),Median of grades,Lowest grade,Highest grade,Mode of grades,Natural | - And I log out - And I log in as "teacher1" - And I am on "Course 1" course homepage - And I navigate to "View > Grader report" in the course gradebook + And I am on the "Course 1" "grades > Grader report > View" page logged in as teacher1 And I turn editing mode on And I give the grade "60.00" to the user "Student 1" for the grade item "EN Test assignment one" And I give the grade "20.00" to the user "Student 1" for the grade item "EN Test assignment two" diff --git a/grade/tests/behat/grade_contribution_with_extra_credit.feature b/grade/tests/behat/grade_contribution_with_extra_credit.feature index cb53856f38c..b0eaaba2987 100644 --- a/grade/tests/behat/grade_contribution_with_extra_credit.feature +++ b/grade/tests/behat/grade_contribution_with_extra_credit.feature @@ -19,8 +19,7 @@ Feature: Extra credit contributions are normalised when going out of bounds And I log in as "admin" And I set the following administration settings values: | grade_aggregations_visible | Simple weighted mean of grades,Mean of grades (with extra credits),Natural | - And I am on "Course 1" course homepage - And I navigate to "Setup > Gradebook setup" in the course gradebook + And I am on the "Course 1" "grades > gradebook setup" page And I press "Add grade item" And I set the following fields to these values: | Item name | Manual item 1 | @@ -42,10 +41,7 @@ Feature: Extra credit contributions are normalised when going out of bounds And I set the field "Show weighting" to "Show" And I set the field "Show contribution to course total" to "Show" And I press "Save changes" - And I log out - And I log in as "teacher1" - And I am on "Course 1" course homepage - And I navigate to "View > Grader report" in the course gradebook + And I am on the "Course 1" "grades > Grader report > View" page logged in as "teacher1" And I turn editing mode on And I give the grade "80.00" to the user "Student 1" for the grade item "Manual item 1" And I give the grade "10.00" to the user "Student 1" for the grade item "Manual item 2" diff --git a/grade/tests/behat/grade_grade_minmax_change.feature b/grade/tests/behat/grade_grade_minmax_change.feature index 874cd9b43c8..0f3b971d840 100644 --- a/grade/tests/behat/grade_grade_minmax_change.feature +++ b/grade/tests/behat/grade_grade_minmax_change.feature @@ -19,9 +19,7 @@ Feature: We can change the maximum and minimum number of points for manual items | teacher1 | C1 | editingteacher | | student1 | C1 | student | | student2 | C1 | student | - And I log in as "teacher1" - And I am on "Course 1" course homepage - And I navigate to "Setup > Gradebook setup" in the course gradebook + And I am on the "Course 1" "grades > gradebook setup" page logged in as "teacher1" And I press "Add grade item" And I set the following fields to these values: | Item name | Manual item 1 | @@ -34,8 +32,7 @@ Feature: We can change the maximum and minimum number of points for manual items And I press "Save changes" Scenario: Change maximum number of points on a graded item. - And I am on "Course 1" course homepage - And I navigate to "View > Grader report" in the course gradebook + Given I am on the "Course 1" "grades > Grader report > View" page And I turn editing mode on And I give the grade "10.00" to the user "Student 1" for the grade item "Manual item 1" And I give the grade "8.00" to the user "Student 2" for the grade item "Manual item 1" diff --git a/grade/tests/behat/grade_hidden_items.feature b/grade/tests/behat/grade_hidden_items.feature index 7bb31e8dd5a..0817b670b6e 100644 --- a/grade/tests/behat/grade_hidden_items.feature +++ b/grade/tests/behat/grade_hidden_items.feature @@ -29,8 +29,7 @@ Feature: Student and teacher's view of aggregated grade items is consistent when And I log in as "admin" And the "multilang" filter is "on" And the "multilang" filter applies to "content and headings" - And I am on "Course 1" course homepage - And I navigate to "Setup > Gradebook setup" in the course gradebook + And I am on the "Course 1" "grades > gradebook setup" page And I press "Add grade item" And I set the following fields to these values: | Item name | calculated | @@ -42,10 +41,7 @@ Feature: Student and teacher's view of aggregated grade items is consistent when And I navigate to "Grades > Report settings > User report" in site administration And I set the field "s__grade_report_user_showtotalsifcontainhidden" to "Show totals excluding hidden items" And I press "Save changes" - When I log out - And I log in as "teacher1" - And I am on "Course 1" course homepage - And I navigate to "View > Grader report" in the course gradebook + When I am on the "Course 1" "grades > Grader report > View" page logged in as "teacher1" And I turn editing mode on And I give the grade "50.00" to the user "Student 1" for the grade item "Test assignment one" And I give the grade "50.00" to the user "Student 1" for the grade item "Test assignment three" @@ -53,8 +49,7 @@ Feature: Student and teacher's view of aggregated grade items is consistent when And I set the following settings for grade item "Test assignment four": | Hidden | 1 | And I press "Save changes" - And I am on "Course 1" course homepage - And I navigate to "View > User report" in the course gradebook + And I am on the "Course 1" "grades > User report > View" page And I select "Myself" from the "View report as" singleselect And I select "Student 1" from the "Select all or one user" singleselect Then the following should exist in the "user-grade" table: @@ -63,10 +58,7 @@ Feature: Student and teacher's view of aggregated grade items is consistent when | Test assignment two | 0.00 %( Empty ) | - | 0–100 | - | 0.00 % | | Test assignment three | 100.00 % | 50.00 | 0–100 | 50.00 % | 25.00 % | | Course total | - | 100.00 | 0–200 | 50.00 % | - | - When I log out - And I log in as "student1" - And I am on "Course 1" course homepage - And I navigate to "User report" in the course gradebook + When I am on the "Course 1" "grades > User report > View" page logged in as "student1" Then the following should exist in the "user-grade" table: | Grade item | Calculated weight | Grade | Range | Percentage | Contribution to course total | | Test assignment one | 100.00 % | 50.00 | 0–100 | 50.00 % | 25.00 % | diff --git a/grade/tests/behat/grade_hidden_items_locked_category.feature b/grade/tests/behat/grade_hidden_items_locked_category.feature index 6cc1154ea2b..e833804e622 100644 --- a/grade/tests/behat/grade_hidden_items_locked_category.feature +++ b/grade/tests/behat/grade_hidden_items_locked_category.feature @@ -17,9 +17,7 @@ Feature: Hidden grade items should be hidden when grade category is locked, but | user | course | role | | teacher1 | C1 | editingteacher | | student1 | C1 | student | - And I log in as "admin" - And I am on "Course 1" course homepage - And I navigate to "Setup > Gradebook setup" in the course gradebook + And I am on the "Course 1" "grades > gradebook setup" page logged in as "admin" And I press "Add category" And I set the following fields to these values: | Category name | Test locked category | @@ -30,23 +28,16 @@ Feature: Hidden grade items should be hidden when grade category is locked, but | Hidden | 1 | | Grade category | Test locked category | And I press "Save changes" - And I log out - And I log in as "teacher1" - And I am on "Course 1" course homepage - And I navigate to "View > Grader report" in the course gradebook + And I am on the "Course 1" "grades > Grader report > View" page logged in as "teacher1" And I turn editing mode on And I give the grade "50.00" to the user "Student 1" for the grade item "Hidden item" And I press "Save changes" And I navigate to "Setup > Gradebook setup" in the course gradebook And I set the following settings for grade item "Test locked category": | Locked | 1 | - And I press "Save changes" - And I log out Scenario: Hidden grade items in locked category is hidden for teacher - Given I log in as "teacher1" - And I am on "Course 1" course homepage - And I navigate to "View > User report" in the course gradebook + Given I am on the "Course 1" "grades > User report > View" page logged in as teacher1 And I select "Myself" from the "View report as" singleselect When I select "Student 1" from the "Select all or one user" singleselect Then the following should exist in the "user-grade" table: @@ -55,9 +46,7 @@ Feature: Hidden grade items should be hidden when grade category is locked, but | Course total | - | 50.00 | 0–100 | 50.00 % | - | Scenario: Hidden grade items in locked category is hidden for student - Given I log in as "student1" - And I am on "Course 1" course homepage - When I navigate to "User report" in the course gradebook + When I am on the "Course 1" "grades > User report > View" page logged in as student1 Then the following should exist in the "user-grade" table: | Grade item | Calculated weight | Grade | Range | Percentage | Contribution to course total | | Test locked category total | 100.00 % | - | 0–100 | - | - | @@ -65,9 +54,7 @@ Feature: Hidden grade items should be hidden when grade category is locked, but And I should not see "Hidden item" Scenario: Hidden grade items in overridden category should show - Given I log in as "teacher1" - And I am on "Course 1" course homepage - And I navigate to "Setup > Gradebook setup" in the course gradebook + Given I am on the "Course 1" "grades > gradebook setup" page And I press "Add category" And I set the following fields to these values: | Category name | Test overridden category B| @@ -78,13 +65,9 @@ Feature: Hidden grade items should be hidden when grade category is locked, but | Grade category | Test overridden category B | And I press "Save changes" When I navigate 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 "Test overridden category B total" And I press "Save changes" - And I log out - And I log in as "student1" - And I am on "Course 1" course homepage - And I navigate to "User report" in the course gradebook + And I am on the "Course 1" "grades > User report > View" page logged in as "student1" Then the following should exist in the "user-grade" table: | Grade item | Calculated weight | Grade | Range | Percentage | Contribution to course total | | Test locked category total | 50.00 % | - | 0–100 | - | - | diff --git a/grade/tests/behat/grade_item_duplication.feature b/grade/tests/behat/grade_item_duplication.feature index 8bbcdad51f0..982597dd3e9 100644 --- a/grade/tests/behat/grade_item_duplication.feature +++ b/grade/tests/behat/grade_item_duplication.feature @@ -25,9 +25,7 @@ Feature: We can duplicate grade items that already exist. | Item1 | C1 | Category1 | 001 | Value | 80.00 | 5.00 | 40.00 | 1 | 1 | 0 | 1 | Scenario: Ensure the duplicated grade item settings match the original grade item - Given I log in as "teacher1" - And I am on "Course 1" course homepage - And I navigate to "Setup > Gradebook setup" in the course gradebook + Given I am on the "Course 1" "grades > gradebook setup" page logged in as "teacher1" And I should not see "Duplicate Category1" And I should not see "Duplicate Assignment1" When I duplicate the grade item "Item1" diff --git a/grade/tests/behat/grade_item_validation.feature b/grade/tests/behat/grade_item_validation.feature index cd9392e3492..cc1caca2a81 100644 --- a/grade/tests/behat/grade_item_validation.feature +++ b/grade/tests/behat/grade_item_validation.feature @@ -30,8 +30,7 @@ Feature: Grade item validation | Name | ENFR Letter scale | | Scale | Disappointing, Good, Very good, Excellent | And I press "Save changes" - And I am on "Course 1" course homepage - And I navigate to "Setup > Gradebook setup" in the course gradebook + And I am on the "Course 1" "grades > gradebook setup" page And I press "Add grade item" And I set the following fields to these values: | Item name | ENFR MI 1 | diff --git a/grade/tests/behat/grade_letter_boundary.feature b/grade/tests/behat/grade_letter_boundary.feature index d9d951c3ff8..de59d1e38d3 100644 --- a/grade/tests/behat/grade_letter_boundary.feature +++ b/grade/tests/behat/grade_letter_boundary.feature @@ -20,9 +20,7 @@ Feature: We can customise the letter boundary of a course. And the following "activities" exist: | activity | course | idnumber | name | intro | grade | | assign | C1 | a1 | Test assignment one | Submit something! | 100 | - And I log in as "teacher1" - And I am on "Course 1" course homepage - And I navigate to "Setup > Course grade settings" in the course gradebook + And I am on the "Course 1" "grades > course grade settings" page logged in as "teacher1" And I set the following fields to these values: | Grade display type | Letter | And I press "Save changes" diff --git a/grade/tests/behat/grade_letter_boundary_20160518.feature b/grade/tests/behat/grade_letter_boundary_20160518.feature index 0f5dbc18dcd..602368253c1 100644 --- a/grade/tests/behat/grade_letter_boundary_20160518.feature +++ b/grade/tests/behat/grade_letter_boundary_20160518.feature @@ -21,9 +21,7 @@ Feature: We can customise the letter boundary of a course in gradebook version 2 And the following "activities" exist: | activity | course | idnumber | name | intro | grade | | assign | C1 | a1 | Test assignment one | Submit something! | 100 | - And I log in as "teacher1" - And I am on "Course 1" course homepage - And I navigate to "Setup > Course grade settings" in the course gradebook + And I am on the "Course 1" "grades > course grade settings" page logged in as "teacher1" And I set the following fields to these values: | Grade display type | Letter | And I press "Save changes" diff --git a/grade/tests/behat/grade_letter_logging.feature b/grade/tests/behat/grade_letter_logging.feature index fc022277675..d5976952879 100644 --- a/grade/tests/behat/grade_letter_logging.feature +++ b/grade/tests/behat/grade_letter_logging.feature @@ -8,9 +8,7 @@ Feature: We can view the logs for any changes to grade letters. Given the following "courses" exist: | fullname | shortname | category | | Course 1 | C1 | 0 | - And I log in as "admin" - And I am on "Course 1" course homepage - And I navigate to "Setup > Course grade settings" in the course gradebook + And I am on the "Course 1" "grades > course grade settings" page logged in as "admin" And I set the following fields to these values: | Grade display type | Letter | And I press "Save changes" diff --git a/grade/tests/behat/grade_mingrade.feature b/grade/tests/behat/grade_mingrade.feature index b385b3d27ae..a76c36c1bff 100644 --- a/grade/tests/behat/grade_mingrade.feature +++ b/grade/tests/behat/grade_mingrade.feature @@ -25,8 +25,7 @@ Feature: We can use a minimum grade different than zero And I log in as "admin" And I set the following administration settings values: | grade_aggregations_visible | Mean of grades,Weighted mean of grades,Simple weighted mean of grades,Mean of grades (with extra credits),Median of grades,Lowest grade,Highest grade,Mode of grades,Natural | - And I am on "Course 1" course homepage - And I navigate to "Setup > Gradebook setup" in the course gradebook + And I am on the "Course 1" "grades > gradebook setup" page And I press "Add grade item" And I set the following fields to these values: | Item name | Manual item 1 | @@ -81,10 +80,7 @@ Feature: We can use a minimum grade different than zero And I set the following settings for grade item "Course 1": | Aggregation | Natural | | Exclude empty grades | 0 | - And I log out - And I log in as "teacher1" - And I am on "Course 1" course homepage - And I navigate to "View > Grader report" in the course gradebook + And I am on the "Course 1" "grades > Grader report > View" page logged in as "teacher1" And I turn editing mode on When I give the grade "-25.00" to the user "Student 1" for the grade item "Manual item 1" And I give the grade "50.00" to the user "Student 1" for the grade item "Manual item 2" diff --git a/grade/tests/behat/grade_minmax.feature b/grade/tests/behat/grade_minmax.feature index b1535e04b4c..8bbd9e62513 100644 --- a/grade/tests/behat/grade_minmax.feature +++ b/grade/tests/behat/grade_minmax.feature @@ -24,8 +24,7 @@ Feature: We can choose what min or max grade to use when aggregating grades. And I log in as "admin" And I set the following administration settings values: | grade_minmaxtouse | Min and max grades as specified in grade item settings | - And I am on "C1" course homepage - And I navigate to "Setup > Gradebook setup" in the course gradebook + And I am on the "C1" "grades > gradebook setup" page And I press "Add grade item" And I set the following fields to these values: | Item name | MI 1 | @@ -63,10 +62,7 @@ Feature: We can choose what min or max grade to use when aggregating grades. And I navigate to "Setup > Gradebook setup" in the course gradebook And I set the following settings for grade item "CAT1": | Aggregation | Natural | - And I log out - And I log in as "teacher1" - And I am on "C1" course homepage - And I navigate to "View > Grader report" in the course gradebook + And I am on the "C1" "grades > Grader report > View" page logged in as "teacher1" And I turn editing mode on And I give the grade "75.00" to the user "Student 1" for the grade item "MI 1" And I give the grade "25.00" to the user "Student 1" for the grade item "MI 2" diff --git a/grade/tests/behat/grade_natural_exclude_empty.feature b/grade/tests/behat/grade_natural_exclude_empty.feature index b23be1f4533..f109f63a746 100644 --- a/grade/tests/behat/grade_natural_exclude_empty.feature +++ b/grade/tests/behat/grade_natural_exclude_empty.feature @@ -23,9 +23,7 @@ Feature: Weights in natural aggregation are adjusted if the items are excluded f | assign | C1 | a3 | Test assignment three | x | 200 | | assign | C1 | a4 | Test assignment four (extra) | x | 20 | | assign | C1 | a5 | Test assignment five (extra) | x | 10 | - And I log in as "teacher1" - And I am on "Course 1" course homepage - And I navigate to "Setup > Gradebook setup" in the course gradebook + And I am on the "Course 1" "grades > gradebook setup" page logged in as "teacher1" And I set the following settings for grade item "Test assignment four (extra)": | Extra credit | 1 | And I set the following settings for grade item "Test assignment five (extra)": diff --git a/grade/tests/behat/grade_natural_exclude_empty_20150619.feature b/grade/tests/behat/grade_natural_exclude_empty_20150619.feature index 39578ff9a38..cb1940d3624 100644 --- a/grade/tests/behat/grade_natural_exclude_empty_20150619.feature +++ b/grade/tests/behat/grade_natural_exclude_empty_20150619.feature @@ -24,9 +24,7 @@ Feature: Gradebook calculations for extra credit items before the fix 20150619 | assign | C1 | a3 | Test assignment three | x | 200 | | assign | C1 | a4 | Test assignment four (extra) | x | 20 | | assign | C1 | a5 | Test assignment five (extra) | x | 10 | - And I log in as "teacher1" - And I am on "Course 1" course homepage - And I navigate to "Setup > Gradebook setup" in the course gradebook + And I am on the "Course 1" "grades > gradebook setup" page logged in as "teacher1" And I set the following settings for grade item "Test assignment four (extra)": | Extra credit | 1 | And I set the following settings for grade item "Test assignment five (extra)": diff --git a/grade/tests/behat/grade_natural_normalisation.feature b/grade/tests/behat/grade_natural_normalisation.feature index e45982bfc16..4325c3ba421 100644 --- a/grade/tests/behat/grade_natural_normalisation.feature +++ b/grade/tests/behat/grade_natural_normalisation.feature @@ -32,9 +32,7 @@ Feature: We can use natural aggregation and weights will be normalised to a tota | assign | C1 | a7 | Test assignment seven | Submit nothing! | ENFR Sub category 1 | 15 | And the "multilang" filter is "on" And the "multilang" filter applies to "content and headings" - And I log in as "teacher1" - And I am on "Course 1" course homepage - And I navigate to "Setup > Gradebook setup" in the course gradebook + And I am on the "Course 1" "grades > gradebook setup" page logged in as "teacher1" @javascript Scenario: Setting all weights in a category to exactly one hundred in total. diff --git a/grade/tests/behat/grade_natural_normalisation_20150619.feature b/grade/tests/behat/grade_natural_normalisation_20150619.feature index 887a5c0000e..f853db7ee7d 100644 --- a/grade/tests/behat/grade_natural_normalisation_20150619.feature +++ b/grade/tests/behat/grade_natural_normalisation_20150619.feature @@ -31,9 +31,7 @@ Feature: Gradebook calculations for natural weights normalisation before the fix | assign | C1 | a5 | Test assignment five | Submit something! | Sub category 1 | 20 | | assign | C1 | a6 | Test assignment six | Submit something! | Sub category 1 | 10 | | assign | C1 | a7 | Test assignment seven | Submit nothing! | Sub category 1 | 15 | - And I log in as "teacher1" - And I am on "Course 1" course homepage - And I navigate to "Setup > Gradebook setup" in the course gradebook + And I am on the "Course 1" "grades > gradebook setup" page logged in as "teacher1" @javascript Scenario: Grade items weights are normalised when all grade item weights are overridden (sum exactly 100). Extra credit is set to zero (before the fix 20150619). diff --git a/grade/tests/behat/grade_regrade_do_not_override.feature b/grade/tests/behat/grade_regrade_do_not_override.feature index eb677145956..b1c7f89f687 100644 --- a/grade/tests/behat/grade_regrade_do_not_override.feature +++ b/grade/tests/behat/grade_regrade_do_not_override.feature @@ -31,8 +31,7 @@ Feature: Regrading grades does not unnecessarily mark some as overriden And I press "OK" And I set the field "Grade out of 100" to "60" And I press "Save changes" - And I am on "Course 1" course homepage - And I navigate to "View > Grader report" in the course gradebook + And I am on the "Course 1" "grades > Grader report > View" page And the following should exist in the "gradereport-grader-table" table: | | | | | First name / Surname | Assignment 1 | Course total | @@ -41,7 +40,6 @@ Feature: Regrading grades does not unnecessarily mark some as overriden And I turn editing mode on And I give the grade "80.00" to the user "Student 2" for the grade item "Course total" And I press "Save changes" - And I navigate to "View > Grader report" in the course gradebook And I navigate to "Setup > Gradebook setup" in the course gradebook And I click on "Edit" "link" in the ".coursecategory" "css_element" And I click on "Edit settings" "link" in the ".coursecategory" "css_element" @@ -66,8 +64,7 @@ Feature: Regrading grades does not unnecessarily mark some as overriden And I press "OK" And I set the field "Grade out of 100" to "70" And I press "Save changes" - When I am on "Course 1" course homepage - And I navigate to "View > Grader report" in the course gradebook + When I am on the "Course 1" "grades > Grader report > View" page Then the following should exist in the "gradereport-grader-table" table: | | | | | First name / Surname | Assignment 1 | Course total | diff --git a/grade/tests/behat/grade_scales_aggregation.feature b/grade/tests/behat/grade_scales_aggregation.feature index a453d2a8ff1..39d35607f80 100644 --- a/grade/tests/behat/grade_scales_aggregation.feature +++ b/grade/tests/behat/grade_scales_aggregation.feature @@ -1,4 +1,4 @@ -@core @core_grades +@core @core_grades @javascript Feature: Control the aggregation of the scales In order to use control the aggregation of the scales As an admin @@ -34,12 +34,9 @@ Feature: Control the aggregation of the scales | Scale me | C1 | Letterscale | And the following config values are set as admin: | grade_includescalesinaggregation | 0 | - And I log out Scenario Outline: Scales can be excluded from aggregation - Given I log in as "teacher1" - And I am on "Course 1" course homepage - And I navigate to "View > Grader report" in the course gradebook + Given I am on the "Course 1" "grades > Grader report > View" page logged in as "teacher1" And I turn editing mode on When I give the grade "10" to the user "Student 1" for the grade item "Grade me" And I give the grade "B" to the user "Student 1" for the grade item "Scale me" @@ -57,10 +54,7 @@ Feature: Control the aggregation of the scales And I log in as "admin" And I set the following administration settings values: | grade_includescalesinaggregation | 1 | - And I log out - And I log in as "teacher1" - And I am on "Course 1" course homepage - And I navigate to "View > User report" in the course gradebook + And I am on the "Course 1" "grades > User report > View" page logged in as "teacher1" And I select "Student 1" from the "Select all or one user" singleselect And the following should exist in the "user-grade" table: | Grade item | Grade | Percentage | Contribution to course total | @@ -80,11 +74,8 @@ Feature: Control the aggregation of the scales | Highest grade | Highest grade. | 10.00 | 10.00 % | 10.00 | 0.00 | 75.00 | 75.00 % | 0.00 % | 75.00 % | | Mode of grades | Mode of grades. | 10.00 | 10.00 % | 10.00 | 0.00 | 75.00 | 75.00 % | 0.00 % | 75.00 % | - @javascript Scenario: Weights of scales cannot be edited when they are not aggregated - Given I log in as "teacher1" - And I am on "Course 1" course homepage - And I navigate to "View > Grader report" in the course gradebook + Given I am on the "Course 1" "grades > Grader report > View" page logged in as "teacher1" And I turn editing mode on When I set the following settings for grade item "Course 1": | Aggregation | Natural | diff --git a/grade/tests/behat/grade_single_item_scales.feature b/grade/tests/behat/grade_single_item_scales.feature index 654debb539c..ae99ee615c4 100644 --- a/grade/tests/behat/grade_single_item_scales.feature +++ b/grade/tests/behat/grade_single_item_scales.feature @@ -48,9 +48,7 @@ Feature: View gradebook when single item scales are used And I click on "Grade" "link" in the "Student 1" "table_row" And I set the field "Grade" to "A" And I press "Save changes" - And I press "OK" - And I am on "Course 1" course homepage - And I navigate to "Setup > Course grade settings" in the course gradebook + When I am on the "Course 1" "grades > course grade settings" page And I set the field "Show weightings" to "Show" And I set the field "Show contribution to course total" to "Show" And I press "Save changes" diff --git a/grade/tests/behat/grade_view.feature b/grade/tests/behat/grade_view.feature index 1700dc0efed..2e27444a3f8 100644 --- a/grade/tests/behat/grade_view.feature +++ b/grade/tests/behat/grade_view.feature @@ -47,10 +47,7 @@ Feature: We can enter in grades and view reports from the gradebook | Online text | This is a submission for assignment 2 | And I press "Save changes" Then I should see "Submitted for grading" - And I log out - And I log in as "teacher1" - And I am on "Course 1" course homepage - And I navigate to "View > Grader report" in the course gradebook + And I am on the "Course 1" "grades > Grader report > View" page logged in as "teacher1" 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" diff --git a/mod/assign/tests/behat/outcome_grading.feature b/mod/assign/tests/behat/outcome_grading.feature index 70d59269300..bfa5b442345 100644 --- a/mod/assign/tests/behat/outcome_grading.feature +++ b/mod/assign/tests/behat/outcome_grading.feature @@ -20,22 +20,13 @@ Feature: Outcome grading | student1 | C1 | student | And the following config values are set as admin: | enableoutcomes | 1 | - And I log in as "admin" - And I navigate to "Grades > Scales" in site administration - And I press "Add a new scale" - And I set the following fields to these values: - | Name | Test Scale | - | Scale | Disappointing, Excellent, Good, Very good, Excellent | - And I press "Save changes" - And I navigate to "Grades > Outcomes" in site administration - And I press "Add a new outcome" - And I set the following fields to these values: - | Full name | Outcome Test | - | Short name | OT | - | Scale | Test Scale | - And I press "Save changes" - And I am on "Course 1" course homepage - And I navigate to "Outcomes" in current page administration + And the following "scales" exist: + | name | scale | + | Test Scale | Disappointing, Excellent, Good, Very good, Excellent | + And the following "grade outcomes" exist: + | fullname | shortname | scale | + | Outcome Test | OT | Test Scale | + And I am on the "Course 1" "grades > outcomes" page logged in as admin And I set the field "Available standard outcomes" to "Outcome Test" And I click on "#add" "css_element" And I log out @@ -49,13 +40,11 @@ Feature: Outcome grading | Description | Test assignment description | | assignsubmission_onlinetext_enabled | 1 | | Outcome Test | 1 | - And I log out And I am on the "Test assignment name" "assign activity" page logged in as student1 And I press "Add submission" And I set the following fields to these values: | Online text | My online text | And I press "Save changes" - And I log out When I am on the "Test assignment name" "assign activity" page logged in as teacher1 And I navigate to "View all submissions" in current page administration And I click on "Grade" "link" in the "Student 0" "table_row" diff --git a/mod/assign/tests/behat/quickgrading.feature b/mod/assign/tests/behat/quickgrading.feature index a3d678b4f43..8469a2de67d 100644 --- a/mod/assign/tests/behat/quickgrading.feature +++ b/mod/assign/tests/behat/quickgrading.feature @@ -53,9 +53,7 @@ Feature: In an assignment, teachers grade multiple students on one page | student2 | C1 | student | And the following config values are set as admin: | enableoutcomes | 1 | - When I log in as "teacher1" - And I am on "Course 1" course homepage - And I navigate to "Outcomes" in current page administration + When I am on the "Course 1" "grades > outcomes" page logged in as teacher1 And I follow "Edit outcomes" And I press "Add a new outcome" And I follow "Add a new scale" @@ -63,8 +61,7 @@ Feature: In an assignment, teachers grade multiple students on one page | Name | 1337dom scale | | Scale | Noob, Nub, 1337, HaXor | And I press "Save changes" - And I am on "Course 1" course homepage - And I navigate to "Outcomes" in current page administration + And I am on the "Course 1" "grades > outcomes" page And I follow "Edit outcomes" And I press "Add a new outcome" And I set the following fields to these values: @@ -79,26 +76,17 @@ Feature: In an assignment, teachers grade multiple students on one page | assignsubmission_onlinetext_enabled | 1 | | assignsubmission_file_enabled | 0 | | M8d skillZ! | 1 | - And I log out - And I log in as "student1" - And I am on "Course 1" course homepage - And I follow "Test assignment name" + And I am on the "Test assignment name" "assign activity" page logged in as student1 And I press "Add submission" And I set the following fields to these values: | Online text | I'm the student1 submission | And I press "Save changes" - And I log out - And I log in as "student2" - And I am on "Course 1" course homepage - And I follow "Test assignment name" + And I am on the "Test assignment name" "assign activity" page logged in as student2 When I press "Add submission" And I set the following fields to these values: | Online text | I'm the student2 submission | And I press "Save changes" - And I log out - And I log in as "teacher1" - And I am on "Course 1" course homepage - And I follow "Test assignment name" + And I am on the "Test assignment name" "assign activity" page logged in as teacher1 And I navigate to "View all submissions" in current page administration And I click on "Grade" "link" in the "Student 1" "table_row" And I set the following fields to these values: @@ -115,28 +103,19 @@ Feature: In an assignment, teachers grade multiple students on one page And I press "Save all quick grading changes" And I should see "The grade changes were saved" And I press "Continue" - And I log out - And I log in as "student1" - And I am on "Course 1" course homepage - And I follow "Test assignment name" + And I am on the "Test assignment name" "assign activity" page logged in as student1 And I should see "I'm the teacher first feedback" And I should see "60.0" And I follow "Grades" in the user menu And I click on "Course 1" "link" in the "region-main" "region" And I should see "1337" - And I log out - And I log in as "student2" - And I am on "Course 1" course homepage - And I follow "Test assignment name" + And I am on the "Test assignment name" "assign activity" page logged in as student2 And I should not see "I'm the teacher first feedback" And I should not see "60.0" And I follow "Grades" in the user menu And I click on "Course 1" "link" in the "region-main" "region" And I should not see "1337" - And I log out - And I log in as "teacher1" - And I am on "Course 1" course homepage - And I follow "Test assignment name" + And I am on the "Test assignment name" "assign activity" page logged in as teacher1 And I navigate to "View all submissions" in current page administration And I click on "Hide User picture" "link" And I click on "Hide Full name" "link" @@ -154,19 +133,13 @@ Feature: In an assignment, teachers grade multiple students on one page And I press "Save all quick grading changes" And I should see "The grade changes were saved" And I press "Continue" - And I log out - And I log in as "student1" - And I am on "Course 1" course homepage - And I follow "Test assignment name" + And I am on the "Test assignment name" "assign activity" page logged in as student1 And I should see "I'm the teacher first feedback" And I should see "60.0" And I follow "Grades" in the user menu And I click on "Course 1" "link" in the "region-main" "region" And I should see "1337" - And I log out - And I log in as "student2" - And I am on "Course 1" course homepage - And I follow "Test assignment name" + And I am on the "Test assignment name" "assign activity" page logged in as student2 And I should not see "I'm the teacher first feedback" And I should not see "60.0" And I follow "Grades" in the user menu diff --git a/mod/assign/tests/behat/steps_blind_marking.feature b/mod/assign/tests/behat/steps_blind_marking.feature index 6ba46213be9..777abdd2d26 100644 --- a/mod/assign/tests/behat/steps_blind_marking.feature +++ b/mod/assign/tests/behat/steps_blind_marking.feature @@ -69,10 +69,7 @@ Feature: Assignments correctly add feedback to the grade report when workflow an And I should see "Released" in the "I'm the student's first submission" "table_row" And I set the field "Grading action" to "Reveal student identities" And I press "Continue" - And I log out - - And I am on the "C1" Course page logged in as student1 - And I navigate to "User report" in the course gradebook + And I am on the "Course 1" "grades > User report > View" page logged in as "student1" Then I should see "50" And I should see "Great job! Lol, not really." @@ -97,10 +94,7 @@ Feature: Assignments correctly add feedback to the grade report when workflow an And I follow "Test assignment name" And I navigate to "View all submissions" in current page administration And I should see "Released" in the "Student 1" "table_row" - And I log out - - And I am on the "C1" Course page logged in as student1 - And I navigate to "User report" in the course gradebook + And I am on the "Course 1" "grades > User report > View" page logged in as "student1" Then I should see "50" And I should see "Great job! Lol, not really." diff --git a/mod/h5pactivity/tests/behat/sending_attempt.feature b/mod/h5pactivity/tests/behat/sending_attempt.feature index 91d96798264..f5ea4c4a6d9 100644 --- a/mod/h5pactivity/tests/behat/sending_attempt.feature +++ b/mod/h5pactivity/tests/behat/sending_attempt.feature @@ -41,7 +41,6 @@ Feature: Do a H5P attempt And I click on "Correct one" "text" in the ".h5p-question-content" "css_element" And I click on "Check" "button" in the ".h5p-question-buttons" "css_element" And I switch to the main frame - And I log out And I am on the "Course 1" course page logged in as teacher1 And I navigate to course participants And I follow "Student 1" @@ -83,8 +82,7 @@ Feature: Do a H5P attempt And "2" row "Score" column of "table" table should contain "1" And "3" row "Score" column of "table" table should contain "0" And "4" row "Score" column of "table" table should contain "1" - And I am on the "Course 1" course page logged in as teacher1 - And I navigate to "View > User report" in the course gradebook + And I am on the "Course 1" "grades > User report > View" page logged in as "teacher1" And I set the field "Select all or one user" to "Student 1" Then the following should exist in the "user-grade" table: | Grade item | Grade | Percentage | diff --git a/user/tests/behat/user_grade_navigation.feature b/user/tests/behat/user_grade_navigation.feature index edefb8566ea..fdaed7c013e 100644 --- a/user/tests/behat/user_grade_navigation.feature +++ b/user/tests/behat/user_grade_navigation.feature @@ -22,18 +22,15 @@ Feature: The student can navigate to their grades page and user grade report. | teacher1 | C1 | editingteacher | | student1 | C2 | student | And the following "activities" exist: - | activity | course | idnumber | name | intro | grade | - | assign | C1 | a1 | Test assignment one | Submit something! | 300 | - | assign | C1 | a2 | Test assignment two | Submit something! | 100 | - | assign | C1 | a3 | Test assignment three | Submit something! | 150 | - | assign | C2 | a4 | Test assignment four | Submit something! | 150 | - And I am on the "Course 1" course page logged in as teacher1 - And I navigate to "View > Grader report" in the course gradebook - And I turn editing mode on - And I give the grade "150.00" to the user "Student 1" for the grade item "Test assignment one" - And I give the grade "67.00" to the user "Student 1" for the grade item "Test assignment two" - And I press "Save changes" - And I log out + | activity | course | idnumber | name | grade | + | assign | C1 | a1 | Test assignment one | 300 | + | assign | C1 | a2 | Test assignment two | 100 | + | assign | C1 | a3 | Test assignment three | 150 | + | assign | C2 | a4 | Test assignment four | 150 | + And the following "grade grades" exist: + | gradeitem | user | grade | + | Test assignment one | student1 | 150.00 | + | Test assignment two | student1 | 67.00 | Scenario: Navigation to Grades and the user grade report. When I log in as "student1"