appium_lib 0.24.1 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +17 -8
- data/android_tests/Gemfile +1 -0
- data/android_tests/LICENSE-2.0.txt +202 -0
- data/android_tests/Rakefile +61 -0
- data/android_tests/api.apk +0 -0
- data/android_tests/appium.txt +3 -0
- data/android_tests/flaky.txt +1 -0
- data/android_tests/lib/android/specs/android/dynamic.rb +5 -0
- data/android_tests/lib/android/specs/android/element/alert.rb +41 -0
- data/android_tests/lib/android/specs/android/element/button.rb +55 -0
- data/android_tests/lib/android/specs/android/element/generic.rb +48 -0
- data/android_tests/lib/android/specs/android/element/text.rb +39 -0
- data/android_tests/lib/android/specs/android/element/textfield.rb +60 -0
- data/android_tests/lib/android/specs/android/helper.rb +80 -0
- data/android_tests/lib/android/specs/android/patch.rb +14 -0
- data/android_tests/lib/android/specs/common/device.rb +117 -0
- data/android_tests/lib/android/specs/common/element/window.rb +9 -0
- data/android_tests/lib/android/specs/common/helper.rb +112 -0
- data/android_tests/lib/android/specs/common/patch.rb +69 -0
- data/android_tests/lib/android/specs/common/version.rb +9 -0
- data/android_tests/lib/android/specs/driver.rb +174 -0
- data/android_tests/lib/format.rb +49 -0
- data/android_tests/lib/run.rb +72 -0
- data/android_tests/readme.md +27 -0
- data/appium_lib.gemspec +8 -5
- data/docs/android_docs.md +1052 -716
- data/docs/ios_docs.md +657 -834
- data/docs_gen/make_docs.rb +1 -3
- data/ios_tests/Gemfile +1 -0
- data/ios_tests/LICENSE-2.0.txt +202 -0
- data/ios_tests/Rakefile +47 -0
- data/ios_tests/UICatalog.app.zip +0 -0
- data/ios_tests/UICatalog.app/12-6AM.png +0 -0
- data/ios_tests/UICatalog.app/12-6PM.png +0 -0
- data/ios_tests/UICatalog.app/6-12AM.png +0 -0
- data/ios_tests/UICatalog.app/6-12PM.png +0 -0
- data/ios_tests/UICatalog.app/Default-568h@2x.png +0 -0
- data/ios_tests/UICatalog.app/Default@2x.png +0 -0
- data/ios_tests/UICatalog.app/Info.plist +0 -0
- data/ios_tests/UICatalog.app/PkgInfo +1 -0
- data/ios_tests/UICatalog.app/UIButton_custom.png +0 -0
- data/ios_tests/UICatalog.app/UICatalog +0 -0
- data/ios_tests/UICatalog.app/blueButton.png +0 -0
- data/ios_tests/UICatalog.app/bookmarkImage.png +0 -0
- data/ios_tests/UICatalog.app/bookmarkImageHighlighted.png +0 -0
- data/ios_tests/UICatalog.app/divider.png +0 -0
- data/ios_tests/UICatalog.app/en.lproj/AlertsViewController.nib +0 -0
- data/ios_tests/UICatalog.app/en.lproj/ButtonsViewController.nib +0 -0
- data/ios_tests/UICatalog.app/en.lproj/ControlsViewController.nib +0 -0
- data/ios_tests/UICatalog.app/en.lproj/ImagesViewController.nib +0 -0
- data/ios_tests/UICatalog.app/en.lproj/Localizable.strings +0 -0
- data/ios_tests/UICatalog.app/en.lproj/MainWindow.nib +0 -0
- data/ios_tests/UICatalog.app/en.lproj/PickerViewController.nib +0 -0
- data/ios_tests/UICatalog.app/en.lproj/SearchBarController.nib +0 -0
- data/ios_tests/UICatalog.app/en.lproj/SegmentViewController.nib +0 -0
- data/ios_tests/UICatalog.app/en.lproj/TextFieldController.nib +0 -0
- data/ios_tests/UICatalog.app/en.lproj/TextViewController.nib +0 -0
- data/ios_tests/UICatalog.app/en.lproj/ToolbarViewController.nib +0 -0
- data/ios_tests/UICatalog.app/en.lproj/TransitionViewController.nib +0 -0
- data/ios_tests/UICatalog.app/en.lproj/WebViewController.nib +0 -0
- data/ios_tests/UICatalog.app/orangeslide.png +0 -0
- data/ios_tests/UICatalog.app/scene1.jpg +0 -0
- data/ios_tests/UICatalog.app/scene2.jpg +0 -0
- data/ios_tests/UICatalog.app/scene3.jpg +0 -0
- data/ios_tests/UICatalog.app/scene4.jpg +0 -0
- data/ios_tests/UICatalog.app/scene5.jpg +0 -0
- data/ios_tests/UICatalog.app/searchBarBackground.png +0 -0
- data/ios_tests/UICatalog.app/segment_check.png +0 -0
- data/ios_tests/UICatalog.app/segment_search.png +0 -0
- data/ios_tests/UICatalog.app/segment_tools.png +0 -0
- data/ios_tests/UICatalog.app/segmentedBackground.png +0 -0
- data/ios_tests/UICatalog.app/slider_ball.png +0 -0
- data/ios_tests/UICatalog.app/toolbarBackground.png +0 -0
- data/ios_tests/UICatalog.app/whiteButton.png +0 -0
- data/ios_tests/UICatalog.app/yellowslide.png +0 -0
- data/ios_tests/appium.txt +3 -0
- data/ios_tests/flaky.txt +1 -0
- data/ios_tests/lib/format.rb +25 -0
- data/ios_tests/lib/ios/specs/common/element/window.rb +15 -0
- data/ios_tests/lib/ios/specs/common/helper.rb +204 -0
- data/ios_tests/lib/ios/specs/common/patch.rb +50 -0
- data/ios_tests/lib/ios/specs/common/version.rb +17 -0
- data/ios_tests/lib/ios/specs/device/device.rb +82 -0
- data/ios_tests/lib/ios/specs/device/multi_touch.rb +12 -0
- data/ios_tests/lib/ios/specs/device/touch_actions.rb +15 -0
- data/ios_tests/lib/ios/specs/driver.rb +203 -0
- data/ios_tests/lib/ios/specs/ios/element/alert.rb +48 -0
- data/ios_tests/lib/ios/specs/ios/element/button.rb +58 -0
- data/ios_tests/lib/ios/specs/ios/element/generic.rb +35 -0
- data/ios_tests/lib/ios/specs/ios/element/text.rb +54 -0
- data/ios_tests/lib/ios/specs/ios/element/textfield.rb +123 -0
- data/ios_tests/lib/ios/specs/ios/helper.rb +27 -0
- data/ios_tests/lib/ios/specs/ios/patch.rb +30 -0
- data/ios_tests/lib/run.rb +106 -0
- data/ios_tests/readme.md +30 -0
- data/ios_tests/upload/sauce_storage.rb +64 -0
- data/ios_tests/upload/upload.rb +6 -0
- data/lib/appium_lib.rb +4 -14
- data/lib/appium_lib/android/dynamic.rb +30 -32
- data/lib/appium_lib/android/element/alert.rb +34 -33
- data/lib/appium_lib/android/element/button.rb +91 -0
- data/lib/appium_lib/android/element/generic.rb +51 -146
- data/lib/appium_lib/android/element/text.rb +54 -0
- data/lib/appium_lib/android/element/textfield.rb +46 -41
- data/lib/appium_lib/android/helper.rb +248 -417
- data/lib/appium_lib/android/mobile_methods.rb +17 -0
- data/lib/appium_lib/android/patch.rb +9 -8
- data/lib/appium_lib/awesome_print/ostruct.rb +33 -0
- data/lib/appium_lib/common/element/window.rb +9 -8
- data/lib/appium_lib/common/helper.rb +182 -243
- data/lib/appium_lib/common/patch.rb +65 -79
- data/lib/appium_lib/common/version.rb +2 -3
- data/lib/appium_lib/device/device.rb +339 -0
- data/lib/appium_lib/device/multi_touch.rb +94 -0
- data/lib/appium_lib/device/touch_actions.rb +142 -0
- data/lib/appium_lib/driver.rb +217 -306
- data/lib/appium_lib/ios/element/alert.rb +16 -92
- data/lib/appium_lib/ios/element/button.rb +55 -0
- data/lib/appium_lib/ios/element/generic.rb +27 -160
- data/lib/appium_lib/ios/element/text.rb +54 -0
- data/lib/appium_lib/ios/element/textfield.rb +78 -65
- data/lib/appium_lib/ios/helper.rb +300 -190
- data/lib/appium_lib/ios/mobile_methods.rb +17 -0
- data/lib/appium_lib/ios/patch.rb +55 -41
- data/lib/appium_lib/logger.rb +13 -0
- data/lib/appium_lib/rails/duplicable.rb +116 -0
- data/readme.md +6 -1
- data/release_notes.md +118 -0
- metadata +170 -12
- data/lib/appium_lib/common/element/button.rb +0 -83
- data/lib/appium_lib/common/element/text.rb +0 -61
@@ -1,83 +0,0 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
# UIAButton methods
|
3
|
-
module Appium::Common
|
4
|
-
# Find a button by text and optionally number.
|
5
|
-
# @param text [String, Integer] the text to exactly match. If int then the button at that index is returned.
|
6
|
-
# @param number [Integer] the occurrence of the button matching text. Defaults to the first button.
|
7
|
-
# @return [Button] the button found with text and matching number
|
8
|
-
def button text, number=0
|
9
|
-
# return button at index.
|
10
|
-
return ele_index :button, text if text.is_a? Numeric
|
11
|
-
|
12
|
-
number >= 1 ? button_num( text, number ) :
|
13
|
-
find_ele_by_text_include( :button, text )
|
14
|
-
end
|
15
|
-
|
16
|
-
# Get an array of button texts or button elements if text is provided.
|
17
|
-
# @param text [String] the text to exactly match
|
18
|
-
# @return [Array<String>, Array<Buttons>] either an array of button texts or an array of button elements if text is provided.
|
19
|
-
def buttons text=nil
|
20
|
-
text == nil ? find_eles_attr( :button, :text ) :
|
21
|
-
find_eles_by_text_include( :button, text )
|
22
|
-
end
|
23
|
-
|
24
|
-
# Get the first button element.
|
25
|
-
# @return [Button]
|
26
|
-
def first_button
|
27
|
-
first_ele :button
|
28
|
-
end
|
29
|
-
|
30
|
-
# Get the last button element.
|
31
|
-
# @return [Button]
|
32
|
-
def last_button
|
33
|
-
last_ele :button
|
34
|
-
end
|
35
|
-
|
36
|
-
# Get the first button element that exactly matches text.
|
37
|
-
# @param text [String] the text to match exactly
|
38
|
-
# @return [Button]
|
39
|
-
def button_exact text
|
40
|
-
find_ele_by_text :button, text
|
41
|
-
end
|
42
|
-
|
43
|
-
# Get all button elements that exactly match text.
|
44
|
-
# @param text [String] the text to match exactly
|
45
|
-
# @return [Array<Button>]
|
46
|
-
def buttons_exact text
|
47
|
-
find_eles_by_text :button, text
|
48
|
-
end
|
49
|
-
|
50
|
-
# Get an array of button elements.
|
51
|
-
# @return [Array<Button>]
|
52
|
-
def e_buttons
|
53
|
-
find_eles :button
|
54
|
-
end
|
55
|
-
|
56
|
-
# Expected to be called via button method.
|
57
|
-
#
|
58
|
-
# Get the button element exactly matching text and
|
59
|
-
# occurrence. number=2 means the 2nd occurrence.
|
60
|
-
#
|
61
|
-
# find the second Sign In button
|
62
|
-
#
|
63
|
-
# b = e_button 'Sign In', 2
|
64
|
-
#
|
65
|
-
# Button order will change in iOS vs Android
|
66
|
-
# so if there's no button found at number then
|
67
|
-
# return the first button.
|
68
|
-
#
|
69
|
-
# @param text [String] the text to match
|
70
|
-
# @param number [Integer] the button occurance to return. 1 = first button
|
71
|
-
# @return [Button] the button that matches text and number
|
72
|
-
def button_num text, number=1
|
73
|
-
raise 'Number must be >= 1' if number <= 0
|
74
|
-
number = number - 1 # zero indexed
|
75
|
-
result = nil
|
76
|
-
|
77
|
-
elements = buttons text
|
78
|
-
elements.size > number ? result = elements[number]
|
79
|
-
: result = elements.first
|
80
|
-
|
81
|
-
result
|
82
|
-
end
|
83
|
-
end # module Appium::Common
|
@@ -1,61 +0,0 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
# UIAStaticText methods
|
3
|
-
module Appium::Common
|
4
|
-
# s_ prefix for static_text to avoid conflict with generic text methods.
|
5
|
-
|
6
|
-
# Get an array of text texts if text is nil else
|
7
|
-
# Get all static textfields that include text.
|
8
|
-
# @param text [String] the text to find.
|
9
|
-
# @return [Array]
|
10
|
-
def s_texts text=nil
|
11
|
-
if text
|
12
|
-
find_eles_by_text_include :text, text
|
13
|
-
else
|
14
|
-
find_eles_attr :text, :text
|
15
|
-
end
|
16
|
-
end
|
17
|
-
|
18
|
-
def s_texts_names
|
19
|
-
find_eles_attr :text, :name
|
20
|
-
end
|
21
|
-
|
22
|
-
# Get an array of text elements.
|
23
|
-
# @return [Array<Text>]
|
24
|
-
def e_s_texts
|
25
|
-
find_eles :text
|
26
|
-
end
|
27
|
-
|
28
|
-
# Get the first text element.
|
29
|
-
# @return [Text]
|
30
|
-
def first_s_text
|
31
|
-
first_ele :text
|
32
|
-
end
|
33
|
-
|
34
|
-
# Get the last text element
|
35
|
-
# @return [Text]
|
36
|
-
def last_s_text
|
37
|
-
last_ele :text
|
38
|
-
end
|
39
|
-
|
40
|
-
# Get the first element that includes text.
|
41
|
-
# @param text [String, Integer] the text to find. If int then the text at that index is returned.
|
42
|
-
# @return [Text]
|
43
|
-
def s_text text
|
44
|
-
return ele_index :text, text if text.is_a? Numeric
|
45
|
-
find_ele_by_text_include :text, text
|
46
|
-
end
|
47
|
-
|
48
|
-
# Get the first textfield that matches text.
|
49
|
-
# @param text [String] the text that the tag must match
|
50
|
-
# @return [Text]
|
51
|
-
def s_text_exact text
|
52
|
-
find_ele_by_text :text, text
|
53
|
-
end
|
54
|
-
|
55
|
-
# Get all static textfields that matches text.
|
56
|
-
# @param text [String] the text that the tag must match
|
57
|
-
# @return [Array<Text>]
|
58
|
-
def s_texts_exact text
|
59
|
-
find_eles_by_text :text, text
|
60
|
-
end
|
61
|
-
end # module Appium::Common
|