Skip to content

Commit

Permalink
fix: send key multi byte string (#474)
Browse files Browse the repository at this point in the history
  • Loading branch information
KazuCocoa authored and mykola-mokhnach committed Aug 6, 2019
1 parent 3449c4f commit 60e0f4c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class SendKeys : RequestHandler<TextParams, Void?> {
throw InvalidElementStateException("sendKeys", params.elementId, e)
} catch (e: RuntimeException) {
e.message?.let {
if (it.contains("IME does not understand how to translate")) throw e
if (!it.contains("IME does not understand how to translate")) throw e
}
params.text?.let {
value = it
Expand Down
7 changes: 7 additions & 0 deletions test/functional/commands/keyboard-e2e-specs.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,13 @@ describe('keyboard', function () {
await el.clear();
});

it('should send keys to the correct element as replace text', async function () {
let el = await driver.elementByXPath('//android.widget.AutoCompleteTextView');
await el.click();
await el.sendKeys('ハロー');
await el.clear();
});

it('should send keys to the correct element', async function () {
let el = await driver.elementByXPath('//android.widget.AutoCompleteTextView');
await el.setImmediateValue('hello world');
Expand Down

0 comments on commit 60e0f4c

Please sign in to comment.