Skip to content

Commit

Permalink
MDL-80744 core_grades: Deprecate comboboxsearch behat step definitions
Browse files Browse the repository at this point in the history
The comboboxsearch component now has uses beyond the grade subcomponent
and includes alternative step definitions in behat_general.php. This
change deprecates the redundant behat step definitions related to this
component in behat_grade.php and replaces current usages with the
alternative definitions.
  • Loading branch information
Mihail Geshoski authored and ilyatregubov committed Jun 25, 2024
1 parent 3c4ad8b commit 7520c36
Show file tree
Hide file tree
Showing 36 changed files with 401 additions and 347 deletions.
20 changes: 20 additions & 0 deletions .upgradenotes/MDL-80744-2024062407163290.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
issueNumber: MDL-80744
notes:
core_grades:
- message: >-
The behat step definition
behat_grade::i_confirm_in_search_within_the_gradebook_widget_exists has
been deprecated. Please use
behat_general::i_confirm_in_search_combobox_exists instead.
type: deprecated
- message: >-
The behat step definition
behat_grade::i_confirm_in_search_within_the_gradebook_widget_does_not_exist
has been deprecated. Please use
behat_general::i_confirm_in_search_combobox_does_not_exist instead.
type: deprecated
- message: >-
The behat step definition behat_grade::i_click_on_in_search_widget has
been deprecated. Please use behat_general::i_click_on_in_search_combobox
instead.
type: deprecated
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ Feature: Allow to mark course as completed without cron for activity completion
Given I am on the "Completion course" "grades > Single View > View" page logged in as "teacher1"
And I click on "Users" "link" in the ".page-toggler" "css_element"
And I turn editing mode on
And I click on "Student First" in the "user" search widget
And I click on "Student First" in the "Search users" search combo box
And I set the field "Override for Test assignment name" to "1"
When I set the following fields to these values:
| Grade for Test assignment name | 10.00 |
Expand Down
32 changes: 16 additions & 16 deletions grade/report/grader/tests/behat/groupsearch.feature
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ Feature: Group searching functionality within the grader report.
Then ".groupsearchwidget" "css_element" should not exist

Scenario: A teacher can search for and find a group to display
Given I confirm "Tutor group" in "group" search within the gradebook widget exists
And I confirm "Marker group" in "group" search within the gradebook widget exists
Given I confirm "Tutor group" exists in the "Search groups" search combo box
And I confirm "Marker group" exists in the "Search groups" search combo box
When I set the field "Search groups" to "tutor"
And I wait until "Marker group" "option_role" does not exist
Then I confirm "Tutor group" in "group" search within the gradebook widget exists
And I confirm "Marker group" in "group" search within the gradebook widget does not exist
And I click on "Tutor group" in the "group" search widget
Then I confirm "Tutor group" exists in the "Search groups" search combo box
And I confirm "Marker group" does not exist in the "Search groups" search combo box
And I click on "Tutor group" in the "Search groups" search combo box
# The search input remains in the field on reload this is in keeping with other search implementations.
And I click on ".groupsearchwidget" "css_element"
And the field "Search groups" matches value "tutor"
Expand All @@ -52,22 +52,22 @@ Feature: Group searching functionality within the grader report.
Scenario: A teacher can only see the group members in the 'user' search widget after selecting a group option
# Confirm that all users are initially displayed in the 'user' search widget.
Given I set the field "Search users" to "Student"
And I confirm "Student 1" in "user" search within the gradebook widget exists
And I confirm "Student 2" in "user" search within the gradebook widget exists
And I confirm "Student 1" exists in the "Search users" search combo box
And I confirm "Student 2" exists in the "Search users" search combo box
# Select a particular group from the 'group' search widget.
When I click on "Default group" in the "group" search widget
When I click on "Default group" in the "Search groups" search combo box
# Confirm that only users which are members of the selected group are displayed in the 'user' search widget.
And I set the field "Search users" to "Student"
Then I confirm "Student 1" in "user" search within the gradebook widget exists
And I confirm "Student 2" in "user" search within the gradebook widget does not exist
And I click on "Tutor group" in the "group" search widget
Then I confirm "Student 1" exists in the "Search users" search combo box
And I confirm "Student 2" does not exist in the "Search users" search combo box
And I click on "Tutor group" in the "Search groups" search combo box
And I set the field "Search users" to "Student"
And I confirm "Student 1" in "user" search within the gradebook widget does not exist
And I confirm "Student 2" in "user" search within the gradebook widget does not exist
And I click on "All participants" in the "group" search widget
And I confirm "Student 1" does not exist in the "Search users" search combo box
And I confirm "Student 2" does not exist in the "Search users" search combo box
And I click on "All participants" in the "Search groups" search combo box
And I set the field "Search users" to "Student"
And I confirm "Student 1" in "user" search within the gradebook widget exists
And I confirm "Student 2" in "user" search within the gradebook widget exists
And I confirm "Student 1" exists in the "Search users" search combo box
And I confirm "Student 2" exists in the "Search users" search combo box

