-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Adopted base events test cause the base test only checks for last key event. But if we want to test this with webdriver we have to first keyDown all keys one by one and then keyUp them one by one. The keyUp can not be done with both keys at once, so only the last up event gets asserted by base test. * Use key value "82" instead of "114" for shift+r cause this seems to be the real one. Also see: minkphp/driver-testsuite#36
- Loading branch information
1 parent
8a5ccf3
commit a845633
Showing
3 changed files
with
203 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,119 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>JS elements test</title> | ||
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/> | ||
|
||
<style> | ||
#draggable { | ||
width: 100px; height: 100px; padding: 0.5em; float: left; margin: 10px 10px 10px 0; | ||
background:#ccc; | ||
opacity:0.5; | ||
} | ||
#droppable { | ||
width: 150px; height: 150px; padding: 0.5em; float: left; margin: 10px; | ||
background:#eee; | ||
} | ||
#waitable { | ||
width: 150px; height: 150px; padding: 0.5em; float: left; margin: 10px; | ||
background:#eee; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<div class="elements"> | ||
<div id="clicker">not clicked</div> | ||
<div id="mouseover-detector">no mouse action detected</div> | ||
<div id="invisible" style="display: none">invisible man</div> | ||
<input id="focus-blur-detector" type="text" value="no action detected"/> | ||
<input class="input first" type="text" value="" /> | ||
<input class="input second" type="text" value="" /> | ||
<input class="input third" type="text" value="" /> | ||
<div class="text-event"></div> | ||
</div> | ||
|
||
<div id="draggable" class="ui-widget-content"></div> | ||
|
||
<div id="droppable" class="ui-widget-header"> | ||
<p>Drop here</p> | ||
</div> | ||
|
||
<div id="waitable"></div> | ||
|
||
<script src="js/jquery-1.6.2-min.js"></script> | ||
<script src="js/jquery-ui-1.8.14.custom.min.js"></script> | ||
<script> | ||
$(document).ready(function() { | ||
var $clicker = $('#clicker'); | ||
|
||
$clicker.click(function() { | ||
$(this).text('single clicked'); | ||
}); | ||
|
||
$clicker.dblclick(function() { | ||
$(this).text('double clicked'); | ||
}); | ||
|
||
$clicker.bind('contextmenu', function() { | ||
$(this).text('right clicked'); | ||
}); | ||
|
||
var $focusDetector = $('#focus-blur-detector'); | ||
|
||
$focusDetector.focus(function() { | ||
$(this).val('focused'); | ||
}); | ||
|
||
$focusDetector.blur(function() { | ||
$(this).val('blured'); | ||
}); | ||
|
||
$('#mouseover-detector').mouseover(function() { | ||
$(this).text('mouse overed'); | ||
}); | ||
|
||
// START OF CHANGE - using append() instead of text() | ||
$('.elements input.input.first').keydown(function(ev) { | ||
$('.text-event').append('key downed:' + ev.altKey * 1 + ' / ' + ev.ctrlKey * 1 + ' / ' + ev.shiftKey * 1 + ' / ' + ev.metaKey * 1); | ||
$('.text-event').append('<br>'); | ||
}); | ||
|
||
$('.elements input.input.second').keypress(function(ev) { | ||
$('.text-event').append('key pressed:' + ev.which + ' / ' + ev.altKey * 1 + ' / ' + ev.ctrlKey * 1 + ' / ' + ev.shiftKey * 1 + ' / ' + ev.metaKey * 1); | ||
$('.text-event').append('<br>'); | ||
}); | ||
|
||
$('.elements input.input.third').keyup(function(ev) { | ||
$('.text-event').append('key upped:' + ev.which + ' / ' + ev.altKey * 1 + ' / ' + ev.ctrlKey * 1 + ' / ' + ev.shiftKey * 1 + ' / ' + ev.metaKey * 1); | ||
$('.text-event').append('<br>'); | ||
}); | ||
// END OF CHANGE - using append() instead of text() | ||
|
||
$( "#draggable" ).draggable(); | ||
$( "#droppable" ).droppable({ | ||
drop: function( event, ui ) { | ||
$( this ).find( "p" ).html( "Dropped!" ); | ||
} | ||
}); | ||
|
||
var t1, t2; | ||
|
||
$('#waitable').click(function() { | ||
var el = $(this); | ||
|
||
el.html(''); | ||
clearTimeout(t1); | ||
clearTimeout(t2); | ||
|
||
t1 = setTimeout(function() { | ||
el.html('<div>arrived</div>'); | ||
}, 1000); | ||
|
||
t2 = setTimeout(function() { | ||
el.html('<div>timeout</div>'); | ||
}, 2000); | ||
}); | ||
}); | ||
</script> | ||
</body> | ||
</html> |