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