1
1
var hammerhead = window . getTestCafeModule ( 'hammerhead' ) ;
2
2
var browserUtils = hammerhead . utils . browser ;
3
3
4
- var testCafeCore = window . getTestCafeModule ( 'testCafeCore' ) ;
5
- var domUtils = testCafeCore . get ( './utils/dom' ) ;
4
+ var testCafeCore = window . getTestCafeModule ( 'testCafeCore' ) ;
5
+ var domUtils = testCafeCore . get ( './utils/dom' ) ;
6
6
7
7
var testCafeAutomation = window . getTestCafeModule ( 'testCafeAutomation' ) ;
8
8
var PressAutomation = testCafeAutomation . Press ;
@@ -21,6 +21,7 @@ $(document).ready(function () {
21
21
var $inputText = null ;
22
22
var $textarea = null ;
23
23
var $link = null ;
24
+ var $linkWithTabIndex = null ;
24
25
var $divWithTabIndex = null ;
25
26
26
27
//contentEditable elements
@@ -48,11 +49,13 @@ $(document).ready(function () {
48
49
var createElements = function ( ) {
49
50
var $body = $ ( 'body' ) ;
50
51
51
- $inputText = $ ( '<input type="text">' ) . attr ( 'value' , 'text input' ) . addClass ( TEST_ELEMENT_CLASS ) . appendTo ( $body ) ;
52
- $textarea = $ ( '<textarea>' ) . css ( 'height' , 100 ) . attr ( 'value' , 'textarea' ) . addClass ( TEST_ELEMENT_CLASS ) . appendTo ( $body ) ;
53
- $link = $ ( '<a>' ) . attr ( 'href' , 'http://www.example.org/' ) . attr ( 'tabIndex' , 2 ) . text ( 'Link with href' ) . addClass ( TEST_ELEMENT_CLASS ) . appendTo ( $body ) ;
52
+ $inputText = $ ( '<input type="text">' ) . attr ( 'value' , 'text input' ) . addClass ( TEST_ELEMENT_CLASS ) . appendTo ( $body ) ;
53
+ $textarea = $ ( '<textarea>' ) . css ( 'height' , 100 ) . attr ( 'value' , 'textarea' ) . addClass ( TEST_ELEMENT_CLASS ) . appendTo ( $body ) ;
54
+ $link = $ ( '<a>' ) . attr ( 'href' , 'http://www.example.org/' ) . attr ( 'tabIndex' , 2 ) . text ( 'Link with href' ) . addClass ( TEST_ELEMENT_CLASS ) . appendTo ( $body ) ;
55
+ $linkWithTabIndex = $ ( '<a>' ) . attr ( 'tabIndex' , '0' ) . text ( 'Link without href but with tabIndex' ) . addClass ( TEST_ELEMENT_CLASS ) . appendTo ( $body ) ;
54
56
55
57
$ ( '<a>' ) . text ( 'Link without href' ) . addClass ( TEST_ELEMENT_CLASS ) . appendTo ( $body ) ;
58
+ $ ( '<a>' ) . attr ( 'tabIndex' , '-10' ) . text ( 'Link without href and with negative tabIndex' ) . addClass ( TEST_ELEMENT_CLASS ) . appendTo ( $body ) ;
56
59
$ ( '<div></div>' ) . text ( 'div tag' ) . addClass ( TEST_ELEMENT_CLASS ) . appendTo ( $body ) ;
57
60
58
61
$divWithTabIndex = $ ( '<div></div>' ) . text ( 'div tag with tabIndex' ) . attr ( 'tabIndex' , 1 ) . addClass ( TEST_ELEMENT_CLASS ) . appendTo ( $body ) ;
@@ -111,6 +114,9 @@ $(document).ready(function () {
111
114
$expectedFocusedElements . push ( $inputText ) ;
112
115
$expectedFocusedElements . push ( $textarea ) ;
113
116
117
+ //GH-1803
118
+ $expectedFocusedElements . push ( $linkWithTabIndex ) ;
119
+
114
120
$expectedFocusedElements . push ( $divContentEditable ) ;
115
121
116
122
$expectedFocusedElements . push ( $inputSubmit ) ;
0 commit comments