selenium-webdriver 4.0.0.alpha5 → 4.0.0.alpha6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (79) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGES +38 -0
  3. data/LICENSE +1 -1
  4. data/lib/selenium/webdriver/atoms/findElements.js +1 -1
  5. data/lib/selenium/webdriver/chrome/bridge.rb +4 -6
  6. data/lib/selenium/webdriver/chrome/driver.rb +4 -0
  7. data/lib/selenium/webdriver/chrome/options.rb +24 -19
  8. data/lib/selenium/webdriver/common.rb +1 -0
  9. data/lib/selenium/webdriver/common/driver.rb +55 -23
  10. data/lib/selenium/webdriver/common/logger.rb +1 -1
  11. data/lib/selenium/webdriver/common/manager.rb +5 -0
  12. data/lib/selenium/webdriver/common/options.rb +32 -9
  13. data/lib/selenium/webdriver/common/port_prober.rb +4 -6
  14. data/lib/selenium/webdriver/common/service.rb +12 -106
  15. data/lib/selenium/webdriver/common/service_manager.rb +151 -0
  16. data/lib/selenium/webdriver/devtools.rb +118 -0
  17. data/lib/selenium/webdriver/devtools/accessibility.rb +62 -0
  18. data/lib/selenium/webdriver/devtools/animation.rb +98 -0
  19. data/lib/selenium/webdriver/devtools/application_cache.rb +64 -0
  20. data/lib/selenium/webdriver/devtools/audits.rb +61 -0
  21. data/lib/selenium/webdriver/devtools/background_service.rb +67 -0
  22. data/lib/selenium/webdriver/devtools/browser.rb +123 -0
  23. data/lib/selenium/webdriver/devtools/cache_storage.rb +73 -0
  24. data/lib/selenium/webdriver/devtools/cast.rb +70 -0
  25. data/lib/selenium/webdriver/devtools/console.rb +57 -0
  26. data/lib/selenium/webdriver/devtools/css.rb +165 -0
  27. data/lib/selenium/webdriver/devtools/database.rb +64 -0
  28. data/lib/selenium/webdriver/devtools/debugger.rb +229 -0
  29. data/lib/selenium/webdriver/devtools/device_orientation.rb +53 -0
  30. data/lib/selenium/webdriver/devtools/dom.rb +320 -0
  31. data/lib/selenium/webdriver/devtools/domdebugger.rb +93 -0
  32. data/lib/selenium/webdriver/devtools/domsnapshot.rb +65 -0
  33. data/lib/selenium/webdriver/devtools/domstorage.rb +79 -0
  34. data/lib/selenium/webdriver/devtools/emulation.rb +180 -0
  35. data/lib/selenium/webdriver/devtools/fetch.rb +97 -0
  36. data/lib/selenium/webdriver/devtools/headless_experimental.rb +61 -0
  37. data/lib/selenium/webdriver/devtools/heap_profiler.rb +107 -0
  38. data/lib/selenium/webdriver/devtools/indexed_db.rb +100 -0
  39. data/lib/selenium/webdriver/devtools/input.rb +140 -0
  40. data/lib/selenium/webdriver/devtools/inspector.rb +55 -0
  41. data/lib/selenium/webdriver/devtools/io.rb +59 -0
  42. data/lib/selenium/webdriver/devtools/layer_tree.rb +95 -0
  43. data/lib/selenium/webdriver/devtools/log.rb +66 -0
  44. data/lib/selenium/webdriver/devtools/media.rb +57 -0
  45. data/lib/selenium/webdriver/devtools/memory.rb +86 -0
  46. data/lib/selenium/webdriver/devtools/network.rb +228 -0
  47. data/lib/selenium/webdriver/devtools/overlay.rb +157 -0
  48. data/lib/selenium/webdriver/devtools/page.rb +374 -0
  49. data/lib/selenium/webdriver/devtools/performance.rb +63 -0
  50. data/lib/selenium/webdriver/devtools/profiler.rb +111 -0
  51. data/lib/selenium/webdriver/devtools/runtime.rb +193 -0
  52. data/lib/selenium/webdriver/devtools/schema.rb +46 -0
  53. data/lib/selenium/webdriver/devtools/security.rb +71 -0
  54. data/lib/selenium/webdriver/devtools/service_worker.rb +116 -0
  55. data/lib/selenium/webdriver/devtools/storage.rb +95 -0
  56. data/lib/selenium/webdriver/devtools/system_info.rb +50 -0
  57. data/lib/selenium/webdriver/devtools/target.rb +141 -0
  58. data/lib/selenium/webdriver/devtools/tethering.rb +55 -0
  59. data/lib/selenium/webdriver/devtools/tracing.rb +76 -0
  60. data/lib/selenium/webdriver/devtools/web_audio.rb +70 -0
  61. data/lib/selenium/webdriver/devtools/web_authn.rb +94 -0
  62. data/lib/selenium/webdriver/edge_chrome/bridge.rb +9 -2
  63. data/lib/selenium/webdriver/edge_chrome/driver.rb +4 -0
  64. data/lib/selenium/webdriver/edge_chrome/options.rb +2 -0
  65. data/lib/selenium/webdriver/edge_html/options.rb +2 -9
  66. data/lib/selenium/webdriver/firefox/bridge.rb +1 -1
  67. data/lib/selenium/webdriver/firefox/driver.rb +4 -0
  68. data/lib/selenium/webdriver/firefox/options.rb +5 -10
  69. data/lib/selenium/webdriver/ie/options.rb +7 -10
  70. data/lib/selenium/webdriver/remote/bridge.rb +3 -13
  71. data/lib/selenium/webdriver/remote/capabilities.rb +11 -6
  72. data/lib/selenium/webdriver/safari/bridge.rb +1 -1
  73. data/lib/selenium/webdriver/safari/driver.rb +4 -0
  74. data/lib/selenium/webdriver/safari/options.rb +1 -8
  75. data/lib/selenium/webdriver/support/cdp_client_generator.rb +77 -0
  76. data/lib/selenium/webdriver/support/color.rb +2 -2
  77. data/lib/selenium/webdriver/version.rb +1 -1
  78. data/selenium-webdriver.gemspec +2 -2
  79. metadata +53 -5
