MDL-75837 behat: Update behat tests

This commit is contained in:
Mihail Geshoski 2022-11-04 02:16:40 +08:00
parent c501d1ac97
commit 8d3724c91e
6 changed files with 43 additions and 54 deletions

View File

@ -22,10 +22,10 @@ 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 navigate to "View > Single view" in the course gradebook
And I click on "Grade items" "link" in the ".page-toggler" "css_element"
When I click on ".gradewidget" "css_element"
Then I confirm "Test assignment one" in "Select a grade item" search within the gradebook widget exists
And I confirm "Test assignment two" in "Select a grade item" search within the gradebook widget exists
When I click on ".search-widget[data-searchtype='grade']" "css_element"
Then 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
And I set the field "searchinput" to "two"
And I wait "1" seconds
And I confirm "Test assignment two" in "Select a grade item" search within the gradebook widget exists
And I confirm "Test assignment one" in "Select a grade item" search within the gradebook widget does not exist
And I confirm "Test assignment two" in "grade" search within the gradebook widget exists
And I confirm "Test assignment one" in "grade" search within the gradebook widget does not exist

View File

@ -21,9 +21,10 @@ Feature: Given we land on the index page, select what type of report we wish to
Scenario: I switch between the two report types within singleview
Given I navigate to "View > Single view" in the course gradebook
And I click on "Grade items" "link" in the ".page-toggler" "css_element"
When I click on ".gradewidget" "css_element"
Then I wait until "Select a grade item" "dialogue" exists
And I click on "Close" "button" in the "Select a grade item" "dialogue"
And I click on "Users" "link" in the ".page-toggler" "css_element"
And I click on ".userwidget" "css_element"
And I wait until "Select a user" "dialogue" exists
And ".search-widget[data-searchtype='user']" "css_element" should not exist
And ".search-widget[data-searchtype='grade']" "css_element" should exist
And I confirm "assign" in "grade" search within the gradebook widget exists
When I click on "Users" "link" in the ".page-toggler" "css_element"
Then ".search-widget[data-searchtype='grade']" "css_element" should not exist
And ".search-widget[data-searchtype='user']" "css_element" should exist
And I confirm "student1" in "user" search within the gradebook widget exists

View File

@ -59,7 +59,7 @@ Feature: We can use Single view
Scenario: I can update grades, add feedback and exclude grades.
Given I navigate to "View > Single view" in the course gradebook
And I click on "Users" "link"
And I click on "Users" "link" in the ".page-toggler" "css_element"
And I click on "Student" in the "user" search widget
And I turn editing mode on
And I set the field "Override for Test assignment one" to "1"
@ -99,7 +99,7 @@ Feature: We can use Single view
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 click on "Users" "link"
And I click on "Users" "link" in the ".page-toggler" "css_element"
And I click on "Student" in the "user" search widget
And I turn editing mode on
And the "Exclude for Test assignment one" "checkbox" should be disabled

View File

@ -23,12 +23,12 @@ Feature: Within the singleview report, a teacher can search for users.
Given I navigate to "View > Single view" in the course gradebook
When I click on "Users" "link" in the ".page-toggler" "css_element"
And I wait until the page is ready
And I click on ".userwidget" "css_element"
Then I confirm "Student 1" in "Select a user" search within the gradebook widget exists
And I confirm "Student 2" in "Select a user" search within the gradebook widget exists
And I confirm "Student 32" in "Select a user" search within the gradebook widget exists
And I click on ".search-widget[data-searchtype='user']" "css_element"
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 exists
And I confirm "Student 32" in "user" search within the gradebook widget exists
And I set the field "searchinput" to "2"
And I wait "1" seconds
And I confirm "Student 2" in "Select a user" search within the gradebook widget exists
And I confirm "Student 32" in "Select a user" search within the gradebook widget exists
And I confirm "Student 1" in "Select a user" search within the gradebook widget does not exist
And I confirm "Student 2" in "user" search within the gradebook widget exists
And I confirm "Student 32" in "user" search within the gradebook widget exists
And I confirm "Student 1" in "user" search within the gradebook widget does not exist

