Skip to content

Commit

Permalink
MDL-72873 behat: Update behat tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Mihail Geshoski committed Dec 15, 2021
1 parent c744bdd commit 17bfe7e
Show file tree
Hide file tree
Showing 13 changed files with 38 additions and 25 deletions.
2 changes: 1 addition & 1 deletion admin/tool/behat/tests/behat/data_generators.feature
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ Feature: Set up contextual data for tests
And I navigate to "Outcomes" in current page administration
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"
And I press "Manage outcomes"
And the following should exist in the "generaltable" table:
| Full name | Short name | Scale |
| Grade outcome 2 | OT2 | Test Scale 1 |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ Feature: Allow to mark course as completed without cron for activity completion
Scenario: Course completion should not be updated when teacher imports grades with csv file
Given I log in as "teacher1"
And I am on "Completion course" course homepage
And I navigate to "Import" in the course gradebook
And I navigate to "CSV file" import page in the course gradebook
And I upload "lib/tests/fixtures/upload_grades.csv" file to "File" filemanager
And I press "Upload grades"
And I set the field "Map to" to "Email address"
Expand Down
8 changes: 4 additions & 4 deletions grade/export/txt/tests/behat/export.feature
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Feature: I need to export grades as text

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

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

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

@javascript
Scenario: Export grades as text using real, percentages and letters
When I navigate to "Export > Plain text file" in the course gradebook
When I navigate to "Plain text file" export page in the course gradebook
And I set the following fields to these values:
| Real | 1 |
| Percentage | 1 |
Expand Down
2 changes: 1 addition & 1 deletion grade/export/xml/tests/behat/export.feature
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Feature: I need to export grades as xml

@javascript
Scenario: Export grades as XML
When I navigate to "Export > XML file" in the course gradebook
When I navigate to "XML file" export page in the course gradebook
And I expand all fieldsets
And I set the field "Grade export decimal places" to "1"
And I press "Download"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ Feature: A teacher checks the grade history report in a course
And I give the grade "70.00" to the user "Student 2" for the grade item "The greatest assignment ever"
And I give the grade "80.00" to the user "Student 2" for the grade item "Rewarding assignment"
And I press "Save changes"
And I follow "Grade history"
And I navigate to "View > Grade history" in the course gradebook
When I press "Submit"
Then the following should exist in the "gradereport_history" table:
| First name/Surname | Email address | Favourite food | Grade item | Original grade | Revised grade | Grader |
Expand Down
13 changes: 12 additions & 1 deletion grade/tests/behat/grade_aggregation.feature
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ Feature: We can use calculated grade totals
And I press "Save changes"

Scenario: Mean of grades aggregation
When I navigate to "View > Grader report" in the course gradebook
And I set the following settings for grade item "Course 1":
| Aggregation | Mean of grades |
And I set the following settings for grade item "Sub category 1":
Expand All @@ -83,6 +84,7 @@ Feature: We can use calculated grade totals
And I should see "30.42 (30.42 %)" in the "overview-grade" "table"

Scenario: Weighted mean of grades aggregation
When I navigate to "View > Grader report" in the course gradebook
And I set the following settings for grade item "Course 1":
| Aggregation | Weighted mean of grades |
And I set the following settings for grade item "Sub category 1":
Expand All @@ -105,6 +107,7 @@ Feature: We can use calculated grade totals
And I should see "26.94 (26.94 %)" in the "overview-grade" "table"

Scenario: Simple weighted mean of grades aggregation
When I navigate to "View > Grader report" in the course gradebook
And I set the following settings for grade item "Course 1":
| Aggregation | Simple weighted mean of grades |
And I set the following settings for grade item "Sub category 1":
Expand All @@ -125,6 +128,7 @@ Feature: We can use calculated grade totals
And I should see "48.57 (48.57 %)" in the "overview-grade" "table"

Scenario: Mean of grades (with extra credits) aggregation
When I navigate to "View > Grader report" in the course gradebook
And I set the following settings for grade item "Course 1":
| Aggregation | Mean of grades (with extra credits) |
And I set the following settings for grade item "Sub category 1":
Expand All @@ -145,6 +149,7 @@ Feature: We can use calculated grade totals
And I should see "47.22 (47.22 %)" in the "overview-grade" "table"

