We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c99ed34 commit 1f0428dCopy full SHA for 1f0428d
lib/appium_lib/ios/patch.rb
@@ -16,16 +16,22 @@ def type text
16
17
Swiping inside the keyboard will not dismiss it.
18
=end
19
- js = <<-JS
20
- au.getElement('#{self.ref}').setValue('#{text}');
+ # type
+ execute_script %(au.getElement('#{self.ref}').setValue('#{text}');)
21
+
22
+ # wait for keyboard
23
+ wait_true { execute_script %(au.mainApp.keyboard().type() !== 'UIAElementNil') }
24
25
+ # dismiss keyboard
26
+ js = <<-JS
27
if (au.mainApp.keyboard().type() !== "UIAElementNil") {
28
var startY = au.mainApp.keyboard().rect().origin.y - 10;
29
var endY = au.mainWindow.rect().size.height - 10;
30
au.flickApp(0, startY, 0, endY);
31
}
32
JS
- @driver.execute_script js
33
34
+ execute_script js
35
end
36
37
0 commit comments