Skip to content

Commit

Permalink
link without href but with tabIndex included in nextFocusable method'…
Browse files Browse the repository at this point in the history
…s logic (closes #1803) (#1807)
  • Loading branch information
helen-dikareva authored and AlexanderMoskovkin committed Sep 21, 2017
1 parent 0bc45fd commit ad0e5f7
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions test/client/fixtures/automation/tab-emulation-test.js
@@ -1,8 +1,8 @@
var hammerhead = window.getTestCafeModule('hammerhead');
var browserUtils = hammerhead.utils.browser;

var testCafeCore = window.getTestCafeModule('testCafeCore');
var domUtils = testCafeCore.get('./utils/dom');
var testCafeCore = window.getTestCafeModule('testCafeCore');
var domUtils = testCafeCore.get('./utils/dom');

var testCafeAutomation = window.getTestCafeModule('testCafeAutomation');
var PressAutomation = testCafeAutomation.Press;
Expand All @@ -21,6 +21,7 @@ $(document).ready(function () {
var $inputText = null;
var $textarea = null;
var $link = null;
var $linkWithTabIndex = null;
var $divWithTabIndex = null;

//contentEditable elements
Expand Down Expand Up @@ -48,11 +49,13 @@ $(document).ready(function () {
var createElements = function () {
var $body = $('body');

$inputText = $('<input type="text">').attr('value', 'text input').addClass(TEST_ELEMENT_CLASS).appendTo($body);
$textarea = $('<textarea>').css('height', 100).attr('value', 'textarea').addClass(TEST_ELEMENT_CLASS).appendTo($body);
$link = $('<a>').attr('href', 'http://www.example.org/').attr('tabIndex', 2).text('Link with href').addClass(TEST_ELEMENT_CLASS).appendTo($body);
$inputText = $('<input type="text">').attr('value', 'text input').addClass(TEST_ELEMENT_CLASS).appendTo($body);
$textarea = $('<textarea>').css('height', 100).attr('value', 'textarea').addClass(TEST_ELEMENT_CLASS).appendTo($body);
$link = $('<a>').attr('href', 'http://www.example.org/').attr('tabIndex', 2).text('Link with href').addClass(TEST_ELEMENT_CLASS).appendTo($body);
$linkWithTabIndex = $('<a>').attr('tabIndex', '0').text('Link without href but with tabIndex').addClass(TEST_ELEMENT_CLASS).appendTo($body);

$('<a>').text('Link without href').addClass(TEST_ELEMENT_CLASS).appendTo($body);
$('<a>').attr('tabIndex', '-10').text('Link without href and with negative tabIndex').addClass(TEST_ELEMENT_CLASS).appendTo($body);
$('<div></div>').text('div tag').addClass(TEST_ELEMENT_CLASS).appendTo($body);

$divWithTabIndex = $('<div></div>').text('div tag with tabIndex').attr('tabIndex', 1).addClass(TEST_ELEMENT_CLASS).appendTo($body);
Expand Down Expand Up @@ -111,6 +114,9 @@ $(document).ready(function () {
$expectedFocusedElements.push($inputText);
$expectedFocusedElements.push($textarea);

//GH-1803
$expectedFocusedElements.push($linkWithTabIndex);

$expectedFocusedElements.push($divContentEditable);

$expectedFocusedElements.push($inputSubmit);
Expand Down

0 comments on commit ad0e5f7

Please sign in to comment.