Q:

Is it possible to simulate OS X shortcut for creating accented characters in Capybara? (alt+e, e)

I need to simulate the three keypress combination. In OS X to create an accent, you hold down alt+e, then press the letter you'd like accented. 
In Capybara, send_keys should do this, like so:
find('body').native.send_keys [:alt, 'e'], 'e'
There is even a similar example in these docs: https://www.rubydoc.info/github/jnicklas/capybara/Capybara%2FNode%2FElement:send_keys
The problem is that the above code results in a regular e with no accent. Without the second 'e' nothing happens at all.
Is it not possible to simulate this action? Should I try using JavaScript? 
You can test find('.gLFyf').native.send_keys [:alt, 'e'], 'e' on Google's homepage.
To be clear, I do not want to just send the é to the input field, that would not be testing the changed behavior.

A:

Unfortunately not.  The <alt-e> e behavior is handled by OSX not the browser, and Capybara can only control the behavior the browser sees. This means that while the browser sees the keypresses, OSX itself doesn't so no replacement with accent characters can occur. However, while you don't want to just send the character, since it is a system behavior (not a behavior of your app/website) just sending é directly is equivalent from a testing pov (as far as input content goes, yes it won't match key events correctly).

