Skip to content

Commit

Permalink
MDL-75153 grade: Update behat tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Mihail Geshoski committed Sep 19, 2022
1 parent af74a55 commit 3001995
Show file tree
Hide file tree
Showing 35 changed files with 127 additions and 112 deletions.
20 changes: 10 additions & 10 deletions admin/tool/behat/tests/behat/data_generators.feature
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@tool @tool_behat
@tool @tool_behat @javascript
Feature: Set up contextual data for tests
In order to write tests quickly
As a developer
Expand All @@ -14,7 +14,6 @@ Feature: Set up contextual data for tests
When I log in as "testuser2"
Then I should see "TestFirstname"

@javascript
Scenario: Add a bunch of courses and categories
Given the following "categories" exist:
| name | category | idnumber |
Expand Down Expand Up @@ -43,7 +42,6 @@ Feature: Set up contextual data for tests
And I follow "Category 1"
And I should see "Course 3"

@javascript
Scenario: Add a bunch of groups and groupings
Given the following "courses" exist:
| fullname | shortname |
Expand All @@ -64,7 +62,6 @@ Feature: Set up contextual data for tests
And I should see "Grouping 1"
And I should see "Grouping 2"

@javascript
Scenario: Role overrides
Given the following "users" exist:
| username | firstname | lastname | email |
Expand Down Expand Up @@ -224,7 +221,6 @@ Feature: Set up contextual data for tests
And I follow "Settings"
And the field "Type" matches value "Scale"

@javascript
Scenario: Add relations between users and groups
Given the following "users" exist:
| username | firstname | lastname | email |
Expand Down Expand Up @@ -291,7 +287,7 @@ Feature: Set up contextual data for tests
And I should not see "Cohort in category"
And I am on course index
And I follow "Cat 1"
And I follow "Cohorts"
And I navigate to "Cohorts" in current page administration
And I should not see "System cohort"
And the following should exist in the "cohorts" table:
| Name | Cohort size |
Expand Down Expand Up @@ -335,19 +331,22 @@ Feature: Set up contextual data for tests
And I am on "Course 1" course homepage
And I navigate to "Setup > Gradebook setup" in the course gradebook
Then I should see "Test Grade Item 1"
And I follow "Edit Test Grade Item 1"
And I open the action menu in "Test Grade Item 1" "table_row"
And I choose "Edit" in the open action menu
And I expand all fieldsets
And I should see "Course 1"
And I press "Cancel"
And I should see "Grade category 1"
And I should see "Test Grade Item 2"
And I follow "Edit Test Grade Item 2"
And I open the action menu in "Test Grade Item 2" "table_row"
And I choose "Edit" in the open action menu
And I expand all fieldsets
And I should see "Grade category 1"
And I press "Cancel"
And I should see "Grade sub category 2"
And I should see "Test Grade Item 3"
And I follow "Edit Test Grade Item 3"
And I open the action menu in "Test Grade Item 3" "table_row"
And I choose "Edit" in the open action menu
And I expand all fieldsets
And I should see "Grade sub category 2"
And I press "Cancel"
Expand Down Expand Up @@ -412,7 +411,8 @@ Feature: Set up contextual data for tests
And I am on "Course 1" course homepage
And I navigate to "Setup > Gradebook setup" in the course gradebook
Then I should see "Test Outcome Grade Item 1"
And I follow "Edit Test Outcome Grade Item 1"
And I open the action menu in "Test Outcome Grade Item 1" "table_row"
And I choose "Edit" in the open action menu
And the field "Outcome" matches value "Grade outcome 1"
And I expand all fieldsets
And I should see "Grade category 1" in the "Grade category" "form_row"
Expand Down
12 changes: 6 additions & 6 deletions blocks/activity_results/tests/behat/addblockinactivity.feature
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@block @block_activity_results
@block @block_activity_results @javascript
Feature: The activity results block displays student scores
In order to be display student scores
As a user
Expand Down Expand Up @@ -45,7 +45,7 @@ Feature: The activity results block displays student scores
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"
Given I am on the "Test page name" "page activity" page
And I add the "Activity results" block
When I configure the "Activity results" block
And I set the following fields to these values:
Expand All @@ -63,25 +63,25 @@ Feature: The activity results block displays student scores
And I should see "70.00" in the "Activity results" "block"

