mirrored from git://git.moodle.org/moodle.git
/
tour_accessibility.feature
85 lines (82 loc) · 4.26 KB
/
tour_accessibility.feature
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
@tool @tool_usertours
Feature: Apply accessibility to a tour
Background:
Given I log in as "admin"
And I add a new user tour with:
| Name | First tour |
| Description | My first tour |
| Apply to URL match | FRONTPAGE |
| Tour is enabled | 1 |
| Show with backdrop | 1 |
And I add steps to the "First tour" tour:
| targettype | Title | Content |
| Display in middle of page | Welcome | Welcome tour. |
And I add steps to the tour:
| targettype | targetvalue_selector | Title | Content |
| Selector | .usermenu | User menu | Next page |
| Selector | input,button | Page 2 | Next page |
And I add steps to the tour:
| targettype | Title | Content |
| Display in middle of page | Page 3 | Final page. |
@javascript
Scenario: Check tabbing working correctly.
Given I am on site homepage
And I wait "1" seconds
And I should see "Welcome"
# First dialogue of the tour, "Welcome". It has Close, Next and End buttons.
# Nothing highlighted on the page. Initially whole dialogue focused.
When I press tab
Then the focused element is ".close" "css_element" in the "Welcome" "dialogue"
When I press tab
Then the focused element is "Next" "button" in the "Welcome" "dialogue"
When I press tab
Then the focused element is "End tour" "button" in the "Welcome" "dialogue"
When I press tab
# Here the focus loops round to the whole dialogue again.
And I press tab
Then the focused element is ".close" "css_element" in the "Welcome" "dialogue"
# Check looping works properly going backwards too.
When I press shift tab
And I press shift tab
Then the focused element is "End tour" "button" in the "Welcome" "dialogue"
When I press "Next"
# Now we are on the "User menu" step, so Previous is also enabled.
# Also, the user menu section in the page is highlighted, and this
# section contain a hyperlink so the focus have to go though and back to the dialogue.
And I wait "1" seconds
And I press tab
Then the focused element is ".close" "css_element" in the "User menu" "dialogue"
When I press tab
Then the focused element is "Previous" "button" in the "User menu" "dialogue"
When I press tab
Then the focused element is "Next" "button" in the "User menu" "dialogue"
When I press tab
Then the focused element is "End tour" "button" in the "User menu" "dialogue"
# We tab 3 times from "End Tour" button to header container, drop down then go to "Dashboard" link.
When I press tab
Then the focused element is ".usermenu" "css_element"
When I press tab
Then the focused element is "Admin User" "link" in the ".usermenu" "css_element"
When I press tab
And I press tab
Then the focused element is ".close" "css_element" in the "User menu" "dialogue"
# Press shift-tab twice should lead us back to "Admin user" link.
When I press shift tab
And I press shift tab
Then the focused element is "Admin User" "link" in the ".usermenu" "css_element"
@javascript
Scenario: Aria tags should not exist
And I am on site homepage
When I click on "Next" "button"
And I click on "Next" "button"
Then "input[aria-describedby^='tour-step-tool_usertours'],button[aria-describedby^='tour-step-tool_usertours']" "css_element" should exist
And "input[tabindex],button[tabindex]" "css_element" should exist
When I click on "Next" "button"
Then "input[aria-describedby^='tour-step-tool_usertours'],button[aria-describedby^='tour-step-tool_usertours']" "css_element" should not exist
And "input[tabindex],button[tabindex]" "css_element" should not exist
When I click on "Previous" "button"
Then "input[aria-describedby^='tour-step-tool_usertours'],button[aria-describedby^='tour-step-tool_usertours']" "css_element" should exist
And "input[tabindex],button[tabindex]" "css_element" should exist
When I click on "End tour" "button"
Then "input[aria-describedby^='tour-step-tool_usertours'],button[aria-describedby^='tour-step-tool_usertours']" "css_element" should not exist
And "input[tabindex],button[tabindex]" "css_element" should not exist