title: CasperJS: swallows special keys like Enter?
body: <p>I'm trying to write a test using CasperJS for a scenario where pressing Enter in an input is the trigger for the page to do something with the text otherwise typed into the input.</p>
  
  <p>An abbreviated/simplified version of the CasperJS test:</p>
  
  <pre><code>casper.start('http://localhost:3000/input-demo', function() {
    this.sendKeys('#demo-input', 'demo text');
    this.sendKeys('#demo-input', '\uE007');
    this.test.assertEquals(this.getHTML('#stage'), 'input demo');
  });
  
  casper.run();
  </code></pre>
  
  <p>(Where we run it as <code>casperjs test this-test.js</code>)</p>
  
  <p>I've verified that <code>sendKeys</code> is getting the text into the input, but that text never shows up in the <code>#stage</code> element. A "vanilla" PhantomJS implementation of the keypress works fine, where <code>webpage.sendEvent('keypress', '\uE007')</code> causes the on-page event handler to fire. Looking at the source of <code>casper.sendKeys</code>, I see that it is delegating to the <code>sendEvent</code> on the Casper instance's PhantomJS instance (i.e., <a href="https://github.com/n1k0/casperjs/blob/2bc03233ab1547a975f95015827699af7568ec1d/modules/casper.js#L1613" rel="noreferrer">line 1613 in the current version of casper.js</a>).</p>
  
  <p>Any ideas? Anyone gotten these keys to work in a CasperJS test?</p>