@accessibility
Scenario: A teacher can set focus and search using the input with a keyboard
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ Feature: Within the grader report, test that we can open our generic filter drop

Scenario: A teacher can search and then filter by first or last name
Given I set the field "Search users" to "Student 1"
And I click on "Student 1" in the "user" search widget
And I click on "Student 1" in the "Search users" search combo box
And I click on "Filter by name" "combobox"
And I select "S" in the "First name" "core_grades > initials bar"
When I press "Apply"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ Feature: Within the grader report, test that we can search for users
| Teacher 1 |
When I set the field "Search users" to "Turtle"
And I wait until "View all results (1)" "option_role" exists
And I confirm "Turtle Manatee" in "user" search within the gradebook widget exists
And I confirm "User Example" in "user" search within the gradebook widget does not exist
And I confirm "Turtle Manatee" exists in the "Search users" search combo box
And I confirm "User Example" does not exist in the "Search users" search combo box
And I click on "Turtle Manatee" "list_item"
# Business case: This will trigger a page reload and can not dynamically update the table.
And I wait until the page is ready
Expand All @@ -76,7 +76,7 @@ Feature: Within the grader report, test that we can search for users

Scenario: A teacher can search the grader report to find specified users
# Case: Standard search.
Given I click on "Dummy" in the "user" search widget
Given I click on "Dummy" in the "Search users" search combo box
And the following should exist in the "user-grades" table:
| -1- |
| Dummy User |
Expand Down Expand Up @@ -106,14 +106,14 @@ Feature: Within the grader report, test that we can search for users
# Case: Multiple users found and select only one result.
Then I set the field "Search users" to "User"
And I wait until "View all results (3)" "option_role" exists
And I confirm "Dummy User" in "user" search within the gradebook widget exists
And I confirm "User Example" in "user" search within the gradebook widget exists
And I confirm "User Test" in "user" search within the gradebook widget exists
And I confirm "Turtle Manatee" in "user" search within the gradebook widget does not exist
And I confirm "Dummy User" exists in the "Search users" search combo box
And I confirm "User Example" exists in the "Search users" search combo box
And I confirm "User Test" exists in the "Search users" search combo box
And I confirm "Turtle Manatee" does not exist in the "Search users" search combo box
# Check if the matched field names (by lines) includes some identifiable info to help differentiate similar users.
And I confirm "User ([email protected])" in "user" search within the gradebook widget exists
And I confirm "User ([email protected])" in "user" search within the gradebook widget exists
And I confirm "User ([email protected])" in "user" search within the gradebook widget exists
And I confirm "User ([email protected])" exists in the "Search users" search combo box
And I confirm "User ([email protected])" exists in the "Search users" search combo box
And I confirm "User ([email protected])" exists in the "Search users" search combo box
And I click on "Dummy User" "list_item"
And I wait until the page is ready
And the following should exist in the "user-grades" table:
Expand Down Expand Up @@ -156,7 +156,7 @@ Feature: Within the grader report, test that we can search for users
| Dummy User |

