diff --git a/tests/Js/EventsTest.php b/tests/Js/EventsTest.php index f06999b..b323476 100644 --- a/tests/Js/EventsTest.php +++ b/tests/Js/EventsTest.php @@ -99,13 +99,13 @@ public function testKeyboardEvents($modifier, $eventProperties) $event = $webAssert->elementExists('css', '.elements .text-event'); $input1->keyDown('u', $modifier); - $this->assertEquals('key downed:'.$eventProperties, $event->getText()); + $this->assertEquals('key downed: 117 / ' . $eventProperties, $event->getText()); $input2->keyPress('r', $modifier); - $this->assertEquals('key pressed:114 / '.$eventProperties, $event->getText()); + $this->assertEquals('key pressed: 114 / ' . $eventProperties, $event->getText()); $input3->keyUp(78, $modifier); - $this->assertEquals('key upped:78 / '.$eventProperties, $event->getText()); + $this->assertEquals('key upped: 78 / ' . $eventProperties, $event->getText()); } public function provideKeyboardEventsModifiers() diff --git a/web-fixtures/js_test.html b/web-fixtures/js_test.html index b18047e..b902534 100644 --- a/web-fixtures/js_test.html +++ b/web-fixtures/js_test.html @@ -73,15 +73,15 @@ }); $('.elements input.input.first').keydown(function(ev) { - $('.text-event').text('key downed:' + ev.altKey * 1 + ' / ' + ev.ctrlKey * 1 + ' / ' + ev.shiftKey * 1 + ' / ' + ev.metaKey * 1); + $('.text-event').text('key downed: ' + (ev.keyCode || ev.charCode) + ' / ' + ev.altKey * 1 + ' / ' + ev.ctrlKey * 1 + ' / ' + ev.shiftKey * 1 + ' / ' + ev.metaKey * 1); }); $('.elements input.input.second').keypress(function(ev) { - $('.text-event').text('key pressed:' + (ev.keyCode || ev.charCode) + ' / ' + ev.altKey * 1 + ' / ' + ev.ctrlKey * 1 + ' / ' + ev.shiftKey * 1 + ' / ' + ev.metaKey * 1); + $('.text-event').text('key pressed: ' + (ev.keyCode || ev.charCode) + ' / ' + ev.altKey * 1 + ' / ' + ev.ctrlKey * 1 + ' / ' + ev.shiftKey * 1 + ' / ' + ev.metaKey * 1); }); $('.elements input.input.third').keyup(function(ev) { - $('.text-event').text('key upped:' + (ev.keyCode || ev.charCode) + ' / ' + ev.altKey * 1 + ' / ' + ev.ctrlKey * 1 + ' / ' + ev.shiftKey * 1 + ' / ' + ev.metaKey * 1); + $('.text-event').text('key upped: ' + (ev.keyCode || ev.charCode) + ' / ' + ev.altKey * 1 + ' / ' + ev.ctrlKey * 1 + ' / ' + ev.shiftKey * 1 + ' / ' + ev.metaKey * 1); }); $( "#draggable" ).draggable();