File tree 1 file changed +17
-12
lines changed
1 file changed +17
-12
lines changed Original file line number Diff line number Diff line change @@ -19,20 +19,25 @@ def type text
19
19
# type
20
20
$driver. execute_script %(au.getElement('#{ self . ref } ').setValue('#{ text } ');)
21
21
22
- # wait for keyboard
23
- $driver. wait_true { $driver. execute_script %(au.mainApp.keyboard().type
24
- () !== 'UIAElementNil') }
22
+ $driver. ignore {
23
+ # wait 5 seconds for keyboard. if the textfield is disabled then
24
+ # setValue will work, however the keyboard will never display
25
+ # because users are normally not allowed to type into it.
26
+ $driver. wait_true ( 5 ) do
27
+ $driver. execute_script %(au.mainApp.keyboard().type() !== 'UIAElementNil')
28
+ end
25
29
26
- # dismiss keyboard
27
- js = <<-JS
28
- if (au.mainApp.keyboard().type() !== "UIAElementNil") {
29
- var startY = au.mainApp.keyboard().rect().origin.y - 10;
30
- var endY = au.mainWindow.rect().size.height - 10;
31
- au.flickApp(0, startY, 0, endY);
32
- }
33
- JS
30
+ # dismiss keyboard
31
+ js = <<-JS
32
+ if (au.mainApp.keyboard().type() !== "UIAElementNil") {
33
+ var startY = au.mainApp.keyboard().rect().origin.y - 10;
34
+ var endY = au.mainWindow.rect().size.height - 10;
35
+ au.flickApp(0, startY, 0, endY);
36
+ }
37
+ JS
34
38
35
- $driver. execute_script js
39
+ $driver. execute_script js
40
+ }
36
41
end
37
42
end
38
43
end
You can’t perform that action at this time.
0 commit comments