appium_lib 9.4.5 → 9.4.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (116) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +9 -0
  3. data/appium_lib.gemspec +1 -1
  4. data/docs/android_docs.md +224 -224
  5. data/docs/ios_docs.md +250 -250
  6. data/lib/appium_lib/common/version.rb +1 -1
  7. data/release_notes.md +13 -0
  8. metadata +1 -109
  9. data/android_tests/Gemfile +0 -2
  10. data/android_tests/LICENSE-2.0.txt +0 -202
  11. data/android_tests/Rakefile +0 -68
  12. data/android_tests/api.apk +0 -0
  13. data/android_tests/appium.txt +0 -11
  14. data/android_tests/flaky.txt +0 -1
  15. data/android_tests/lib/android/specs/android/element/alert.rb +0 -48
  16. data/android_tests/lib/android/specs/android/element/button.rb +0 -52
  17. data/android_tests/lib/android/specs/android/element/generic.rb +0 -58
  18. data/android_tests/lib/android/specs/android/element/text.rb +0 -35
  19. data/android_tests/lib/android/specs/android/element/textfield.rb +0 -62
  20. data/android_tests/lib/android/specs/android/helper.rb +0 -111
  21. data/android_tests/lib/android/specs/android/patch.rb +0 -27
  22. data/android_tests/lib/android/specs/common/command.rb +0 -52
  23. data/android_tests/lib/android/specs/common/device.rb +0 -159
  24. data/android_tests/lib/android/specs/common/device_touchaction.rb +0 -34
  25. data/android_tests/lib/android/specs/common/element/window.rb +0 -11
  26. data/android_tests/lib/android/specs/common/helper.rb +0 -112
  27. data/android_tests/lib/android/specs/common/patch.rb +0 -78
  28. data/android_tests/lib/android/specs/common/version.rb +0 -9
  29. data/android_tests/lib/android/specs/common/web_context.rb +0 -60
  30. data/android_tests/lib/android/specs/device/touch_actions.rb +0 -71
  31. data/android_tests/lib/android/specs/driver.rb +0 -280
  32. data/android_tests/lib/android/specs/install.rb +0 -26
  33. data/android_tests/lib/format.rb +0 -47
  34. data/android_tests/lib/run.rb +0 -91
  35. data/android_tests/readme.md +0 -30
  36. data/grid/README.md +0 -21
  37. data/grid/appium.txt.ios.example +0 -15
  38. data/grid/config.json +0 -25
  39. data/grid/hub_config.json +0 -14
  40. data/grid/selenium-server-standalone-2.53.1.jar +0 -0
  41. data/grid/selenium-server-standalone-3.2.0.jar +0 -0
  42. data/ios_tests/Gemfile +0 -4
  43. data/ios_tests/LICENSE-2.0.txt +0 -202
  44. data/ios_tests/Rakefile +0 -54
  45. data/ios_tests/UICatalog.app.zip +0 -0
  46. data/ios_tests/UICatalog.app/12-6AM.png +0 -0
  47. data/ios_tests/UICatalog.app/12-6PM.png +0 -0
  48. data/ios_tests/UICatalog.app/6-12AM.png +0 -0
  49. data/ios_tests/UICatalog.app/6-12PM.png +0 -0
  50. data/ios_tests/UICatalog.app/Default-568h@2x.png +0 -0
  51. data/ios_tests/UICatalog.app/Default@2x.png +0 -0
  52. data/ios_tests/UICatalog.app/Info.plist +0 -0
  53. data/ios_tests/UICatalog.app/PkgInfo +0 -1
  54. data/ios_tests/UICatalog.app/UIButton_custom.png +0 -0
  55. data/ios_tests/UICatalog.app/UICatalog +0 -0
  56. data/ios_tests/UICatalog.app/blueButton.png +0 -0
  57. data/ios_tests/UICatalog.app/bookmarkImage.png +0 -0
  58. data/ios_tests/UICatalog.app/bookmarkImageHighlighted.png +0 -0
  59. data/ios_tests/UICatalog.app/divider.png +0 -0
  60. data/ios_tests/UICatalog.app/en.lproj/AlertsViewController.nib +0 -0
  61. data/ios_tests/UICatalog.app/en.lproj/ButtonsViewController.nib +0 -0
  62. data/ios_tests/UICatalog.app/en.lproj/ControlsViewController.nib +0 -0
  63. data/ios_tests/UICatalog.app/en.lproj/ImagesViewController.nib +0 -0
  64. data/ios_tests/UICatalog.app/en.lproj/Localizable.strings +0 -0
  65. data/ios_tests/UICatalog.app/en.lproj/MainWindow.nib +0 -0
  66. data/ios_tests/UICatalog.app/en.lproj/PickerViewController.nib +0 -0
  67. data/ios_tests/UICatalog.app/en.lproj/SearchBarController.nib +0 -0
  68. data/ios_tests/UICatalog.app/en.lproj/SegmentViewController.nib +0 -0
  69. data/ios_tests/UICatalog.app/en.lproj/TextFieldController.nib +0 -0
  70. data/ios_tests/UICatalog.app/en.lproj/TextViewController.nib +0 -0
  71. data/ios_tests/UICatalog.app/en.lproj/ToolbarViewController.nib +0 -0
  72. data/ios_tests/UICatalog.app/en.lproj/TransitionViewController.nib +0 -0
  73. data/ios_tests/UICatalog.app/en.lproj/WebViewController.nib +0 -0
  74. data/ios_tests/UICatalog.app/orangeslide.png +0 -0
  75. data/ios_tests/UICatalog.app/scene1.jpg +0 -0
  76. data/ios_tests/UICatalog.app/scene2.jpg +0 -0
  77. data/ios_tests/UICatalog.app/scene3.jpg +0 -0
  78. data/ios_tests/UICatalog.app/scene4.jpg +0 -0
  79. data/ios_tests/UICatalog.app/scene5.jpg +0 -0
  80. data/ios_tests/UICatalog.app/searchBarBackground.png +0 -0
  81. data/ios_tests/UICatalog.app/segment_check.png +0 -0
  82. data/ios_tests/UICatalog.app/segment_search.png +0 -0
  83. data/ios_tests/UICatalog.app/segment_tools.png +0 -0
  84. data/ios_tests/UICatalog.app/segmentedBackground.png +0 -0
  85. data/ios_tests/UICatalog.app/slider_ball.png +0 -0
  86. data/ios_tests/UICatalog.app/toolbarBackground.png +0 -0
  87. data/ios_tests/UICatalog.app/whiteButton.png +0 -0
  88. data/ios_tests/UICatalog.app/yellowslide.png +0 -0
  89. data/ios_tests/appium.txt +0 -15
  90. data/ios_tests/data/unicode.txt +0 -1
  91. data/ios_tests/flaky.txt +0 -1
  92. data/ios_tests/lib/common.rb +0 -84
  93. data/ios_tests/lib/format.rb +0 -23
  94. data/ios_tests/lib/ios/specs/common/command.rb +0 -45
  95. data/ios_tests/lib/ios/specs/common/element/window.rb +0 -17
  96. data/ios_tests/lib/ios/specs/common/helper.rb +0 -228
  97. data/ios_tests/lib/ios/specs/common/patch.rb +0 -54
  98. data/ios_tests/lib/ios/specs/common/version.rb +0 -17
  99. data/ios_tests/lib/ios/specs/common/web_context.rb +0 -15
  100. data/ios_tests/lib/ios/specs/device/device.rb +0 -130
  101. data/ios_tests/lib/ios/specs/device/multi_touch.rb +0 -31
  102. data/ios_tests/lib/ios/specs/device/touch_actions.rb +0 -90
  103. data/ios_tests/lib/ios/specs/driver.rb +0 -308
  104. data/ios_tests/lib/ios/specs/ios/element/alert.rb +0 -51
  105. data/ios_tests/lib/ios/specs/ios/element/button.rb +0 -58
  106. data/ios_tests/lib/ios/specs/ios/element/generic.rb +0 -37
  107. data/ios_tests/lib/ios/specs/ios/element/text.rb +0 -63
  108. data/ios_tests/lib/ios/specs/ios/element/textfield.rb +0 -135
  109. data/ios_tests/lib/ios/specs/ios/helper.rb +0 -59
  110. data/ios_tests/lib/ios/specs/ios/mobile_methods.rb +0 -20
  111. data/ios_tests/lib/ios/specs/ios/patch.rb +0 -34
  112. data/ios_tests/lib/ios/specs/ios/xcuitest_gestures.rb +0 -110
  113. data/ios_tests/lib/run.rb +0 -4
  114. data/ios_tests/readme.md +0 -31
  115. data/ios_tests/upload/sauce_storage.rb +0 -67
  116. data/ios_tests/upload/upload.rb +0 -6