Scenario: A teacher can quickly tell that a search is active on the current table
When I click on "Turtle" in the "user" search widget
When I click on "Turtle" in the "Search users" search combo box
# The search input should contain the name of the user we have selected, so that it is clear that the result pertains to a specific user.
Then the field "Search users" matches value "Turtle Manatee"
# Test if we can then further retain the turtle result set and further filter from there.
Expand All @@ -171,54 +171,54 @@ Feature: Within the grader report, test that we can search for users
And I set the field "Search users" to "@example.com"
And I wait until "View all results (5)" "option_role" exists
# Note: All learners match this email & showing emails is current default.
And I confirm "Dummy User" in "user" search within the gradebook widget exists
And I confirm "User Example" in "user" search within the gradebook widget exists
And I confirm "User Test" in "user" search within the gradebook widget exists
And I confirm "Student 1" in "user" search within the gradebook widget exists
And I confirm "Turtle Manatee" in "user" search within the gradebook widget exists
And I confirm "Dummy User" exists in the "Search users" search combo box
And I confirm "User Example" exists in the "Search users" search combo box
And I confirm "User Test" exists in the "Search users" search combo box
And I confirm "Student 1" exists in the "Search users" search combo box
And I confirm "Turtle Manatee" exists in the "Search users" search combo box

# Search on the country field.
When I set the field "Search users" to "JP"
And I wait until "Turtle Manatee" "list_item" does not exist
And I confirm "Dummy User" in "user" search within the gradebook widget exists
And I confirm "User Test" in "user" search within the gradebook widget exists
And I confirm "Dummy User" exists in the "Search users" search combo box
And I confirm "User Test" exists in the "Search users" search combo box

# Search on the city field.
And I set the field "Search users" to "Hanoi"
And I wait until "User Test" "list_item" does not exist
Then I confirm "Student 1" in "user" search within the gradebook widget exists
Then I confirm "Student 1" exists in the "Search users" search combo box

# Search on the institution field.
And I set the field "Search users" to "ABCD"
And I wait until "Dummy User" "list_item" exists
And I confirm "User Example" in "user" search within the gradebook widget exists
And I confirm "User Test" in "user" search within the gradebook widget exists
And I confirm "Student 1" in "user" search within the gradebook widget exists
And I confirm "Turtle Manatee" in "user" search within the gradebook widget exists
And I confirm "User Example" exists in the "Search users" search combo box
And I confirm "User Test" exists in the "Search users" search combo box
And I confirm "Student 1" exists in the "Search users" search combo box
And I confirm "Turtle Manatee" exists in the "Search users" search combo box

# Search on the department field.
And I set the field "Search users" to "ABC3"
And I wait until "User Example" "list_item" does not exist
And I confirm "User Test" in "user" search within the gradebook widget exists
And I confirm "Turtle Manatee" in "user" search within the gradebook widget exists
And I confirm "User Test" exists in the "Search users" search combo box
And I confirm "Turtle Manatee" exists in the "Search users" search combo box

# Search on the phone1 field.
And I set the field "Search users" to "4365899871"
And I wait until "User Test" "list_item" does not exist
And I confirm "Dummy User" in "user" search within the gradebook widget exists
And I confirm "Dummy User" exists in the "Search users" search combo box

# Search on the phone2 field.
And I set the field "Search users" to "2149871323"
And I wait until "Dummy User" "list_item" does not exist
And I confirm "User Test" in "user" search within the gradebook widget exists
And I confirm "User Test" exists in the "Search users" search combo box