Scenario: Block should select current activity by default
Given I follow "Test assignment 1"
Given I am on the "Test assignment 1" "assign activity" page
When I add the "Activity results" block
And I configure the "Activity results" block
Then the field "config_activitygradeitemid" matches value "Test assignment 1"
And I press "Cancel"
And I am on "Course 1" course homepage
And I follow "Test assignment 2"
And I am on the "Test assignment 2" "assign activity" page
And I add the "Activity results" block
And I configure the "Activity results" block
And the field "config_activitygradeitemid" matches value "Test assignment 2"
And I press "Cancel"
And I am on "Course 1" course homepage
And I follow "Test assignment 3"
And I am on the "Test assignment 3" "assign activity" page
And I add the "Activity results" block
And I configure the "Activity results" block
And the field "config_activitygradeitemid" matches value "Test assignment 3"
And I press "Cancel"
And I am on "Course 1" course homepage
And I follow "Test page name"
And I am on the "Test page name" "page activity" page
And I add the "Activity results" block
And I configure the "Activity results" block
And the field "config_activitygradeitemid" does not match value "Test page name"
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@block @block_activity_results
@block @block_activity_results @javascript
Feature: The activity results block displays student high scores
In order to be display student scores
As a user
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@block @block_activity_results
@block @block_activity_results @javascript
Feature: The activity results block displays students high scores in group as scales
In order to be display student scores as scales
As a user
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@block @block_activity_results
@block @block_activity_results @javascript
Feature: The activity results block displays student in group high scores as scales
In order to be display student scores as scales
As a user
Expand Down Expand Up @@ -53,7 +53,7 @@ Feature: The activity results block displays student in group high scores as sca
| Scale | Disappointing, Not good enough, Average, Good, Very good, Excellent! |
And I press "Save changes"
And I am on "Course 1" course homepage
And I follow "Test assignment"
And I am on the "Test assignment" "assign activity" page
And I navigate to "Settings" in current page administration
And I set the following fields to these values:
| assignsubmission_file_enabled | 0 |
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@block @block_activity_results
@block @block_activity_results @javascript
Feature: The activity results block displays student in separate groups scores
In order to be display student scores
As a user
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@block @block_activity_results
@block @block_activity_results @javascript
Feature: The activity results block displays student in visible groups scores
In order to be display student scores
As a user
Expand Down Expand Up @@ -46,7 +46,7 @@ Feature: The activity results block displays student in visible groups scores
| assign | Test assignment | Test assignment | C1 | assign1 | 1 | 0 |
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I follow "Test assignment"
And I am on the "Test assignment" "assign activity" page
And I navigate to "Settings" in current page administration
And I set the following fields to these values:
| Group mode | Visible groups |
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@block @block_activity_results
@block @block_activity_results @javascript
Feature: The activity results block displays student low scores
In order to be display student scores
As a user
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@block @block_activity_results
@block @block_activity_results @javascript
Feature: The activity results block displays student low scores as scales
In order to be display student scores as scales
As a user
Expand Down Expand Up @@ -41,7 +41,7 @@ Feature: The activity results block displays student low scores as scales
| 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 follow "Test assignment"
And I am on the "Test assignment" "assign activity" page
And I navigate to "Settings" in current page administration
And I set the following fields to these values:
| id_grade_modgrade_type | Scale |
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@block @block_activity_results
@block @block_activity_results @javascript
Feature: The activity results block displays students in groups low scores as scales
In order to be display student scores as scales
As a user
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@block @block_activity_results
@block @block_activity_results @javascript
Feature: The activity results block displays students in separate groups scores
In order to be display student scores
As a user
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@block @block_activity_results
@block @block_activity_results @javascript
Feature: The activity results block displays student in visible groups low scores
In order to be display student scores
As a user
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@core @core_completion
@core @core_completion @javascript
Feature: Students will be marked as completed if they have achieved a passing grade.

Background:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@core @core_completion
@core @core_completion @javascript
Feature: Students will be marked as completed and pass/fail
if they have viewed an activity and achieved a grade.

