diff --git a/tests/frontend/specs/bold.js b/tests/frontend/specs/bold.js index 010d6901..7c04835e 100644 --- a/tests/frontend/specs/bold.js +++ b/tests/frontend/specs/bold.js @@ -44,7 +44,13 @@ describe("bold button", function(){ //select this text element $firstTextElement.sendkeys('{selectall}'); - var e = inner$.Event("keypress"); + if(!inner$.browser.chrome){ + var evtType = "keypress"; + }else{ + var evtType = "keydown"; + } + + var e = inner$.Event(evtType); e.ctrlKey = true; // Control key e.which = 66; // b inner$("#innerdocbody").trigger(e); diff --git a/tests/frontend/specs/indentation.js b/tests/frontend/specs/indentation.js index 6b9b432d..6e5b3c1a 100644 --- a/tests/frontend/specs/indentation.js +++ b/tests/frontend/specs/indentation.js @@ -15,7 +15,13 @@ describe("indentation button", function(){ //select this text element $firstTextElement.sendkeys('{selectall}'); - var e = inner$.Event("keypress"); + if(!inner$.browser.chrome){ + var evtType = "keypress"; + }else{ + var evtType = "keydown"; + } + + var e = inner$.Event(evtType); e.keyCode = 9; // tab :| inner$("#innerdocbody").trigger(e); diff --git a/tests/frontend/specs/italic.js b/tests/frontend/specs/italic.js index 15976f29..9bee72dc 100644 --- a/tests/frontend/specs/italic.js +++ b/tests/frontend/specs/italic.js @@ -44,7 +44,13 @@ describe("italic some text", function(){ //select this text element $firstTextElement.sendkeys('{selectall}'); - var e = inner$.Event("keypress"); + if(!inner$.browser.chrome){ + var evtType = "keypress"; + }else{ + var evtType = "keydown"; + } + + var e = inner$.Event(evtType); e.ctrlKey = true; // Control key e.which = 105; // i inner$("#innerdocbody").trigger(e); diff --git a/tests/frontend/specs/redo.js b/tests/frontend/specs/redo.js index d72b5a09..059e9711 100644 --- a/tests/frontend/specs/redo.js +++ b/tests/frontend/specs/redo.js @@ -47,7 +47,13 @@ describe("undo button then redo button", function(){ var modifiedValue = $firstTextElement.text(); // get the modified value expect(modifiedValue).not.to.be(originalValue); // expect the value to change - var e = inner$.Event("keypress"); + if(!inner$.browser.chrome){ + var evtType = "keypress"; + }else{ + var evtType = "keydown"; + } + + var e = inner$.Event(evtType); e.ctrlKey = true; // Control key e.which = 90; // z inner$("#innerdocbody").trigger(e); diff --git a/tests/frontend/specs/undo.js b/tests/frontend/specs/undo.js index 8ba752ac..4e9dd0d5 100644 --- a/tests/frontend/specs/undo.js +++ b/tests/frontend/specs/undo.js @@ -44,7 +44,13 @@ describe("undo button", function(){ var modifiedValue = $firstTextElement.text(); // get the modified value expect(modifiedValue).not.to.be(originalValue); // expect the value to change - var e = inner$.Event("keydown"); + if(!inner$.browser.chrome){ + var evtType = "keypress"; + }else{ + var evtType = "keydown"; + } + + var e = inner$.Event(evtType); e.ctrlKey = true; // Control key e.which = 90; // z inner$("#innerdocbody").trigger(e);