From 3cf55c3c3065291860676ef8db48db87c775ca09 Mon Sep 17 00:00:00 2001 From: Mathew May Date: Mon, 11 Sep 2023 09:09:53 +0200 Subject: [PATCH] MDL-78885 gradereport_singleview: Behat updates after a11y fixes --- .../singleview/tests/behat/singleview.feature | 4 ++-- .../singleview/tests/behat/usersearch.feature | 17 +++++++++-------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/grade/report/singleview/tests/behat/singleview.feature b/grade/report/singleview/tests/behat/singleview.feature index fd58bf8dcf1..1cb9f29b24c 100644 --- a/grade/report/singleview/tests/behat/singleview.feature +++ b/grade/report/singleview/tests/behat/singleview.feature @@ -150,9 +150,9 @@ Feature: We can use Single view Given I click on user menu "Grainne Beauchamp" And I choose "Single view for this user" in the open action menu Then I should see "Gronya,Beecham" - And I follow "Nee,Chumlee" + And I click on "Nee,Chumlee" "link" in the ".stickyfooter" "css_element" Then I should see "Nee,Chumlee" - And I follow "Gronya,Beecham" + And I click on "Gronya,Beecham" "link" in the ".stickyfooter" "css_element" Then I should see "Gronya,Beecham" And I open the action menu in "Test assignment four" "table_row" And I choose "Show all grades" in the open action menu diff --git a/grade/report/singleview/tests/behat/usersearch.feature b/grade/report/singleview/tests/behat/usersearch.feature index 76edbc2d663..9cf56cd8e76 100644 --- a/grade/report/singleview/tests/behat/usersearch.feature +++ b/grade/report/singleview/tests/behat/usersearch.feature @@ -105,10 +105,11 @@ Feature: Within the singleview report, a teacher can search for users. And I wait until the page is ready # The search input remains in the field on reload this is in keeping with other search implementations. When the field "Search users" matches value "Turtle" - And "Turtle Manatee" "option_role" should not exist + # The users get preloaded for accessibility reasons. + And "Turtle Manatee" "option_role" should exist # Test if we can then further retain the turtle result set and further filter from there. Then I set the field "Search users" to "Turtle plagiarism" - And "Turtle Manatee" "list_item" should not exist + And I wait until "Turtle Manatee" "option_role" does not exist And I should see "No results for \"Turtle plagiarism\"" Scenario: A teacher can search for values besides the users' name @@ -186,15 +187,15 @@ Feature: Within the singleview report, a teacher can search for users. # Move onto general keyboard navigation testing. When I wait until "Turtle Manatee" "option_role" exists And I press the down key - And the focused element is "Student 1" "option_role" + And ".active" "css_element" should exist in the "Student 1" "option_role" And I press the end key - And the focused element is "Dummy User" "option_role" + And ".active" "css_element" should exist in the "Dummy User" "option_role" And I press the home key - And the focused element is "Student 1" "option_role" + And ".active" "css_element" should exist in the "Student 1" "option_role" And I press the up key - And the focused element is "Dummy User" "option_role" + And ".active" "css_element" should exist in the "Dummy User" "option_role" And I press the down key - And the focused element is "Student 1" "option_role" + And ".active" "css_element" should exist in the "Student 1" "option_role" And I press the escape key And the focused element is "Search users" "field" Then I set the field "Search users" to "Goodmeme" @@ -206,7 +207,7 @@ Feature: Within the singleview report, a teacher can search for users. And I set the field "Search users" to "ABC" And I wait until "Turtle Manatee" "option_role" exists And I press the down key - And the focused element is "Student 1" "option_role" + And ".active" "css_element" should exist in the "Student 1" "option_role" # Lets check the tabbing order. And I set the field "Search users" to "ABC"