@@ -1,51 +0,0 @@
1
- # rake ios[ios/element/alert]
2
- describe 'ios/element/alert' do
3
- def nav_once
4
- screen.must_equal catalog
5
- wait_true do
6
- UI::Inventory.xcuitest? ? find_element(:name, 'Alerts').click : text('alerts').click
7
- tag(UI::Inventory.navbar).name == 'Alerts' # wait for true
8
- end
9
-
10
- # redefine method as no-op after it's invoked once
11
- self.class.send :define_method, :nav_once, proc {}
12
- end
13
-
14
- def after_last
15
- alert_accept if exists do
16
- UI::Inventory.xcuitest? ? find_elements(:name, 'UIActionSheet <title>') : text('UIActionSheet <title>')
17
- end
18
- back_click
19
- screen.must_equal catalog
20
- sleep 1
21
- end
22
-
23
- before do
24
- nav_once
25
- open_alert
26
- end
27
-
28
- def open_alert
29
- wait_true do
30
- if UI::Inventory.xcuitest?
31
- find_element(:name, 'Show OK-Cancel').click
32
- find_element(:name, 'UIActionSheet <title>').displayed?
33
- else
34
- text('Show OK-Cancel').click
35
- text('UIActionSheet <title>').displayed?
36
- end
37
- end
38
- end
39
-
40
- t 'alert_accept' do
41
- alert_accept
42
- end
43
-
44
- t 'alert_dismiss' do
45
- alert_dismiss
46
- end
47
-
48
- t 'after_last' do
49
- after_last
50
- end
51
- end
@@ -1,58 +0,0 @@
1
- # rake ios['ios/element/button']
2
- describe 'ios/element/button' do
3
- def before_first
4
- screen.must_equal catalog
5
- # nav to buttons activity
6
- wait { UI::Inventory.xcuitest? ? find_element(:name, 'Buttons').click : text('buttons').click }
7
- end
8
-
9
- def after_last
10
- # nav back to start
11
- back_click
12
- end
13
-
14
- t 'before_first' do
15
- before_first
16
- end
17
-
18
- def gray
19
- 'Gray'
20
- end
21
-
22
- t 'button' do
23
- # by index
24
- button(3).name.must_equal gray # or UIButtonTypeInfoDark in XCUITest
25
-
26
- # by name contains
27
- button('ray').name.must_equal gray
28
- end
29
-
30
- t 'buttons' do
31
- exp = ['Back', 'Back', 'Gray', 'Right pointing arrow']
32
-
33
- target_buttons = buttons('a')
34
- target_buttons.map(&:name).must_equal exp
35
- target_buttons.length.must_equal exp.length
36
- end
37
-
38
- t 'first_button' do
39
- first_button.name.must_equal 'Back'
40
- end
41
-
42
- t 'last_button' do
43
- expected = 'Rounded'
44
- last_button.name.must_equal expected
45
- end
46
-
47
- t 'button_exact' do
48
- button_exact(gray).name.must_equal gray
49
- end
50
-
51
- t 'buttons_exact' do
52
- buttons_exact(gray).first.name.must_equal gray
53
- end
54
-
55
- t 'after_last' do
56
- after_last
57
- end
58
- end
@@ -1,37 +0,0 @@
1
- # rake ios['ios/element/generic']
2
- describe 'ios/element/generic' do
3
- def before_first
4
- screen.must_equal catalog
5
- end
6
-
7
- def uibutton_text
8
- 'Buttons'
9
- end
10
-
11
- def verify(element)
12
- element = element.first if element.is_a? Array
13
- element.name.must_equal uibutton_text
14
- end
15
-
16
- t 'before_first' do
17
- before_first
18
- end
19
-
20
- t 'find' do
21
- verify find 'tons'
22
- end
23
-
24
- t 'finds' do
25
- verify finds 'tons'
26
- end
27
-
28
- t 'find_exact' do
29
- verify find_exact uibutton_text
30
- end
31
-
32
- t 'finds_exact' do
33
- elements = finds_exact uibutton_text
34
- elements.is_a?(Array).must_equal true
35
- verify elements
36
- end
37
- end
@@ -1,63 +0,0 @@
1
- # rubocop:disable Lint/HandleExceptions
2
-
3
- # rake ios['ios/element/text']
4
- describe 'ios/element/text' do
5
- def ui_catalog
6
- 'UICatalog'
7
- end
8
-
9
- def uiview_transitions
10
- 'Transitions'
11
- end
12
-
13
- def before_first
14
- screen.must_equal catalog
15
- end
16
-
17
- t 'before_first' do
18
- before_first
19
- end
20
-
21
- t 'first_text' do
22
- first_text.text.must_equal ui_catalog
23
- end
24
-
25
- t 'last_text' do
26
- expected = 'Transitions'
27
-
28
- last_text.text.must_equal expected
29
- last_text.name.must_equal expected
30
- end
31
-
32
- t 'text' do
33
- text('siti').text.must_equal uiview_transitions
34
- text(1).text.must_equal ui_catalog
35
- text('siti').name.must_equal uiview_transitions
36
- end
37
-
38
- t 'texts' do
39
- exp = ['Controls', 'Various uses of UIControl', 'Various uses of UISegmentedControl']
40
- texts.length.must_equal 24
41
- texts('trol').map(&:name).must_equal exp
42
- texts('uses').length.must_equal 7
43
- end
44
-
45
- t 'text_exact' do
46
- # should fail
47
- set_wait 0
48
- act = begin
49
- text_exact 'mos'
50
- rescue
51
- # nop
52
- end
53
- act.must_be_nil
54
- set_wait
55
-
56
- # should pass
57
- text_exact(ui_catalog).text.must_equal ui_catalog
58
- end
59
-
60
- t 'texts_exact' do
61
- texts_exact('UICatalog').length.must_equal 1
62
- end
63
- end
@@ -1,135 +0,0 @@
1
- # rake ios[ios/element/textfield]
2
- describe 'ios/element/textfield' do
3
- def enter_text
4
- '<enter text>'
5
- end
6
-
7
- def enter_password
8
- '<enter password>'
9
- end
10
-
11
- def before_first
12
- go_to_textfields
13
- end
14
-
15
- def after_last
16
- set_wait 30
17
- end
18
-
19
- t 'before_first' do
20
- before_first
21
- end
22
-
23
- t 'textfield' do
24
- textfield(1).text.must_equal(enter_text)
25
- textfield(enter_text).text.must_equal(enter_text)
26
- textfield('word').value.must_equal enter_password
27
- end
28
-
29
- t 'textfields' do
30
- values = textfields('enter').map(&:value)
31
- values.include?('<enter text>').must_equal true
32
- values.include?('<enter password>').must_equal true
33
- textfields.length.must_equal 4
34
- end
35
-
36
- t 'predicate textfields' do
37
- textfields = if UI::Inventory.xcuitest?
38
- find_elements(:predicate, "type contains[c] 'textfield'")
39
- else
40
- execute_script(%(au.mainApp().getAllWithPredicate("type contains[c] 'textfield'", true)))
41
- end
42
-
43
- textfields.length.must_equal 4
44
- end
45
-
46
- t 'first_textfield' do
47
- first_textfield.text.must_equal enter_text
48
- end
49
-
50
- t 'last_textfield' do
51
- last_textfield.text.must_equal enter_text
52
- end
53
-
54
- t 'textfield_exact' do
55
- textfield_exact(enter_password).value.must_equal enter_password
56
- end
57
-
58
- t 'textfields_exact' do
59
- textfields_exact(enter_password).first.value.must_equal enter_password
60
- end
61
-
62
- def keyboard_exists?
63
- !!ignore { wait_true(3) { execute_script 'au.mainApp().keyboard().type() !== "UIAElementNil"' } }
64
- end
65
-
66
- def keyboard_must_not_exist
67
- keyboard_exists?.must_equal false
68
- end
69
-
70
- def keyboard_must_exist
71
- keyboard_exists?.must_equal true
72
- end
73
-
74
- t 'textfield type' do
75
- # Regular send keys triggers the keyboard and doesn't dismiss
76
- keyboard_must_not_exist unless UI::Inventory.xcuitest? # xcuitest doesn't support JS command
77
- textfield(1).send_keys "o'k"
78
- keyboard_must_exist unless UI::Inventory.xcuitest? # xcuitest doesn't support JS command
79
-
80
- find_exact("o'k").text.must_equal "o'k"
81
-
82
- unless UI::Inventory.xcuitest?
83
- # type should not dismiss the keyboard
84
- message = 'type test type'
85
- textfield(1).type message
86
- keyboard_must_exist
87
- textfield(1).text.must_equal message
88
- end
89
- end
90
-
91
- def must_raise_no_element
92
- proc { yield }.must_raise Selenium::WebDriver::Error::NoSuchElementError
93
- end
94
-
95
- t 'hide_keyboard' do
96
- first_textfield.click
97
- hide_keyboard
98
- end
99
-
100
- # test textfield methods with no textfields
101
-
102
- t 'leave textfields' do
103
- set_wait 1
104
- leave_textfields
105
- end
106
-
107
- t 'no textfield' do
108
- must_raise_no_element { textfield(1) }
109
- must_raise_no_element { textfield('does not exist') }
110
- end
111
-
112
- t 'no textfields' do
113
- textfields('does not exist').length.must_equal 0
114
- end
115
-
116
- t 'no first_textfield' do
117
- must_raise_no_element { first_textfield }
118
- end
119
-
120
- t 'no last_textfield' do
121
- must_raise_no_element { last_textfield }
122
- end
123
-
124
- t 'no textfield_exact' do
125
- must_raise_no_element { textfield_exact('does not exist') }
126
- end
127
-
128
- t 'no textfields_exact' do
129
- textfields_exact('does not exist').length.must_equal 0
130
- end
131
-
132
- t 'after_last' do
133
- after_last
134
- end
135
- end
@@ -1,59 +0,0 @@
1
- # rake ios[ios/helper]
2
- describe 'ios/helper' do
3
- def before_first
4
- screen.must_equal catalog
5
- end
6
-
7
- t 'before_first' do
8
- before_first
9
- end
10
-
11
- t 'ios_password' do
12
- ios_password.must_equal 8226.chr('UTF-8')
13
- ios_password(2).must_equal 8226.chr('UTF-8') * 2
14
- end
15
-
16
- # TODO: t 'get_page' do
17
-
18
- # t 'page' do # writes to std out
19
-
20
- t 'source_window' do
21
- source_window.length.must_be :>=, 14_000
22
- end
23
-
24
- # TODO: t 'page_window' do
25
-
26
- t 'id' do
27
- id 'Buttons' # 'Various uses of UIButton'
28
- end
29
-
30
- t 'ios_version' do
31
- ios_version.wont_be_empty
32
- end
33
-
34
- t 'tags_include' do
35
- elements = tags_include class_names: %w(XCUIElementTypeTextView)
36
- elements.length.must_equal 0
37
-
38
- elements = tags_include class_names: %w(XCUIElementTypeTextView XCUIElementTypeStaticText)
39
- elements.length.must_equal 24
40
-
41
- elements = tags_include class_names: %w(XCUIElementTypeTextView XCUIElementTypeStaticText), value: 'u'
42
- elements.length.must_equal 13
43
- end
44
-
45
- t 'tags_exact' do
46
- elements = tags_exact class_names: %w()
47
- elements.length.must_equal 0
48
-
49
- elements = tags_exact class_names: %w(XCUIElementTypeStaticText)
50
- elements.length.must_equal 24
51
-
52
- elements = tags_exact class_names: %w(XCUIElementTypeTextView XCUIElementTypeStaticText)
53
- elements.length.must_equal 24
54
-
55
- elements = tags_exact class_names: %w(XCUIElementTypeTextView XCUIElementTypeStaticText), value: 'Buttons'
56
- elements.length.must_equal 1
57
- elements.first.value.must_equal 'Buttons'
58
- end
59
- end
@@ -1,20 +0,0 @@
1
- # rake ios[ios/mobile_methods]
2
- describe 'ios/mobile_methods' do
3
- def before_first
4
- screen.must_equal catalog
5
- end
6
-
7
- t 'an element with class chain' do
8
- element = find_element :class_chain, 'XCUIElementTypeWindow/*/*/XCUIElementTypeStaticText'
9
-
10
- element.name.must_equal catalog
11
- end
12
-
13
- t 'elements with class chain' do
14
- elements = find_elements :class_chain, 'XCUIElementTypeWindow/*/*'
15
-
16
- elements.size.must_equal 2
17
- elements[0].name.must_equal catalog
18
- elements[1].name.must_be_nil
19
- end
20
- end
@@ -1,34 +0,0 @@
1
- # rake ios[ios/patch]
2
- describe 'ios/patch' do
3
- def before_first
4
- screen.must_equal catalog
5
- go_to_textfields
6
- end
7
-
8
- def after_last
9
- leave_textfields
10
- end
11
-
12
- t 'before_first' do
13
- before_first
14
- end
15
-
16
- t 'label' do
17
- textfield('<enter text>').label.must_equal 'Rounded'
18
- end
19
-
20
- t 'type' do
21
- # nav to textfield
22
- text('textfields').click
23
-
24
- ele = first_textfield
25
-
26
- ele.clear
27
- ele.type 'ok'
28
- ele.text.must_equal 'ok'
29
- end
30
-
31
- t 'after_last' do
32
- after_last
33
- end
34
- end