tests: fix frontend tests on firefox

These changes make the frontend tests send keydown instead of keypress in
firefox, in accordance with #3413 (Use keydown instead of keypress on Firefox).

The percentage of passing frontend in Firefox 61 on this revision is 100%.
This commit is contained in:
muxator 2018-07-20 23:58:47 +02:00
parent f17fe571df
commit 4580537537
7 changed files with 12 additions and 12 deletions

View File

@ -44,7 +44,7 @@ describe("bold button", function(){
//select this text element
$firstTextElement.sendkeys('{selectall}');
if(inner$(window)[0].bowser.firefox || inner$(window)[0].bowser.modernIE){ // if it's a mozilla or IE
if(inner$(window)[0].bowser.modernIE){ // if it's IE
var evtType = "keypress";
}else{
var evtType = "keydown";

View File

@ -15,7 +15,7 @@ describe("indentation button", function(){
//select this text element
$firstTextElement.sendkeys('{selectall}');
if(inner$(window)[0].bowser.firefox || inner$(window)[0].bowser.modernIE){ // if it's a mozilla or IE
if(inner$(window)[0].bowser.modernIE){ // if it's IE
var evtType = "keypress";
}else{
var evtType = "keydown";
@ -325,7 +325,7 @@ describe("indentation button", function(){
function pressEnter(){
var inner$ = helper.padInner$;
if(inner$(window)[0].bowser.firefox || inner$(window)[0].bowser.modernIE){ // if it's a mozilla or IE
if(inner$(window)[0].bowser.modernIE){ // if it's IE
var evtType = "keypress";
}else{
var evtType = "keydown";

View File

@ -44,7 +44,7 @@ describe("italic some text", function(){
//select this text element
$firstTextElement.sendkeys('{selectall}');
if(inner$(window)[0].bowser.firefox || inner$(window)[0].bowser.modernIE){ // if it's a mozilla or IE
if(inner$(window)[0].bowser.modernIE){ // if it's IE
var evtType = "keypress";
}else{
var evtType = "keydown";

View File

@ -111,7 +111,7 @@ describe("assign ordered list", function(){
var triggerCtrlShiftShortcut = function(shortcutChar) {
var inner$ = helper.padInner$;
if(inner$(window)[0].bowser.firefox || inner$(window)[0].bowser.modernIE) { // if it's a mozilla or IE
if(inner$(window)[0].bowser.modernIE) { // if it's IE
var evtType = "keypress";
}else{
var evtType = "keydown";

View File

@ -513,7 +513,7 @@ describe('scroll when focus line is out of viewport', function () {
var pressKey = function(keyCode, shiftIsPressed){
var inner$ = helper.padInner$;
var evtType;
if(inner$(window)[0].bowser.firefox || inner$(window)[0].bowser.modernIE){ // if it's a mozilla or IE
if(inner$(window)[0].bowser.modernIE){ // if it's IE
evtType = 'keypress';
}else{
evtType = 'keydown';

View File

@ -88,7 +88,7 @@ describe("select formatting buttons when selection has style applied", function(
//select this text element
$firstTextElement.sendkeys('{selectall}');
if(inner$(window)[0].bowser.firefox || inner$(window)[0].bowser.modernIE){ // if it's a mozilla or IE
if(inner$(window)[0].bowser.modernIE){ // if it's IE
var evtType = "keypress";
}else{
var evtType = "keydown";

View File

@ -44,11 +44,11 @@ describe("undo button", function(){
var modifiedValue = $firstTextElement.text(); // get the modified value
expect(modifiedValue).not.to.be(originalValue); // expect the value to change
if(inner$(window)[0].bowser.firefox){ // if it's a mozilla browser
var evtType = "keypress";
}else{
var evtType = "keydown";
}
/*
* ACHTUNG: this is the only place in the test codebase in which a keydown
* is sent for IE. Everywhere else IE uses keypress.
*/
var evtType = "keydown";
var e = inner$.Event(evtType);
e.ctrlKey = true; // Control key