Scenario: Median of grades aggregation
When I navigate to "View > Grader report" in the course gradebook
And I set the following settings for grade item "Course 1":
| Aggregation | Median of grades |
And I set the following settings for grade item "Sub category 1":
Expand All @@ -163,6 +168,7 @@ Feature: We can use calculated grade totals
And I should see "25.83 (25.83 %)" in the "overview-grade" "table"

Scenario: Lowest grade aggregation
When I navigate to "View > Grader report" in the course gradebook
And I set the following settings for grade item "Course 1":
| Aggregation | Lowest grade |
And I set the following settings for grade item "Sub category 1":
Expand All @@ -185,6 +191,7 @@ Feature: We can use calculated grade totals
And I should see "0.00 (0.00 %)" in the "overview-grade" "table"

Scenario: Highest grade aggregation
When I navigate to "View > Grader report" in the course gradebook
And I set the following settings for grade item "Course 1":
| Aggregation | Highest grade |
And I set the following settings for grade item "Sub category 1":
Expand All @@ -205,6 +212,7 @@ Feature: We can use calculated grade totals
And I should see "50.00 (50.00 %)" in the "overview-grade" "table"

Scenario: Mode of grades aggregation
When I navigate to "View > Grader report" in the course gradebook
And I set the following settings for grade item "Course 1":
| Aggregation | Mode of grades |
And I set the following settings for grade item "Sub category 1":
Expand Down Expand Up @@ -315,6 +323,7 @@ Feature: We can use calculated grade totals
And "Test outcome item one" row "Grade" column of "user-grade" table should contain "Excellent (100.00 %)"

Scenario: Natural aggregation
When I navigate to "View > Grader report" in the course gradebook
And I set the following settings for grade item "Sub category 1":
| Aggregation | Natural |
| Exclude empty grades | 0 |
Expand Down Expand Up @@ -502,7 +511,8 @@ Feature: We can use calculated grade totals

@javascript
Scenario: Natural aggregation with weights of zero
When I set the following settings for grade item "Course 1":
When I navigate to "View > Grader report" in the course gradebook
And I set the following settings for grade item "Course 1":
| Aggregation | Natural |
| Exclude empty grades | 0 |
And I set the following settings for grade item "Sub category 1":
Expand All @@ -528,6 +538,7 @@ Feature: We can use calculated grade totals
And I set the field "Show contribution to course total" to "Show"
And I set the field "Show weightings" to "Show"
And I press "Save changes"
And I navigate to "View > Grader report" in the course gradebook
Then I should see "75.00 (16.85 %)" in the ".course" "css_element"
And I navigate to "View > User report" in the course gradebook
And I select "Myself" from the "View report as" singleselect
Expand Down
1 change: 1 addition & 0 deletions grade/tests/behat/grade_aggregation_changes.feature
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ Feature: Changing the aggregation of an item affects its weight and extra credit
| Item b3 | C1 | Cat natural & | 1 | 0.10 | 1 |
| Item b4 | C1 | Cat natural & | 1 | 0 | 0 |
And I log in as "admin"
And I change window size to "large"
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
Expand Down
4 changes: 2 additions & 2 deletions grade/tests/behat/grade_letter_boundary.feature
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ Feature: We can customise the letter boundary of a course.
And I set the following fields to these values:
| Grade display type | Letter |
And I press "Save changes"
And I navigate to "Letters" in the course gradebook
And I follow "Edit grade letters"
And I navigate to "More > Grade letters" in the course gradebook
And I click on "Edit" "button"
And I set the following fields to these values:
| id_override | 1 |
| id_gradeboundary10 | 57 |
Expand Down
4 changes: 2 additions & 2 deletions grade/tests/behat/grade_letter_boundary_20160518.feature
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ Feature: We can customise the letter boundary of a course in gradebook version 2
And I set the following fields to these values:
| Grade display type | Letter |
And I press "Save changes"
And I navigate to "Letters" in the course gradebook
And I follow "Edit grade letters"
And I navigate to "More > Grade letters" in the course gradebook
And I click on "Edit" "button"
And I set the following fields to these values:
| id_override | 1 |
| id_gradeboundary10 | 57 |
Expand Down
8 changes: 4 additions & 4 deletions grade/tests/behat/grade_letter_logging.feature
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,18 @@ Feature: We can view the logs for any changes to grade letters.
And I set the following fields to these values:
| Grade display type | Letter |
And I press "Save changes"
And I navigate to "Letters" in the course gradebook
And I follow "Edit grade letters"
And I navigate to "More > Grade letters" in the course gradebook
And I click on "Edit" "button"
And I set the following fields to these values:
| id_override | 1 |
| id_gradeboundary10 | 57 |
And I press "Save changes"
And I follow "Edit grade letters"
And I click on "Edit" "button"
And I set the following fields to these values:
| id_override | 1 |
| id_gradeboundary10 | 50 |
And I press "Save changes"
And I follow "Edit grade letters"
And I click on "Edit" "button"
And I set the following fields to these values:
| id_override | 1 |
| id_gradeletter11 | |
Expand Down
9 changes: 5 additions & 4 deletions grade/tests/behat/grade_override_letter.feature
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Feature: Grade letters can be overridden
In order to test the grade letters functionality
As a teacher I override site defaults
and alter the grade letters
and alter the grade letters/edit/letter/index.php

