Skip to content

Commit 8613403

Browse files
Use boolean for .visible on iOS
1 parent 59980db commit 8613403

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

lib/appium_lib/ios/patch.rb

+5-4
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,16 @@ def type text
1616
end
1717

1818
# returns if the element is visible
19-
# 1 = visible
20-
# 0 = not visible
21-
# null = unknown
19+
# true: 1 = visible,
20+
# false: 0 = not visible, null = unknown
21+
#
2222
# http://developer.apple.com/library/ios/#documentation/ToolsLanguages/Reference/UIAElementClassReference/UIAElement/UIAElement.html#//apple_ref/doc/uid/TP40009903
2323
def visible
2424
js = <<-JS
2525
au.getElement('#{self.ref}').isVisible();
2626
JS
27-
@driver.execute_script js
27+
result = @driver.execute_script js
28+
result == 1 ? true : false
2829
end
2930
end
3031
end

0 commit comments

Comments
 (0)