simulate real keypress event

native-events
webzwo0i 2020-11-14 17:18:42 +01:00
parent 536a6dce70
commit bd58fd15d4
1 changed files with 6 additions and 1 deletions

View File

@ -17,7 +17,12 @@ describe("All the alphabet works n stuff", function(){
// simulate key presses to delete content
firstTextElement.sendkeys('{selectall}'); // select all
firstTextElement.sendkeys('{del}'); // clear the first line
firstTextElement.sendkeys(expectedString); // insert the string
let code;
for (let index = 0; index < expectedString.length; index++){
code = expectedString.charCodeAt(index);
$(firstTextElement).trigger({type: 'keypress', which: code, keyCode: code, ctrlKey: false});
}
helper.waitFor(function(){
return inner$("div").first().text() === expectedString;