@@ -0,0 +1,107 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Licensed to the Software Freedom Conservancy (SFC) under one
4
+ # or more contributor license agreements. See the NOTICE file
5
+ # distributed with this work for additional information
6
+ # regarding copyright ownership. The SFC licenses this file
7
+ # to you under the Apache License, Version 2.0 (the
8
+ # "License"); you may not use this file except in compliance
9
+ # with the License. You may obtain a copy of the License at
10
+ #
11
+ # http://www.apache.org/licenses/LICENSE-2.0
12
+ #
13
+ # Unless required by applicable law or agreed to in writing,
14
+ # software distributed under the License is distributed on an
15
+ # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16
+ # KIND, either express or implied. See the License for the
17
+ # specific language governing permissions and limitations
18
+ # under the License.
19
+
20
+ # This file is automatically generated. Any changes will be lost!
21
+ module Selenium
22
+ module WebDriver
23
+ class DevTools
24
+ def heap_profiler
25
+ @heap_profiler ||= HeapProfiler.new(self)
26
+ end
27
+
28
+ class HeapProfiler
29
+ EVENTS = {
30
+ add_heap_snapshot_chunk: 'addHeapSnapshotChunk',
31
+ heap_stats_update: 'heapStatsUpdate',
32
+ last_seen_object_id: 'lastSeenObjectId',
33
+ report_heap_snapshot_progress: 'reportHeapSnapshotProgress',
34
+ reset_profiles: 'resetProfiles',
35
+ }
36
+
37
+ def initialize(devtools)
38
+ @devtools = devtools
39
+ end
40
+
41
+ def on(event, &block)
42
+ event = EVENTS[event] if event.is_a?(Symbol)
43
+ @devtools.callbacks["HeapProfiler.#{event}"] << block
44
+ end
45
+
46
+ def add_inspected_heap_object(heap_object_id:)
47
+ @devtools.send_cmd('HeapProfiler.addInspectedHeapObject',
48
+ heapObjectId: heap_object_id)
49
+ end
50
+
51
+ def collect_garbage
52
+ @devtools.send_cmd('HeapProfiler.collectGarbage')
53
+ end
54
+
55
+ def disable
56
+ @devtools.send_cmd('HeapProfiler.disable')
57
+ end
58
+
59
+ def enable
60
+ @devtools.send_cmd('HeapProfiler.enable')
61
+ end
62
+
63
+ def get_heap_object_id(object_id:)
64
+ @devtools.send_cmd('HeapProfiler.getHeapObjectId',
65
+ objectId: object_id)
66
+ end
67
+
68
+ def get_object_by_heap_object_id(object_id:, object_group: nil)
69
+ @devtools.send_cmd('HeapProfiler.getObjectByHeapObjectId',
70
+ objectId: object_id,
71
+ objectGroup: object_group)
72
+ end
73
+
74
+ def get_sampling_profile
75
+ @devtools.send_cmd('HeapProfiler.getSamplingProfile')
76
+ end
77
+
78
+ def start_sampling(sampling_interval: nil)
79
+ @devtools.send_cmd('HeapProfiler.startSampling',
80
+ samplingInterval: sampling_interval)
81
+ end
82
+
83
+ def start_tracking_heap_objects(track_allocations: nil)
84
+ @devtools.send_cmd('HeapProfiler.startTrackingHeapObjects',
85
+ trackAllocations: track_allocations)
86
+ end
87
+
88
+ def stop_sampling
89
+ @devtools.send_cmd('HeapProfiler.stopSampling')
90
+ end
91
+
92
+ def stop_tracking_heap_objects(report_progress: nil, treat_global_objects_as_roots: nil)
93
+ @devtools.send_cmd('HeapProfiler.stopTrackingHeapObjects',
94
+ reportProgress: report_progress,
95
+ treatGlobalObjectsAsRoots: treat_global_objects_as_roots)
96
+ end
97
+
98
+ def take_heap_snapshot(report_progress: nil, treat_global_objects_as_roots: nil)
99
+ @devtools.send_cmd('HeapProfiler.takeHeapSnapshot',
100
+ reportProgress: report_progress,
101
+ treatGlobalObjectsAsRoots: treat_global_objects_as_roots)
102
+ end
103
+
104
+ end # HeapProfiler
105
+ end # DevTools
106
+ end # WebDriver
107
+ end # Selenium
@@ -0,0 +1,100 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Licensed to the Software Freedom Conservancy (SFC) under one
4
+ # or more contributor license agreements. See the NOTICE file
5
+ # distributed with this work for additional information
6
+ # regarding copyright ownership. The SFC licenses this file
7
+ # to you under the Apache License, Version 2.0 (the
8
+ # "License"); you may not use this file except in compliance
9
+ # with the License. You may obtain a copy of the License at
10
+ #
11
+ # http://www.apache.org/licenses/LICENSE-2.0
12
+ #
13
+ # Unless required by applicable law or agreed to in writing,
14
+ # software distributed under the License is distributed on an
15
+ # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16
+ # KIND, either express or implied. See the License for the
17
+ # specific language governing permissions and limitations
18
+ # under the License.
19
+
20
+ # This file is automatically generated. Any changes will be lost!
21
+ module Selenium
22
+ module WebDriver
23
+ class DevTools
24
+ def indexed_db
25
+ @indexed_db ||= IndexedDB.new(self)
26
+ end
27
+
28
+ class IndexedDB
29
+
30
+ def initialize(devtools)
31
+ @devtools = devtools
32
+ end
33
+
34
+ def on(event, &block)
35
+ event = EVENTS[event] if event.is_a?(Symbol)
36
+ @devtools.callbacks["IndexedDB.#{event}"] << block
37
+ end
38
+
39
+ def clear_object_store(security_origin:, database_name:, object_store_name:)
40
+ @devtools.send_cmd('IndexedDB.clearObjectStore',
41
+ securityOrigin: security_origin,
42
+ databaseName: database_name,
43
+ objectStoreName: object_store_name)
44
+ end
45
+
46
+ def delete_database(security_origin:, database_name:)
47
+ @devtools.send_cmd('IndexedDB.deleteDatabase',
48
+ securityOrigin: security_origin,
49
+ databaseName: database_name)
50
+ end
51
+
52
+ def delete_object_store_entries(security_origin:, database_name:, object_store_name:, key_range:)
53
+ @devtools.send_cmd('IndexedDB.deleteObjectStoreEntries',
54
+ securityOrigin: security_origin,
55
+ databaseName: database_name,
56
+ objectStoreName: object_store_name,
57
+ keyRange: key_range)
58
+ end
59
+
60
+ def disable
61
+ @devtools.send_cmd('IndexedDB.disable')
62
+ end
63
+
64
+ def enable
65
+ @devtools.send_cmd('IndexedDB.enable')
66
+ end
67
+
68
+ def request_data(security_origin:, database_name:, object_store_name:, index_name:, skip_count:, page_size:, key_range: nil)
69
+ @devtools.send_cmd('IndexedDB.requestData',
70
+ securityOrigin: security_origin,
71
+ databaseName: database_name,
72
+ objectStoreName: object_store_name,
73
+ indexName: index_name,
74
+ skipCount: skip_count,
75
+ pageSize: page_size,
76
+ keyRange: key_range)
77
+ end
78
+
79
+ def get_metadata(security_origin:, database_name:, object_store_name:)
80
+ @devtools.send_cmd('IndexedDB.getMetadata',
81
+ securityOrigin: security_origin,
82
+ databaseName: database_name,
83
+ objectStoreName: object_store_name)
84
+ end
85
+
86
+ def request_database(security_origin:, database_name:)
87
+ @devtools.send_cmd('IndexedDB.requestDatabase',
88
+ securityOrigin: security_origin,
89
+ databaseName: database_name)
90
+ end
91
+
92
+ def request_database_names(security_origin:)
93
+ @devtools.send_cmd('IndexedDB.requestDatabaseNames',
94
+ securityOrigin: security_origin)
95
+ end
96
+
97
+ end # IndexedDB
98
+ end # DevTools
99
+ end # WebDriver
100
+ end # Selenium
@@ -0,0 +1,140 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Licensed to the Software Freedom Conservancy (SFC) under one
4
+ # or more contributor license agreements. See the NOTICE file
5
+ # distributed with this work for additional information
6
+ # regarding copyright ownership. The SFC licenses this file
7
+ # to you under the Apache License, Version 2.0 (the
8
+ # "License"); you may not use this file except in compliance
9
+ # with the License. You may obtain a copy of the License at
10
+ #
11
+ # http://www.apache.org/licenses/LICENSE-2.0
12
+ #
13
+ # Unless required by applicable law or agreed to in writing,
14
+ # software distributed under the License is distributed on an
15
+ # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16
+ # KIND, either express or implied. See the License for the
17
+ # specific language governing permissions and limitations
18
+ # under the License.
19
+
20
+ # This file is automatically generated. Any changes will be lost!
21
+ module Selenium
22
+ module WebDriver
23
+ class DevTools
24
+ def input
25
+ @input ||= Input.new(self)
26
+ end
27
+
28
+ class Input
29
+
30
+ def initialize(devtools)
31
+ @devtools = devtools
32
+ end
33
+
34
+ def on(event, &block)
35
+ event = EVENTS[event] if event.is_a?(Symbol)
36
+ @devtools.callbacks["Input.#{event}"] << block
37
+ end
38
+
39
+ def dispatch_key_event(type:, modifiers: nil, timestamp: nil, text: nil, unmodified_text: nil, key_identifier: nil, code: nil, key: nil, windows_virtual_key_code: nil, native_virtual_key_code: nil, auto_repeat: nil, is_keypad: nil, is_system_key: nil, location: nil)
40
+ @devtools.send_cmd('Input.dispatchKeyEvent',
41
+ type: type,
42
+ modifiers: modifiers,
43
+ timestamp: timestamp,
44
+ text: text,
45
+ unmodifiedText: unmodified_text,
46
+ keyIdentifier: key_identifier,
47
+ code: code,
48
+ key: key,
49
+ windowsVirtualKeyCode: windows_virtual_key_code,
50
+ nativeVirtualKeyCode: native_virtual_key_code,
51
+ autoRepeat: auto_repeat,
52
+ isKeypad: is_keypad,
53
+ isSystemKey: is_system_key,
54
+ location: location)
55
+ end
56
+
57
+ def insert_text(text:)
58
+ @devtools.send_cmd('Input.insertText',
59
+ text: text)
60
+ end
61
+
62
+ def dispatch_mouse_event(type:, x:, y:, modifiers: nil, timestamp: nil, button: nil, buttons: nil, click_count: nil, delta_x: nil, delta_y: nil, pointer_type: nil)
63
+ @devtools.send_cmd('Input.dispatchMouseEvent',
64
+ type: type,
65
+ x: x,
66
+ y: y,
67
+ modifiers: modifiers,
68
+ timestamp: timestamp,
69
+ button: button,
70
+ buttons: buttons,
71
+ clickCount: click_count,
72
+ deltaX: delta_x,
73
+ deltaY: delta_y,
74
+ pointerType: pointer_type)
75
+ end
76
+
77
+ def dispatch_touch_event(type:, touch_points:, modifiers: nil, timestamp: nil)
78
+ @devtools.send_cmd('Input.dispatchTouchEvent',
79
+ type: type,
80
+ touchPoints: touch_points,
81
+ modifiers: modifiers,
82
+ timestamp: timestamp)
83
+ end
84
+
85
+ def emulate_touch_from_mouse_event(type:, x:, y:, button:, timestamp: nil, delta_x: nil, delta_y: nil, modifiers: nil, click_count: nil)
86
+ @devtools.send_cmd('Input.emulateTouchFromMouseEvent',
87
+ type: type,
88
+ x: x,
89
+ y: y,
90
+ button: button,
91
+ timestamp: timestamp,
92
+ deltaX: delta_x,
93
+ deltaY: delta_y,
94
+ modifiers: modifiers,
95
+ clickCount: click_count)
96
+ end
97
+
98
+ def set_ignore_input_events(ignore:)
99
+ @devtools.send_cmd('Input.setIgnoreInputEvents',
100
+ ignore: ignore)
101
+ end
102
+
103
+ def synthesize_pinch_gesture(x:, y:, scale_factor:, relative_speed: nil, gesture_source_type: nil)
104
+ @devtools.send_cmd('Input.synthesizePinchGesture',
105
+ x: x,
106
+ y: y,
107
+ scaleFactor: scale_factor,
108
+ relativeSpeed: relative_speed,
109
+ gestureSourceType: gesture_source_type)
110
+ end
111
+
112
+ def synthesize_scroll_gesture(x:, y:, x_distance: nil, y_distance: nil, x_overscroll: nil, y_overscroll: nil, prevent_fling: nil, speed: nil, gesture_source_type: nil, repeat_count: nil, repeat_delay_ms: nil, interaction_marker_name: nil)
113
+ @devtools.send_cmd('Input.synthesizeScrollGesture',
114
+ x: x,
115
+ y: y,
116
+ xDistance: x_distance,
117
+ yDistance: y_distance,
118
+ xOverscroll: x_overscroll,
119
+ yOverscroll: y_overscroll,
120
+ preventFling: prevent_fling,
121
+ speed: speed,
122
+ gestureSourceType: gesture_source_type,
123
+ repeatCount: repeat_count,
124
+ repeatDelayMs: repeat_delay_ms,
125
+ interactionMarkerName: interaction_marker_name)
126
+ end
127
+
128
+ def synthesize_tap_gesture(x:, y:, duration: nil, tap_count: nil, gesture_source_type: nil)
129
+ @devtools.send_cmd('Input.synthesizeTapGesture',
130
+ x: x,
131
+ y: y,
132
+ duration: duration,
133
+ tapCount: tap_count,
134
+ gestureSourceType: gesture_source_type)
135
+ end
136
+
137
+ end # Input
138
+ end # DevTools
139
+ end # WebDriver
140
+ end # Selenium
@@ -0,0 +1,55 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Licensed to the Software Freedom Conservancy (SFC) under one
4
+ # or more contributor license agreements. See the NOTICE file
5
+ # distributed with this work for additional information
6
+ # regarding copyright ownership. The SFC licenses this file
7
+ # to you under the Apache License, Version 2.0 (the
8
+ # "License"); you may not use this file except in compliance
9
+ # with the License. You may obtain a copy of the License at
10
+ #
11
+ # http://www.apache.org/licenses/LICENSE-2.0
12
+ #
13
+ # Unless required by applicable law or agreed to in writing,
14
+ # software distributed under the License is distributed on an
15
+ # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16
+ # KIND, either express or implied. See the License for the
17
+ # specific language governing permissions and limitations
18
+ # under the License.
19
+
20
+ # This file is automatically generated. Any changes will be lost!
21
+ module Selenium
22
+ module WebDriver
23
+ class DevTools
24
+ def inspector
25
+ @inspector ||= Inspector.new(self)
26
+ end
27
+
28
+ class Inspector
29
+ EVENTS = {
30
+ detached: 'detached',
31
+ target_crashed: 'targetCrashed',
32
+ target_reloaded_after_crash: 'targetReloadedAfterCrash',
33
+ }
34
+
35
+ def initialize(devtools)
36
+ @devtools = devtools
37
+ end
38
+
39
+ def on(event, &block)
40
+ event = EVENTS[event] if event.is_a?(Symbol)
41
+ @devtools.callbacks["Inspector.#{event}"] << block
42
+ end
43
+
44
+ def disable
45
+ @devtools.send_cmd('Inspector.disable')
46
+ end
47
+
48
+ def enable
49
+ @devtools.send_cmd('Inspector.enable')
50
+ end
51
+
52
+ end # Inspector
53
+ end # DevTools
54
+ end # WebDriver
55
+ end # Selenium
@@ -0,0 +1,59 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Licensed to the Software Freedom Conservancy (SFC) under one
4
+ # or more contributor license agreements. See the NOTICE file
5
+ # distributed with this work for additional information
6
+ # regarding copyright ownership. The SFC licenses this file
7
+ # to you under the Apache License, Version 2.0 (the
8
+ # "License"); you may not use this file except in compliance
9
+ # with the License. You may obtain a copy of the License at
10
+ #
11
+ # http://www.apache.org/licenses/LICENSE-2.0
12
+ #
13
+ # Unless required by applicable law or agreed to in writing,
14
+ # software distributed under the License is distributed on an
15
+ # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16
+ # KIND, either express or implied. See the License for the
17
+ # specific language governing permissions and limitations
18
+ # under the License.
19
+
20
+ # This file is automatically generated. Any changes will be lost!
21
+ module Selenium
22
+ module WebDriver
23
+ class DevTools
24
+ def io
25
+ @io ||= IO.new(self)
26
+ end
27
+
28
+ class IO
29
+
30
+ def initialize(devtools)
31
+ @devtools = devtools
32
+ end
33
+
34
+ def on(event, &block)
35
+ event = EVENTS[event] if event.is_a?(Symbol)
36
+ @devtools.callbacks["IO.#{event}"] << block
37
+ end
38
+
39
+ def close(handle:)
40
+ @devtools.send_cmd('IO.close',
41
+ handle: handle)
42
+ end
43
+
44
+ def read(handle:, offset: nil, size: nil)
45
+ @devtools.send_cmd('IO.read',
46
+ handle: handle,
47
+ offset: offset,
48
+ size: size)
49
+ end
50
+
51
+ def resolve_blob(object_id:)
52
+ @devtools.send_cmd('IO.resolveBlob',
53
+ objectId: object_id)
54
+ end
55
+
56
+ end # IO
57
+ end # DevTools
58
+ end # WebDriver
59
+ end # Selenium