# Search on the institution field then press enter to show the record set.
And I set the field "Search users" to "ABC"
And I wait until "Turtle Manatee" "list_item" exists
And I confirm "Dummy User" in "user" search within the gradebook widget exists
And I confirm "User Example" in "user" search within the gradebook widget exists
And I confirm "User Test" in "user" search within the gradebook widget exists
And I confirm "Student 1" in "user" search within the gradebook widget exists
And I confirm "Dummy User" exists in the "Search users" search combo box
And I confirm "User Example" exists in the "Search users" search combo box
And I confirm "User Test" exists in the "Search users" search combo box
And I confirm "Student 1" exists in the "Search users" search combo box
And I press the down key
And I press the enter key
And I wait "1" seconds
Expand Down Expand Up @@ -305,7 +305,7 @@ Feature: Within the grader report, test that we can search for users

# Begin the search checking if we are adhering the filters.
When I set the field "Search users" to "Turtle"
Then I confirm "Turtle Manatee" in "user" search within the gradebook widget does not exist
Then I confirm "Turtle Manatee" does not exist in the "Search users" search combo box

Scenario: A teacher can reset the search and filters all at once
Given I set the field "Search users" to "Turtle"
Expand All @@ -320,7 +320,7 @@ Feature: Within the grader report, test that we can search for users
And the following should exist in the "user-grades" table:
| -1- |
| Turtle Manatee |
And I click on "Default group" in the "group" search widget
And I click on "Default group" in the "Search groups" search combo box
And the following should exist in the "user-grades" table:
| -1- |
| Turtle Manatee |
Expand All @@ -344,7 +344,7 @@ Feature: Within the grader report, test that we can search for users
When I set the field "Search users" to "42"
# One of the users' phone numbers also matches.
And I wait until "View all results (2)" "option_role" exists
Then I confirm "Student s42" in "user" search within the gradebook widget exists
Then I confirm "Student s42" exists in the "Search users" search combo box

Scenario: As a teacher I save grades using search and pagination
Given "42" "users" exist with the following data:
Expand Down
10 changes: 5 additions & 5 deletions grade/report/singleview/tests/behat/gradeitemsearch.feature
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ Feature: Given we have opted to search for a grade item, Lets find and search th
Scenario: A teacher can search for and find a grade item to view
Given I click on "Grade items" "link" in the ".page-toggler" "css_element"
And I click on ".gradesearchwidget" "css_element"
When I confirm "Test assignment one" in "grade" search within the gradebook widget exists
And I confirm "Test assignment two" in "grade" search within the gradebook widget exists
When I confirm "Test assignment one" exists in the "Search items" search combo box
And I confirm "Test assignment two" exists in the "Search items" search combo box
Then I set the field "Search items" to "two"
And I wait until "Test assignment one" "option_role" does not exist
And I confirm "Test assignment one" in "grade" search within the gradebook widget does not exist
And I confirm "Test assignment two" in "grade" search within the gradebook widget exists
And I click on "Test assignment two" in the "grade" search widget
And I confirm "Test assignment one" does not exist in the "Search items" search combo box
And I confirm "Test assignment two" exists in the "Search items" search combo box
And I click on "Test assignment two" in the "Search items" search combo box
# The search input remains in the field on reload this is in keeping with other search implementations.
And I click on ".gradesearchwidget" "css_element"
And the field "Search items" matches value "two"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Feature: Given we land on the index page, select what type of report we wish to
Given I am on the "Course 1" "grades > Single view > View" page logged in as "teacher1"
And I click on "Grade items" "link" in the ".page-toggler" "css_element"
And "Search users" "field" should not exist
And I confirm "Test assignment one" in "grade" search within the gradebook widget exists
And I confirm "Test assignment one" exists in the "Search items" search combo box
When I click on "Users" "link" in the ".page-toggler" "css_element"
Then "Search users" "field" should exist
And "Select a grade item" "combobox" should not exist
Loading

0 comments on commit 7520c36

Please sign in to comment.