Background:
Given the following "courses" exist:
Expand All @@ -16,7 +16,8 @@ Feature: Grade letters can be overridden
| teacher1 | C1 | editingteacher |
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I navigate to "Letters > Edit" in the course gradebook
And I navigate to "More > Grade letters" in the course gradebook
And I click on "Edit" "button"

Scenario Outline: Grade letters can be completely overridden
When I set the following fields to these values:
Expand Down Expand Up @@ -109,7 +110,7 @@ Feature: Grade letters can be overridden
| 49.99 % | 40.00 % | D |
| 39.99 % | 20.00 % | E |
| 19.99 % | 0.00 % | F |
When I follow "Edit grade letters"
When I click on "Edit" "button"
And I set the following fields to these values:
| override | 1 |
| Grade letter 1 | A |
Expand Down Expand Up @@ -176,7 +177,7 @@ Feature: Grade letters can be overridden
| 59.99 % | 50.00 % | C |
| 49.99 % | 40.00 % | D |
| 39.99 % | 0.00 % | F |
When I follow "Edit grade letters"
When I click on "Edit" "button"
And I set the following fields to these values:
| override | 1 |
| Grade letter 1 | α |
Expand Down
4 changes: 2 additions & 2 deletions grade/tests/behat/grade_view.feature
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ Feature: We can enter in grades and view reports from the gradebook

Scenario: Grade a grade item and ensure the results display correctly in the gradebook
When I navigate to "View > User report" in the course gradebook
And "Grader report" "link" should exist
And "Outcomes report" "link" should exist
And the "jump" select box should contain "Grader report"
And the "jump" select box should contain "Outcomes report"
And the "Select all or one user" select box should contain "All users (1)"
And I log out
And I log in as "student1"
Expand Down
4 changes: 2 additions & 2 deletions mod/assign/tests/behat/quickgrading.feature
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ Feature: In an assignment, teachers grade multiple students on one page
When I log in as "teacher1"
And I am on "Course 1" course homepage
And I navigate to "Outcomes" in current page administration
And I follow "Edit outcomes"
And I press "Manage outcomes"
And I press "Add a new outcome"
And I follow "Add a new scale"
And I set the following fields to these values:
Expand All @@ -64,7 +64,7 @@ Feature: In an assignment, teachers grade multiple students on one page
And I press "Save changes"
And I am on "Course 1" course homepage
And I navigate to "Outcomes" in current page administration
And I follow "Edit outcomes"
And I press "Manage outcomes"
And I press "Add a new outcome"
And I set the following fields to these values:
| Full name | M8d skillZ! |
Expand Down

0 comments on commit 17bfe7e

Please sign in to comment.