Skip to content

Commit

Permalink
MDL-81096 Quiz reports: replace deprecated behat step with the new one
Browse files Browse the repository at this point in the history
  • Loading branch information
Khoa Nguyen committed Oct 16, 2024
1 parent b5faf4b commit f498570
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 49 deletions.
54 changes: 27 additions & 27 deletions mod/quiz/report/overview/tests/behat/basic.feature
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Feature: Basic use of the Grades report
| student3 | C1 | student |
| student4 | C1 | student |
And the following "groups" exist:
| course | idnumber | name |
| course | idnumber | name |
| C1 | G1 | <span class="multilang" lang="en">English</span><span class="multilang" lang="es">Spanish</span> |
| C1 | G2 | Group 2 |
And the following "group members" exist:
Expand Down Expand Up @@ -107,9 +107,9 @@ Feature: Basic use of the Grades report
And I should see "100.00" in the "S2 Student2" "table_row"

# Verify groups are displayed correctly.
And I click on "All participants" in the "group" search widget
And I click on "All participants" in the "Search groups" search combo box
And I wait until "English" "option_role" exists
And I click on "English" in the "group" search widget
And I click on "English" in the "Search groups" search combo box
And I should see "Number of students in group 'English' achieving grade ranges"

@javascript
Expand All @@ -132,12 +132,12 @@ Feature: Basic use of the Grades report
And I click on "S1 Student1" "list_item"
And I wait until the page is ready
Then the following should exist in the "attempts" table:
| First name / Last name |
| S1 Student1 |
| First name |
| S1 Student1 |
And the following should not exist in the "attempts" table:
| First name / Last name |
| S2 Student2 |
| Four Student |
| First name |
| S2 Student2 |
| Four Student |

@javascript
Scenario: A teacher can filter the user attempt by name in the grades report.
Expand All @@ -159,34 +159,34 @@ Feature: Basic use of the Grades report
And I press "Apply"
Then I should not see "Nothing to display"
And the following should exist in the "attempts" table:
| First name / Last name |
| Four Student |
| First name |
| Four Student |
And the following should not exist in the "attempts" table:
| First name / Last name |
| S1 Student1 |
| S2 Student2 |
| First name |
| S1 Student1 |
| S2 Student2 |

@javascript
Scenario: A teacher can filter the user attempt by group in the grades report.
When I am on the "Quiz 1" "quiz activity" page logged in as teacher1
And I navigate to "Results" in current page administration
And I click on "All participants" in the "group" search widget
And I click on "All participants" in the "Search groups" search combo box
And I wait until "Group 2" "option_role" exists
And I click on "Group 2" in the "group" search widget
And I click on "Group 2" in the "Search groups" search combo box
And the following should exist in the "attempts" table:
| First name / Last name |
| Four Student |
| First name |
| Four Student |
And the following should not exist in the "attempts" table:
| First name / Last name |
| S1 Student1 |
| S2 Student2 |
And I click on "Group 2" in the "group" search widget
| First name |
| S1 Student1 |
| S2 Student2 |
And I click on "Group 2" in the "Search groups" search combo box
And I wait until "English" "option_role" exists
And I click on "English" in the "group" search widget
And I click on "English" in the "Search groups" search combo box
Then the following should not exist in the "attempts" table:
| First name / Last name |
| Four Student |
| First name |
| Four Student |
And the following should exist in the "attempts" table:
| First name / Last name |
| S1 Student1 |
| S2 Student2 |
| First name |
| S1 Student1 |
| S2 Student2 |
40 changes: 20 additions & 20 deletions mod/quiz/report/responses/tests/behat/basic.feature
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,11 @@ Feature: Basic use of the Responses report
And I click on "Student One" "list_item"
And I wait until the page is ready
Then the following should exist in the "responses" table:
| First name / Last name |
| Student One |
| First name |
| Student One |
And the following should not exist in the "responses" table:
| First name / Last name |
| Student Two |
| First name |
| Student Two |

@javascript
Scenario: A teacher can filter the user attempt by name in the responses report.
Expand Down Expand Up @@ -140,11 +140,11 @@ Feature: Basic use of the Responses report
And I press "Apply"
Then I should not see "Nothing to display"
And the following should exist in the "responses" table:
| First name / Last name |
| Student Two |
| First name |
| Student Two |
And the following should not exist in the "responses" table:
| First name / Last name |
| Student One |
| First name |
| Student One |

@javascript
Scenario: A teacher can filter the user attempt by group in the responses report.
Expand All @@ -158,21 +158,21 @@ Feature: Basic use of the Responses report
| slot | response |
| 1 | 3.0 |
And I am on the "Quiz 1" "mod_quiz > Responses report" page logged in as teacher
And I click on "All participants" in the "group" search widget
And I click on "All participants" in the "Search groups" search combo box
And I wait until "Group 1" "option_role" exists
And I click on "Group 1" in the "group" search widget
And I click on "Group 1" in the "Search groups" search combo box
And the following should exist in the "responses" table:
| First name / Last name |
| Student One |
| First name |
| Student One |
And the following should not exist in the "responses" table:
| First name / Last name |
| Student Two |
And I click on "Group 1" in the "group" search widget
| First name |
| Student Two |
And I click on "Group 1" in the "Search groups" search combo box
And I wait until "Group 2" "option_role" exists
And I click on "Group 2" in the "group" search widget
And I click on "Group 2" in the "Search groups" search combo box
Then the following should not exist in the "responses" table:
| First name / Last name |
| Student One |
| First name |
| Student One |
And the following should exist in the "responses" table:
| First name / Last name |
| Student Two |
| First name |
| Student Two |
4 changes: 2 additions & 2 deletions mod/quiz/tests/behat/group_mode.feature
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ Feature: Viewing results by group
Given I am on the "<quiz>" "quiz activity" page logged in as "<user>"
And I follow "Results"
Then I <all> "All participants" in the ".groupsearchwidget" "css_element"
And I confirm "Group 1" in "group" search within the gradebook widget <G1>
And I confirm "Group 2" in "group" search within the gradebook widget <G2>
And I confirm "Group 1" <G1> in the "Search groups" search combo box
And I confirm "Group 2" <G2> in the "Search groups" search combo box
And I <error> "Sorry, but you need to be part of a group to see this page."
And I should not see "Group 3"

Expand Down

0 comments on commit f498570

Please sign in to comment.