Expand Down
3 changes: 3 additions & 0 deletions grade/report/grader/tests/behat/ajax_grader.feature
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ Feature: Using the AJAX grading feature of Grader report to update grades and fe
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 change window size to "large"
And I click on student "Student 2" for grade item "Item VU"
Then I should see a grade field for "Student 2" and grade item "Item VU"
And I should not see a feedback field for "Student 2" and grade item "Item VU"
Expand Down Expand Up @@ -112,6 +113,7 @@ Feature: Using the AJAX grading feature of Grader report to update grades and fe
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 change window size to "large"
And I click on student "Student 2" for grade item "Item VU"
Then I should see a grade field for "Student 2" and grade item "Item VU"
And I should see a feedback field for "Student 2" and grade item "Item VU"
Expand Down Expand Up @@ -149,6 +151,7 @@ Feature: Using the AJAX grading feature of Grader report to update grades and fe
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 change window size to "large"
And I click on student "Student 2" for grade item "Item VU"
Then I should see a grade field for "Student 2" and grade item "Item VU"
And I should see a feedback field for "Student 2" and grade item "Item VU"
Expand Down
3 changes: 1 addition & 2 deletions grade/report/singleview/tests/behat/singleview.feature
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -57,7 +57,6 @@ Feature: We can use Single view
And I am on "Course 1" course homepage
Given I navigate to "View > Grader report" in the course gradebook

@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
Expand Down
2 changes: 1 addition & 1 deletion grade/report/user/tests/behat/user_view.feature
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@core @core_grades @gradereport_user
@core @core_grades @gradereport_user @javascript
Feature: View the user report as the student will see it
In order to know what grades students will see
As a teacher
Expand Down
1 change: 1 addition & 0 deletions grade/report/user/tests/behat/view_usereport.feature
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Feature: We can use the user report
| fullname | shortname | category |
| Course 1 | C1 | 0 |

@javascript
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
Expand Down
12 changes: 5 additions & 7 deletions grade/tests/behat/grade_aggregation.feature
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@core @core_grades
@core @core_grades @javascript
Feature: We can use calculated grade totals
In order to calculate grade totals
As an teacher
Expand Down Expand Up @@ -427,9 +427,9 @@ Feature: We can use calculated grade totals
And I should see "270.00 (27.27 %)" in the ".course" "css_element"
And I turn editing mode on
And I set the following settings for grade item "Manual item 2":
| Extra credit | 0 |
| Maximum grade | 200 |
| Rescale existing grades | No |
| Maximum grade | 200 |
| Extra credit | 0 |
And I give the grade "21.00" to the user "Student 1" for the grade item "Manual item 2"
And I press "Save changes"
And I give the grade "20.00" to the user "Student 1" for the grade item "Manual item 2"
Expand All @@ -438,9 +438,9 @@ Feature: We can use calculated grade totals
And I should see "270.00 (22.69 %)" in the ".course" "css_element"
And I turn editing mode on
And I set the following settings for grade item "Manual item 2":
| Extra credit | 0 |
| Maximum grade | 100 |
| Rescale existing grades | No |
| Maximum grade | 100 |
| Extra credit | 0 |
And I give the grade "21.00" to the user "Student 1" for the grade item "Manual item 2"
And I press "Save changes"
And I give the grade "20.00" to the user "Student 1" for the grade item "Manual item 2"
Expand All @@ -456,7 +456,6 @@ Feature: We can use calculated grade totals
And I navigate to "View > Grader report" in the course gradebook
And I should see "270.00 (24.77 %)" in the ".course" "css_element"

@javascript
Scenario: Natural aggregation from the setup screen
And I navigate to "Setup > Gradebook setup" in the course gradebook

Expand Down Expand Up @@ -509,7 +508,6 @@ Feature: We can use calculated grade totals
And I reset weights for grade category "Sub category 2 &"
And the field "Weight of Test assignment ten" matches value "33.333"

@javascript
Scenario: Natural aggregation with weights of zero
When I navigate to "View > Grader report" in the course gradebook
And I set the following settings for grade item "Course 1":
Expand Down
3 changes: 1 addition & 2 deletions grade/tests/behat/grade_aggregation_changes.feature
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@core @core_grades
@core @core_grades @javascript
Feature: Changing the aggregation of an item affects its weight and extra credit definition
In order to switch to another aggregation method
As an teacher
Expand Down Expand Up @@ -332,7 +332,6 @@ Feature: Changing the aggregation of an item affects its weight and extra credit
And the field "Extra credit" matches value "0"
And I press "Cancel"

@javascript
Scenario: Switching grade items between categories
# Move to same aggregation (Natural).
Given I navigate to "Setup > Gradebook setup" in the course gradebook
Expand Down
2 changes: 1 addition & 1 deletion grade/tests/behat/grade_average.feature
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@core @core_grades
@core @core_grades @javascript
Feature: Average grades are displayed in the gradebook
In order to check the expected results are displayed
As an admin
Expand Down
Loading

0 comments on commit 3001995

Please sign in to comment.