JS Testing: Trigger jQuery keypress event from CasperJS and PhanthomJS
问题 my webpage has a listener to the enter key press event. I am trying to run the casperjs code below to trigger this event, but without success. Although no error is prompted out, the (evaluate) function returns true and the code works fine from my chrome console, the function result, that should be sending a request to the server is never happening casper.then(function(){ var result = this.evaluate(function(term){ var search_form_id = "#search-form"; $(search_form_id).val(term); jQuery(search