appium_lib_core 5.0.0.beta1 → 5.0.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (37) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +13 -6
  3. data/README.md +2 -1
  4. data/Rakefile +4 -0
  5. data/appium_lib_core.gemspec +3 -3
  6. data/ci-jobs/functional_test.yml +1 -1
  7. data/docs/mobile_command.md +3 -2
  8. data/lib/appium_lib_core/android/device/auth_finger_print.rb +2 -1
  9. data/lib/appium_lib_core/common/base/bridge.rb +303 -7
  10. data/lib/appium_lib_core/common/base/device_ime.rb +49 -0
  11. data/lib/appium_lib_core/common/base/driver.rb +101 -105
  12. data/lib/appium_lib_core/common/base/driver_settings.rb +51 -0
  13. data/lib/appium_lib_core/common/base/has_location.rb +11 -4
  14. data/lib/appium_lib_core/common/base/has_network_connection.rb +1 -1
  15. data/lib/appium_lib_core/common/base/rotable.rb +1 -1
  16. data/lib/appium_lib_core/common/base/screenshot.rb +4 -3
  17. data/lib/appium_lib_core/common/base/search_context.rb +9 -4
  18. data/lib/appium_lib_core/common/base.rb +0 -2
  19. data/lib/appium_lib_core/common/command.rb +259 -3
  20. data/lib/appium_lib_core/common/device/keyevent.rb +4 -4
  21. data/lib/appium_lib_core/common/device/value.rb +4 -4
  22. data/lib/appium_lib_core/common/error.rb +4 -1
  23. data/lib/appium_lib_core/common/log.rb +4 -1
  24. data/lib/appium_lib_core/common/touch_action/touch_actions.rb +4 -1
  25. data/lib/appium_lib_core/device.rb +1 -1
  26. data/lib/appium_lib_core/driver.rb +3 -4
  27. data/lib/appium_lib_core/{patch.rb → element.rb} +9 -14
  28. data/lib/appium_lib_core/ios/uiautomation/patch.rb +1 -1
  29. data/lib/appium_lib_core/version.rb +2 -2
  30. data/lib/appium_lib_core.rb +2 -5
  31. data/release_notes.md +23 -0
  32. data/script/commands.rb +1 -12
  33. metadata +15 -17
  34. data/lib/appium_lib_core/common/base/bridge/w3c.rb +0 -348
  35. data/lib/appium_lib_core/common/base/command.rb +0 -145
  36. data/lib/appium_lib_core/common/command/common.rb +0 -110
  37. data/lib/appium_lib_core/common/command/w3c.rb +0 -56
