1 |
efrain |
1 |
@core @core_grades @gradereport_singleview @javascript
|
|
|
2 |
Feature: Given we have opted to search for a grade item, Lets find and search them.
|
|
|
3 |
Background:
|
|
|
4 |
Given the following "courses" exist:
|
|
|
5 |
| fullname | shortname | category | groupmode |
|
|
|
6 |
| Course 1 | C1 | 0 | 1 |
|
|
|
7 |
And the following "users" exist:
|
|
|
8 |
| username | firstname | lastname | email | idnumber |
|
|
|
9 |
| teacher1 | Teacher | 1 | teacher1@example.com | t1 |
|
|
|
10 |
| student1 | Student | 1 | student1@example.com | s1 |
|
|
|
11 |
And the following "course enrolments" exist:
|
|
|
12 |
| user | course | role |
|
|
|
13 |
| teacher1 | C1 | editingteacher |
|
|
|
14 |
| student1 | C1 | student |
|
|
|
15 |
And the following "activities" exist:
|
|
|
16 |
| activity | course | idnumber | name |
|
|
|
17 |
| assign | C1 | a1 | Test assignment one |
|
|
|
18 |
| assign | C1 | a2 | Test assignment two |
|
|
|
19 |
And I am on the "Course 1" "grades > Single view > View" page logged in as "teacher1"
|
|
|
20 |
And I change window size to "large"
|
|
|
21 |
|
|
|
22 |
Scenario: A teacher can search for and find a grade item to view
|
|
|
23 |
Given I click on "Grade items" "link" in the ".page-toggler" "css_element"
|
|
|
24 |
And I click on ".gradesearchwidget" "css_element"
|
|
|
25 |
When I confirm "Test assignment one" in "grade" search within the gradebook widget exists
|
|
|
26 |
And I confirm "Test assignment two" in "grade" search within the gradebook widget exists
|
|
|
27 |
Then I set the field "Search items" to "two"
|
|
|
28 |
And I wait until "Test assignment one" "option_role" does not exist
|
|
|
29 |
And I confirm "Test assignment one" in "grade" search within the gradebook widget does not exist
|
|
|
30 |
And I confirm "Test assignment two" in "grade" search within the gradebook widget exists
|
|
|
31 |
And I click on "Test assignment two" in the "grade" search widget
|
|
|
32 |
# The search input remains in the field on reload this is in keeping with other search implementations.
|
|
|
33 |
And I click on ".gradesearchwidget" "css_element"
|
|
|
34 |
And the field "Search items" matches value "two"
|
|
|
35 |
Then I set the field "Search items" to "Turtle"
|
|
|
36 |
And I should see "No results for \"Turtle\""
|
|
|
37 |
|
|
|
38 |
@accessibility
|
|
|
39 |
Scenario: A teacher can set focus and search using the input with a keyboard
|
|
|
40 |
# Basic tests for the page.
|
|
|
41 |
Given I click on "Grade items" "link" in the ".page-toggler" "css_element"
|
|
|
42 |
And I click on ".gradesearchwidget" "css_element"
|
|
|
43 |
And the page should meet accessibility standards
|
|
|
44 |
And the page should meet "wcag131, wcag141, wcag412" accessibility standards
|
|
|
45 |
And the page should meet accessibility standards with "wcag131, wcag141, wcag412" extra tests
|
|
|
46 |
# Move onto general keyboard navigation testing.
|
|
|
47 |
And I click on "Search items" "field"
|
|
|
48 |
And I wait until "Test assignment one" "option_role" exists
|
|
|
49 |
And I press the down key
|
|
|
50 |
And the focused element is "Search items" "field"
|
|
|
51 |
And ".active" "css_element" should exist in the "Test assignment one" "option_role"
|
|
|
52 |
And I press the up key
|
|
|
53 |
And the focused element is "Search items" "field"
|
|
|
54 |
And ".active" "css_element" should exist in the "Course total" "option_role"
|
|
|
55 |
And I press the down key
|
|
|
56 |
And the focused element is "Search items" "field"
|
|
|
57 |
And ".active" "css_element" should exist in the "Test assignment one" "option_role"
|
|
|
58 |
Then I set the field "Search items" to "Goodmeme"
|
|
|
59 |
And I wait until "Test assignment one" "option_role" does not exist
|
|
|
60 |
And I press the down key
|
|
|
61 |
And the focused element is "Search items" "field"
|
|
|
62 |
|
|
|
63 |
# Lets check the tabbing order.
|
|
|
64 |
And I set the field "Search items" to "one"
|
|
|
65 |
And I wait until "Test assignment one" "option_role" exists
|
|
|
66 |
And I press the tab key
|
|
|
67 |
And the focused element is "Clear search input" "button" in the ".grade-search" "css_element"
|
|
|
68 |
And I press the enter key
|
|
|
69 |
And I wait until the page is ready
|
|
|
70 |
And ".gradesearchwidget" "css_element" should exist
|