View File

@ -28,50 +28,38 @@ Feature: Group searching functionality within the user report.
Scenario: A teacher can see the 'group' search widget only when group mode is enabled in the course
Given I navigate to "View > User report" in the course gradebook
And ".groupwidget" "css_element" should exist
And ".search-widget[data-searchtype='group']" "css_element" should exist
And I am on "Course 1" course homepage
And I navigate to "Settings" in current page administration
And I set the following fields to these values:
| id_groupmode | No groups |
And I press "Save and display"
When I navigate to "View > User report" in the course gradebook
Then ".groupwidget" "css_element" should not exist
Then ".search-widget[data-searchtype='group']" "css_element" should not exist
Scenario: A teacher can search for and find a group to find a user in
Given I navigate to "View > User report" in the course gradebook
And I click on ".groupwidget" "css_element"
And I wait until "Select a group" "dialogue" exists
And I should see "Tutor group" in the "Select a group" "dialogue"
And I should see "Marker group" in the "Select a group" "dialogue"
And I click on ".search-widget[data-searchtype='group']" "css_element"
And 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
When I set the field "searchinput" to "tutor"
And I wait "1" seconds
Then I should see "Tutor group" in the "Select a group" "dialogue"
And I should not see "Marker group" in the "Select a group" "dialogue"
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
Scenario: A teacher can only see the group members in the 'user' search widget after selecting a group option
Given I navigate to "View > User report" in the course gradebook
# Confirm that all users are initially displayed in the 'user' search widget.
And I click on ".userwidget" "css_element"
And I wait until "Select a user" "dialogue" exists
And I should see "Student 1" in the "Select a user" "dialogue"
And I should see "Student 2" in the "Select a user" "dialogue"
And I click on "Close" "button" in the "Select a user" "dialogue"
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
# Select a particular group from the 'group' search widget.
When I click on "Default group" in the "group" search widget
# Confirm that only users which are members of the selected group are displayed in the 'user' search widget.
And I click on ".userwidget" "css_element"
And I wait until "Select a user" "dialogue" exists
Then I should see "Student 1" in the "Select a user" "dialogue"
And I should not see "Student 2" in the "Select a user" "dialogue"
And I click on "Close" "button" in the "Select a user" "dialogue"
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 does not exist
And I click on "Tutor group" in the "group" search widget
And I click on ".userwidget" "css_element"
And I wait until "Select a user" "dialogue" exists
And I should not see "Student 1" in the "Select a user" "dialogue"
And I should not see "Student 2" in the "Select a user" "dialogue"
And I click on "Close" "button" in the "Select a user" "dialogue"
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 click on ".userwidget" "css_element"
And I wait until "Select a user" "dialogue" exists
And I should see "Student 1" in the "Select a user" "dialogue"
And I should see "Student 2" in the "Select a user" "dialogue"
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

View File

@ -21,12 +21,12 @@ Feature: Within the User report, a teacher can search for users.
Scenario: A teacher can search for and find a user to view
Given I navigate to "View > User report" in the course gradebook
When I click on ".userwidget" "css_element"
Then I confirm "Student 1" in "Select a user" search within the gradebook widget exists
And I confirm "Student 2" in "Select a user" search within the gradebook widget exists
And I confirm "Student 32" in "Select a user" search within the gradebook widget exists
When I click on ".search-widget[data-searchtype='user']" "css_element"
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 exists
And I confirm "Student 32" in "user" search within the gradebook widget exists
And I set the field "searchinput" to "2"
And I wait "1" seconds
And I confirm "Student 2" in "Select a user" search within the gradebook widget exists
And I confirm "Student 32" in "Select a user" search within the gradebook widget exists
And I confirm "Student 1" in "Select a user" search within the gradebook widget does not exist
And I confirm "Student 2" in "user" search within the gradebook widget exists
And I confirm "Student 32" in "user" search within the gradebook widget exists
And I confirm "Student 1" in "user" search within the gradebook widget does not exist