@@ -1,145 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- # Licensed under the Apache License, Version 2.0 (the "License");
4
- # you may not use this file except in compliance with the License.
5
- # You may obtain a copy of the License at
6
- #
7
- # http://www.apache.org/licenses/LICENSE-2.0
8
- #
9
- # Unless required by applicable law or agreed to in writing, software
10
- # distributed under the License is distributed on an "AS IS" BASIS,
11
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- # See the License for the specific language governing permissions and
13
- # limitations under the License.
14
-
15
- module Appium
16
- module Core
17
- class Base
18
- module Commands
19
- W3C = {
20
- status: [:get, 'status'],
21
-
22
- #
23
- # session handling
24
- #
25
-
26
- new_session: [:post, 'session'],
27
- delete_session: [:delete, 'session/:session_id'],
28
-
29
- #
30
- # basic driver
31
- #
32
-
33
- get: [:post, 'session/:session_id/url'],
34
- get_current_url: [:get, 'session/:session_id/url'],
35
- back: [:post, 'session/:session_id/back'],
36
- forward: [:post, 'session/:session_id/forward'],
37
- refresh: [:post, 'session/:session_id/refresh'],
38
- get_title: [:get, 'session/:session_id/title'],
39
-
40
- #
41
- # window and Frame handling
42
- #
43
-
44
- get_window_handle: [:get, 'session/:session_id/window'],
45
- new_window: [:post, 'session/:session_id/window/new'],
46
- close_window: [:delete, 'session/:session_id/window'],
47
- switch_to_window: [:post, 'session/:session_id/window'],
48
- get_window_handles: [:get, 'session/:session_id/window/handles'],
49
- fullscreen_window: [:post, 'session/:session_id/window/fullscreen'],
50
- minimize_window: [:post, 'session/:session_id/window/minimize'],
51
- maximize_window: [:post, 'session/:session_id/window/maximize'],
52
- set_window_size: [:post, 'session/:session_id/window/size'],
53
- get_window_size: [:get, 'session/:session_id/window/size'],
54
- set_window_position: [:post, 'session/:session_id/window/position'],
55
- get_window_position: [:get, 'session/:session_id/window/position'],
56
- set_window_rect: [:post, 'session/:session_id/window/rect'],
57
- get_window_rect: [:get, 'session/:session_id/window/rect'],
58
- switch_to_frame: [:post, 'session/:session_id/frame'],
59
- switch_to_parent_frame: [:post, 'session/:session_id/frame/parent'],
60
-
61
- #
62
- # element
63
- #
64
-
65
- find_element: [:post, 'session/:session_id/element'],
66
- find_elements: [:post, 'session/:session_id/elements'],
67
- find_child_element: [:post, 'session/:session_id/element/:id/element'],
68
- find_child_elements: [:post, 'session/:session_id/element/:id/elements'],
69
- get_active_element: [:get, 'session/:session_id/element/active'],
70
- is_element_selected: [:get, 'session/:session_id/element/:id/selected'],
71
- get_element_attribute: [:get, 'session/:session_id/element/:id/attribute/:name'],
72
- get_element_property: [:get, 'session/:session_id/element/:id/property/:name'],
73
- get_element_css_value: [:get, 'session/:session_id/element/:id/css/:property_name'],
74
- get_element_text: [:get, 'session/:session_id/element/:id/text'],
75
- get_element_tag_name: [:get, 'session/:session_id/element/:id/name'],
76
- get_element_rect: [:get, 'session/:session_id/element/:id/rect'],
77
- is_element_enabled: [:get, 'session/:session_id/element/:id/enabled'],
78
-
79
- #
80
- # document handling
81
- #
82
-
83
- get_page_source: [:get, 'session/:session_id/source'],
84
- execute_script: [:post, 'session/:session_id/execute/sync'],
85
- execute_async_script: [:post, 'session/:session_id/execute/async'],
86
-
87
- #
88
- # cookies
89
- #
90
-
91
- get_all_cookies: [:get, 'session/:session_id/cookie'],
92
- get_cookie: [:get, 'session/:session_id/cookie/:name'],
93
- add_cookie: [:post, 'session/:session_id/cookie'],
94
- delete_cookie: [:delete, 'session/:session_id/cookie/:name'],
95
- delete_all_cookies: [:delete, 'session/:session_id/cookie'],
96
-
97
- #
98
- # timeouts
99
- #
100
-
101
- set_timeout: [:post, 'session/:session_id/timeouts'],
102
-
103
- #
104
- # actions
105
- #
106
-
107
- actions: [:post, 'session/:session_id/actions'],
108
- release_actions: [:delete, 'session/:session_id/actions'],
109
- print_page: [:post, 'session/:session_id/print'],
110
-
111
- #
112
- # Element Operations
113
- #
114
-
115
- element_click: [:post, 'session/:session_id/element/:id/click'],
116
- element_tap: [:post, 'session/:session_id/element/:id/tap'],
117
- element_clear: [:post, 'session/:session_id/element/:id/clear'],
118
- element_send_keys: [:post, 'session/:session_id/element/:id/value'],
119
-
120
- #
121
- # alerts
122
- #
123
-
124
- dismiss_alert: [:post, 'session/:session_id/alert/dismiss'],
125
- accept_alert: [:post, 'session/:session_id/alert/accept'],
126
- get_alert_text: [:get, 'session/:session_id/alert/text'],
127
- send_alert_text: [:post, 'session/:session_id/alert/text'],
128
-
129
- #
130
- # screenshot
131
- #
132
-
133
- take_screenshot: [:get, 'session/:session_id/screenshot'],
134
- take_element_screenshot: [:get, 'session/:session_id/element/:id/screenshot'],
135
-
136
- #
137
- # server extensions
138
- #
139
-
140
- upload_file: [:post, 'session/:session_id/se/file']
141
- }.freeze
142
- end # module Commands
143
- end # module Base
144
- end # module Core
145
- end # module Appium
@@ -1,110 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- # Licensed under the Apache License, Version 2.0 (the "License");
4
- # you may not use this file except in compliance with the License.
5
- # You may obtain a copy of the License at
6
- #
7
- # http://www.apache.org/licenses/LICENSE-2.0
8
- #
9
- # Unless required by applicable law or agreed to in writing, software
10
- # distributed under the License is distributed on an "AS IS" BASIS,
11
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- # See the License for the specific language governing permissions and
13
- # limitations under the License.
14
-
15
- module Appium
16
- module Core
17
- # ref: https://github.com/appium/appium-base-driver/blob/master/lib/mjsonwp/routes.js
18
- module Commands
19
- # Some commands differ for each driver.
20
- COMMAND = {
21
- # common
22
- get_all_sessions: [:get, 'sessions'],
23
- available_contexts: [:get, 'session/:session_id/contexts'],
24
- set_context: [:post, 'session/:session_id/context'],
25
- current_context: [:get, 'session/:session_id/context'],
26
-
27
- touch_actions: [:post, 'session/:session_id/touch/perform'],
28
- multi_touch: [:post, 'session/:session_id/touch/multi/perform'],
29
-
30
- set_immediate_value: [:post, 'session/:session_id/appium/element/:id/value'],
31
- replace_value: [:post, 'session/:session_id/appium/element/:id/replace_value'],
32
-
33
- launch_app: [:post, 'session/:session_id/appium/app/launch'],
34
- close_app: [:post, 'session/:session_id/appium/app/close'],
35
- reset: [:post, 'session/:session_id/appium/app/reset'],
36
- background_app: [:post, 'session/:session_id/appium/app/background'],
37
- app_strings: [:post, 'session/:session_id/appium/app/strings'],
38
-
39
- device_locked?: [:post, 'session/:session_id/appium/device/is_locked'],
40
- unlock: [:post, 'session/:session_id/appium/device/unlock'],
41
- lock: [:post, 'session/:session_id/appium/device/lock'],
42
- device_time: [:get, 'session/:session_id/appium/device/system_time'],
43
- install_app: [:post, 'session/:session_id/appium/device/install_app'],
44
- remove_app: [:post, 'session/:session_id/appium/device/remove_app'],
45
- app_installed?: [:post, 'session/:session_id/appium/device/app_installed'],
46
- activate_app: [:post, 'session/:session_id/appium/device/activate_app'],
47
- terminate_app: [:post, 'session/:session_id/appium/device/terminate_app'],
48
- app_state: [:post, 'session/:session_id/appium/device/app_state'],
49
- shake: [:post, 'session/:session_id/appium/device/shake'],
50
- hide_keyboard: [:post, 'session/:session_id/appium/device/hide_keyboard'],
51
- press_keycode: [:post, 'session/:session_id/appium/device/press_keycode'],
52
- long_press_keycode: [:post, 'session/:session_id/appium/device/long_press_keycode'],
53
- # keyevent is only for Selendroid
54
- keyevent: [:post, 'session/:session_id/appium/device/keyevent'],
55
- push_file: [:post, 'session/:session_id/appium/device/push_file'],
56
- pull_file: [:post, 'session/:session_id/appium/device/pull_file'],
57
- pull_folder: [:post, 'session/:session_id/appium/device/pull_folder'],
58
- get_clipboard: [:post, 'session/:session_id/appium/device/get_clipboard'],
59
- set_clipboard: [:post, 'session/:session_id/appium/device/set_clipboard'],
60
- finger_print: [:post, 'session/:session_id/appium/device/finger_print'],
61
- get_settings: [:get, 'session/:session_id/appium/settings'],
62
- update_settings: [:post, 'session/:session_id/appium/settings'],
63
- stop_recording_screen: [:post, 'session/:session_id/appium/stop_recording_screen'],
64
- start_recording_screen: [:post, 'session/:session_id/appium/start_recording_screen'],
65
- compare_images: [:post, 'session/:session_id/appium/compare_images'],
66
- is_keyboard_shown: [:get, 'session/:session_id/appium/device/is_keyboard_shown'],
67
- execute_driver: [:post, 'session/:session_id/appium/execute_driver'],
68
- post_log_event: [:post, 'session/:session_id/appium/log_event'],
69
- get_log_events: [:post, 'session/:session_id/appium/events']
70
- }.freeze
71
-
72
- COMMAND_ANDROID = {
73
- open_notifications: [:post, 'session/:session_id/appium/device/open_notifications'],
74
- toggle_airplane_mode: [:post, 'session/:session_id/appium/device/toggle_airplane_mode'],
75
- start_activity: [:post, 'session/:session_id/appium/device/start_activity'],
76
- current_activity: [:get, 'session/:session_id/appium/device/current_activity'],
77
- current_package: [:get, 'session/:session_id/appium/device/current_package'],
78
- get_system_bars: [:get, 'session/:session_id/appium/device/system_bars'],
79
- get_display_density: [:get, 'session/:session_id/appium/device/display_density'],
80
- toggle_wifi: [:post, 'session/:session_id/appium/device/toggle_wifi'],
81
- toggle_data: [:post, 'session/:session_id/appium/device/toggle_data'],
82
- toggle_location_services: [:post, 'session/:session_id/appium/device/toggle_location_services'],
83
- end_coverage: [:post, 'session/:session_id/appium/app/end_test_coverage'],
84
- get_performance_data_types: [:post, 'session/:session_id/appium/performanceData/types'],
85
- get_performance_data: [:post, 'session/:session_id/appium/getPerformanceData'],
86
- get_network_connection: [:get, 'session/:session_id/network_connection'], # defined also in OSS
87
- set_network_connection: [:post, 'session/:session_id/network_connection'], # defined also in OSS
88
-
89
- # only emulator
90
- send_sms: [:post, 'session/:session_id/appium/device/send_sms'],
91
- gsm_call: [:post, 'session/:session_id/appium/device/gsm_call'],
92
- gsm_signal: [:post, 'session/:session_id/appium/device/gsm_signal'],
93
- gsm_voice: [:post, 'session/:session_id/appium/device/gsm_voice'],
94
- set_network_speed: [:post, 'session/:session_id/appium/device/network_speed'],
95
- set_power_capacity: [:post, 'session/:session_id/appium/device/power_capacity'],
96
- set_power_ac: [:post, 'session/:session_id/appium/device/power_ac'],
97
-
98
- # For chromium: https://chromium.googlesource.com/chromium/src/+/master/chrome/test/chromedriver/server/http_handler.cc
99
- chrome_send_command: [:post, 'session/:session_id/goog/cdp/execute']
100
- }.freeze
101
-
102
- COMMAND_IOS = {
103
- touch_id: [:post, 'session/:session_id/appium/simulator/touch_id'],
104
- toggle_touch_id_enrollment: [:post, 'session/:session_id/appium/simulator/toggle_touch_id_enrollment']
105
- }.freeze
106
-
107
- COMMANDS = {}.merge(COMMAND).merge(COMMAND_ANDROID).merge(COMMAND_IOS).freeze
108
- end # module Commands
109
- end # module Core
110
- end # module Appium
@@ -1,56 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- # Licensed under the Apache License, Version 2.0 (the "License");
4
- # you may not use this file except in compliance with the License.
5
- # You may obtain a copy of the License at
6
- #
7
- # http://www.apache.org/licenses/LICENSE-2.0
8
- #
9
- # Unless required by applicable law or agreed to in writing, software
10
- # distributed under the License is distributed on an "AS IS" BASIS,
11
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- # See the License for the specific language governing permissions and
13
- # limitations under the License.
14
-
15
- module Appium
16
- module Core
17
- module Commands
18
- module W3C
19
- COMMANDS = ::Appium::Core::Commands::COMMANDS.merge(::Appium::Core::Base::Commands::W3C).merge(
20
- {
21
- # ::Appium::Core::Base::Commands::OSS has the following commands and Appium also use them.
22
- # Delegated to ::Appium::Core::Base::Commands::OSS commands
23
- status: [:get, 'status'], # https://w3c.github.io/webdriver/#dfn-status
24
- is_element_displayed: [:get, 'session/:session_id/element/:id/displayed'], # hint: https://w3c.github.io/webdriver/#element-displayedness
25
-
26
- get_timeouts: [:get, 'session/:session_id/timeouts'], # https://w3c.github.io/webdriver/#get-timeouts
27
-
28
- # Add OSS commands to W3C commands. We can remove them if we would like to remove them from W3C module.
29
- ### Session capability
30
- get_capabilities: [:get, 'session/:session_id'],
31
-
32
- ### rotatable
33
- get_screen_orientation: [:get, 'session/:session_id/orientation'],
34
- set_screen_orientation: [:post, 'session/:session_id/orientation'],
35
-
36
- get_location: [:get, 'session/:session_id/location'],
37
- set_location: [:post, 'session/:session_id/location'],
38
-
39
- ### For IME
40
- ime_get_available_engines: [:get, 'session/:session_id/ime/available_engines'],
41
- ime_get_active_engine: [:get, 'session/:session_id/ime/active_engine'],
42
- ime_is_activated: [:get, 'session/:session_id/ime/activated'],
43
- ime_deactivate: [:post, 'session/:session_id/ime/deactivate'],
44
- ime_activate_engine: [:post, 'session/:session_id/ime/activate'],
45
-
46
- send_keys_to_active_element: [:post, 'session/:session_id/keys'],
47
-
48
- ### Logs
49
- get_available_log_types: [:get, 'session/:session_id/log/types'],
50
- get_log: [:post, 'session/:session_id/log']
51
- }
52
- ).freeze
53
- end # module W3C
54
- end # module Commands
55
- end # module Core
56
- end # module Appium