We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0c0073d commit b3227f7Copy full SHA for b3227f7
lib/appium_lib/element/ios/alert.rb
@@ -2,9 +2,17 @@
2
if $os == :ios
3
# iOS only
4
# Tap the alert button identified by value.
5
+#
6
+# Click the ok button:
7
+# alert_click 'OK'
8
9
+# Click the first button:
10
+# alert_click 0
11
12
# @param value [Integer, String] either an integer index of the button or the button's name
13
# @return [void]
14
def alert_click value
15
+ value = "'#{value}'" if value.is_a?(String)
16
$driver.execute_script "UIATarget.localTarget().frontMostApp().alert().buttons()[#{value}].tap();"
17
end
18
@@ -46,4 +54,4 @@ def alert_dismiss_text
46
54
b.first.text if b && b.size >= 1
47
55
48
56
49
-end # if $os == :ios
57
+end # if $os == :ios
0 commit comments