1 |
efrain |
1 |
@core @core_courseformat
|
|
|
2 |
Feature: Verify that courseindex is usable with the keyboard
|
|
|
3 |
In order to use the course index
|
|
|
4 |
As a user
|
|
|
5 |
I need to be able to navigate it without a mouse
|
|
|
6 |
|
|
|
7 |
Background:
|
|
|
8 |
Given the following "course" exists:
|
|
|
9 |
| fullname | Course 1 |
|
|
|
10 |
| shortname | C1 |
|
|
|
11 |
| category | 0 |
|
|
|
12 |
| enablecompletion | 1 |
|
|
|
13 |
| numsections | 3 |
|
|
|
14 |
| initsections | 1 |
|
|
|
15 |
And the following "activities" exist:
|
|
|
16 |
| activity | name | intro | course | idnumber | section |
|
|
|
17 |
| assign | Activity sample 1 | Test assignment description | C1 | sample1 | 1 |
|
|
|
18 |
| book | Activity sample 2 | | C1 | sample2 | 2 |
|
|
|
19 |
| choice | Activity sample 3 | Test choice description | C1 | sample3 | 3 |
|
|
|
20 |
Given I am on the "C1" "Course" page logged in as "admin"
|
|
|
21 |
And I change window size to "large"
|
|
|
22 |
And I click on "Close course index" "button"
|
|
|
23 |
And I click on "Open course index" "button"
|
|
|
24 |
And I should see "Section 1" in the "courseindex-content" "region"
|
|
|
25 |
And the focused element is "[data-preference='drawer-open-index'] .drawertoggle" "css_element"
|
|
|
26 |
And I press the tab key
|
|
|
27 |
And I press the tab key
|
|
|
28 |
And the focused element is ".courseindex-section" "css_element"
|
|
|
29 |
|
|
|
30 |
@javascript
|
|
|
31 |
Scenario: General focus on open course index.
|
|
|
32 |
When I press the shift tab key
|
|
|
33 |
And I press the shift tab key
|
|
|
34 |
And the focused element is "[data-preference='drawer-open-index'] .drawertoggle" "css_element"
|
|
|
35 |
And I press enter
|
|
|
36 |
Then I should not see "Section 1" in the "courseindex-content" "region"
|
|
|
37 |
|
|
|
38 |
@javascript @accessibility
|
|
|
39 |
Scenario: Course index should be accessible.
|
|
|
40 |
When I press the shift tab key
|
|
|
41 |
And I press the shift tab key
|
|
|
42 |
And I press enter
|
|
|
43 |
Then the page should meet accessibility standards with "wcag143" extra tests
|
|
|
44 |
And I press enter
|
|
|
45 |
And the page should meet accessibility standards with "wcag143" extra tests
|
|
|
46 |
|
|
|
47 |
@javascript
|
|
|
48 |
Scenario: Opening and closing sections.
|
|
|
49 |
When I press the down key
|
|
|
50 |
And I should see "Activity sample 1" in the "courseindex-content" "region"
|
|
|
51 |
# Close section with left key.
|
|
|
52 |
Then I press the left key
|
|
|
53 |
And I should not see "Activity sample 1" in the "courseindex-content" "region"
|
|
|
54 |
# Open a section with right key
|
|
|
55 |
And I press the right key
|
|
|
56 |
And I should see "Activity sample 1" in the "courseindex-content" "region"
|
|
|
57 |
# Key down to focus the module and close the section with two left keys.
|
|
|
58 |
And I press the down key
|
|
|
59 |
And I press the left key
|
|
|
60 |
And I press the left key
|
|
|
61 |
And I should not see "Activity sample 1" in the "courseindex-content" "region"
|
|
|
62 |
# Open a section using enter key.
|
|
|
63 |
And I press the down key
|
|
|
64 |
And I press the left key
|
|
|
65 |
And I should not see "Activity sample 2" in the "courseindex-content" "region"
|
|
|
66 |
And I press enter
|
|
|
67 |
And I should see "Activity sample 2" in the "courseindex-content" "region"
|
|
|
68 |
|
|
|
69 |
@javascript
|
|
|
70 |
Scenario: Enter key should not collapse sections.
|
|
|
71 |
When I press the down key
|
|
|
72 |
And I press enter
|
|
|
73 |
And I should see "Activity sample 1" in the "courseindex-content" "region"
|
|
|
74 |
|
|
|
75 |
@javascript
|
|
|
76 |
Scenario: Navigate to an activity.
|
|
|
77 |
When I press the down key
|
|
|
78 |
And I press the right key
|
|
|
79 |
And I press enter
|
|
|
80 |
Then I should see "Activity sample 1" in the "page-header" "region"
|
|
|
81 |
|
|
|
82 |
@javascript
|
|
|
83 |
Scenario: Navigate to first and last element.
|
|
|
84 |
# Close sections 1 and 3.
|
|
|
85 |
Given I press the down key
|
|
|
86 |
And I press the left key
|
|
|
87 |
And I should not see "Activity sample 1" in the "courseindex-content" "region"
|
|
|
88 |
And I press the down key
|
|
|
89 |
And I press the down key
|
|
|
90 |
And I press the down key
|
|
|
91 |
And I press the left key
|
|
|
92 |
And I should not see "Activity sample 3" in the "courseindex-content" "region"
|
|
|
93 |
# Use end key to go to the last element.
|
|
|
94 |
When I press the end key
|
|
|
95 |
And I press the right key
|
|
|
96 |
And I should see "Activity sample 3" in the "courseindex-content" "region"
|
|
|
97 |
And I press the left key
|
|
|
98 |
Then I should not see "Activity sample 3" in the "courseindex-content" "region"
|
|
|
99 |
# Use home key to go to the first element.
|
|
|
100 |
And I press the home key
|
|
|
101 |
And I press the down key
|
|
|
102 |
And I press the right key
|
|
|
103 |
And I should see "Activity sample 1" in the "courseindex-content" "region"
|
|
|
104 |
|
|
|
105 |
@javascript
|
|
|
106 |
Scenario: Asterisc to open all sections.
|
|
|
107 |
# Close sections 1 and 2.
|
|
|
108 |
Given I press the down key
|
|
|
109 |
And I press the left key
|
|
|
110 |
And I should not see "Activity sample 1" in the "courseindex-content" "region"
|
|
|
111 |
And I press the down key
|
|
|
112 |
And I press the left key
|
|
|
113 |
And I should not see "Activity sample 2" in the "courseindex-content" "region"
|
|
|
114 |
And I should see "Activity sample 3" in the "courseindex-content" "region"
|
|
|
115 |
When I press the multiply key
|
|
|
116 |
Then I should see "Activity sample 1" in the "courseindex-content" "region"
|
|
|
117 |
And I should see "Activity sample 2" in the "courseindex-content" "region"
|
|
|
118 |
And I should see "Activity sample 3" in the "courseindex-content" "region"
|