1441 |
ariadna |
1 |
@core
|
|
|
2 |
Feature: Focus lock in modal popups
|
|
|
3 |
In order to navigate a modal popup with keyboard
|
|
|
4 |
As a user
|
|
|
5 |
The tab key should cycle through elements in the form and not go outside it
|
|
|
6 |
|
|
|
7 |
Background:
|
|
|
8 |
Given the following "courses" exist:
|
|
|
9 |
| fullname | shortname |
|
|
|
10 |
| Course 1 | C1 |
|
|
|
11 |
And the following "activities" exist:
|
|
|
12 |
| activity | name | course | idnumber |
|
|
|
13 |
| forum | Test forum | C1 | forum1 |
|
|
|
14 |
And I am on the "forum1" "Activity" page logged in as "admin"
|
|
|
15 |
And I follow "Add discussion topic"
|
|
|
16 |
And I click on "Image" "button"
|
|
|
17 |
|
|
|
18 |
@javascript
|
|
|
19 |
Scenario: Tab cycles through elements in modal, using image popup in Tiny as an example
|
|
|
20 |
# Repeated tabs just to get to the last element. This may need changing if controls are added
|
|
|
21 |
# or removed to the form.
|
|
|
22 |
When I press the tab key
|
|
|
23 |
And I press the tab key
|
|
|
24 |
And I press the tab key
|
|
|
25 |
And I press the tab key
|
|
|
26 |
And I press the tab key
|
|
|
27 |
And the focused element is "Browse repositories" "button"
|
|
|
28 |
|
|
|
29 |
# Tab past last element should go back to the first one, which is the modal itself, then the close button.
|
|
|
30 |
And I press the tab key
|
|
|
31 |
And I press the tab key
|
|
|
32 |
Then the focused element is "Close" "button" in the "Insert image" "dialogue"
|
|
|
33 |
|
|
|
34 |
And I press the shift tab key
|
|
|
35 |
And I press the shift tab key
|
|
|
36 |
And the focused element is "Browse repositories" "button"
|
|
|
37 |
|
|
|
38 |
@javascript
|
|
|
39 |
Scenario: Focus continues to be locked to modal even after closing nested modal
|
|
|
40 |
# Open 'Browse repositories' nested modal, then close it again.
|
|
|
41 |
When I press "Browse repositories"
|
|
|
42 |
And I click on "Close" "button" in the "File picker" "dialogue"
|
|
|
43 |
And the focused element is "Browse repositories" "button"
|
|
|
44 |
|
|
|
45 |
# Focus should still wrap around to the start of the image modal.
|
|
|
46 |
When I press the tab key
|
|
|
47 |
And I press the tab key
|
|
|
48 |
Then the focused element is "Close" "button" in the "Insert image" "dialogue"
|