selenium-webdriver 4.0.0.alpha1 → 4.0.0.alpha6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/CHANGES +139 -1
- data/LICENSE +1 -1
- data/lib/selenium/server.rb +3 -3
- data/lib/selenium/webdriver.rb +11 -7
- data/lib/selenium/webdriver/atoms/findElements.js +122 -0
- data/lib/selenium/webdriver/atoms/getAttribute.js +84 -7
- data/lib/selenium/webdriver/atoms/isDisplayed.js +75 -77
- data/lib/selenium/webdriver/chrome.rb +10 -9
- data/lib/selenium/webdriver/chrome/bridge.rb +20 -4
- data/lib/selenium/webdriver/chrome/driver.rb +3 -52
- data/lib/selenium/webdriver/chrome/options.rb +97 -57
- data/lib/selenium/webdriver/chrome/profile.rb +2 -2
- data/lib/selenium/webdriver/chrome/service.rb +0 -4
- data/lib/selenium/webdriver/common.rb +3 -0
- data/lib/selenium/webdriver/common/driver.rb +76 -17
- data/lib/selenium/webdriver/common/driver_extensions/{has_touch_screen.rb → has_devtools.rb} +10 -8
- data/lib/selenium/webdriver/common/driver_extensions/takes_screenshot.rb +2 -1
- data/lib/selenium/webdriver/common/logger.rb +48 -16
- data/lib/selenium/webdriver/common/manager.rb +5 -0
- data/lib/selenium/webdriver/common/options.rb +60 -121
- data/lib/selenium/webdriver/common/platform.rb +3 -0
- data/lib/selenium/webdriver/common/port_prober.rb +4 -6
- data/lib/selenium/webdriver/common/profile_helper.rb +10 -2
- data/lib/selenium/webdriver/common/proxy.rb +0 -0
- data/lib/selenium/webdriver/common/search_context.rb +3 -2
- data/lib/selenium/webdriver/common/service.rb +30 -113
- data/lib/selenium/webdriver/common/service_manager.rb +151 -0
- data/lib/selenium/webdriver/common/socket_lock.rb +2 -2
- data/lib/selenium/webdriver/common/wait.rb +1 -1
- data/lib/selenium/webdriver/devtools.rb +118 -0
- data/lib/selenium/webdriver/devtools/accessibility.rb +62 -0
- data/lib/selenium/webdriver/devtools/animation.rb +98 -0
- data/lib/selenium/webdriver/devtools/application_cache.rb +64 -0
- data/lib/selenium/webdriver/devtools/audits.rb +61 -0
- data/lib/selenium/webdriver/devtools/background_service.rb +67 -0
- data/lib/selenium/webdriver/devtools/browser.rb +123 -0
- data/lib/selenium/webdriver/devtools/cache_storage.rb +73 -0
- data/lib/selenium/webdriver/devtools/cast.rb +70 -0
- data/lib/selenium/webdriver/devtools/console.rb +57 -0
- data/lib/selenium/webdriver/devtools/css.rb +165 -0
- data/lib/selenium/webdriver/devtools/database.rb +64 -0
- data/lib/selenium/webdriver/devtools/debugger.rb +229 -0
- data/lib/selenium/webdriver/devtools/device_orientation.rb +53 -0
- data/lib/selenium/webdriver/devtools/dom.rb +320 -0
- data/lib/selenium/webdriver/devtools/domdebugger.rb +93 -0
- data/lib/selenium/webdriver/devtools/domsnapshot.rb +65 -0
- data/lib/selenium/webdriver/devtools/domstorage.rb +79 -0
- data/lib/selenium/webdriver/devtools/emulation.rb +180 -0
- data/lib/selenium/webdriver/devtools/fetch.rb +97 -0
- data/lib/selenium/webdriver/devtools/headless_experimental.rb +61 -0
- data/lib/selenium/webdriver/devtools/heap_profiler.rb +107 -0
- data/lib/selenium/webdriver/devtools/indexed_db.rb +100 -0
- data/lib/selenium/webdriver/devtools/input.rb +140 -0
- data/lib/selenium/webdriver/devtools/inspector.rb +55 -0
- data/lib/selenium/webdriver/devtools/io.rb +59 -0
- data/lib/selenium/webdriver/devtools/layer_tree.rb +95 -0
- data/lib/selenium/webdriver/devtools/log.rb +66 -0
- data/lib/selenium/webdriver/devtools/media.rb +57 -0
- data/lib/selenium/webdriver/devtools/memory.rb +86 -0
- data/lib/selenium/webdriver/devtools/network.rb +228 -0
- data/lib/selenium/webdriver/devtools/overlay.rb +157 -0
- data/lib/selenium/webdriver/devtools/page.rb +374 -0
- data/lib/selenium/webdriver/devtools/performance.rb +63 -0
- data/lib/selenium/webdriver/devtools/profiler.rb +111 -0
- data/lib/selenium/webdriver/devtools/runtime.rb +193 -0
- data/lib/selenium/webdriver/devtools/schema.rb +46 -0
- data/lib/selenium/webdriver/devtools/security.rb +71 -0
- data/lib/selenium/webdriver/devtools/service_worker.rb +116 -0
- data/lib/selenium/webdriver/devtools/storage.rb +95 -0
- data/lib/selenium/webdriver/devtools/system_info.rb +50 -0
- data/lib/selenium/webdriver/devtools/target.rb +141 -0
- data/lib/selenium/webdriver/devtools/tethering.rb +55 -0
- data/lib/selenium/webdriver/devtools/tracing.rb +76 -0
- data/lib/selenium/webdriver/devtools/web_audio.rb +70 -0
- data/lib/selenium/webdriver/devtools/web_authn.rb +94 -0
- data/lib/selenium/webdriver/edge.rb +29 -9
- data/lib/selenium/webdriver/{firefox/util.rb → edge_chrome/bridge.rb} +11 -20
- data/lib/selenium/webdriver/{common/w3c_options.rb → edge_chrome/driver.rb} +14 -17
- data/lib/selenium/webdriver/edge_chrome/options.rb +36 -0
- data/lib/selenium/webdriver/edge_chrome/profile.rb +33 -0
- data/lib/selenium/webdriver/edge_chrome/service.rb +36 -0
- data/lib/selenium/webdriver/{common/w3c_manager.rb → edge_html/driver.rb} +11 -17
- data/lib/selenium/webdriver/{edge → edge_html}/options.rb +26 -22
- data/lib/selenium/webdriver/{edge → edge_html}/service.rb +2 -6
- data/lib/selenium/webdriver/firefox.rb +18 -15
- data/lib/selenium/webdriver/firefox/bridge.rb +1 -1
- data/lib/selenium/webdriver/firefox/driver.rb +2 -30
- data/lib/selenium/webdriver/firefox/extension.rb +8 -0
- data/lib/selenium/webdriver/firefox/options.rb +47 -52
- data/lib/selenium/webdriver/firefox/profile.rb +7 -78
- data/lib/selenium/webdriver/firefox/service.rb +0 -4
- data/lib/selenium/webdriver/ie.rb +8 -7
- data/lib/selenium/webdriver/ie/driver.rb +0 -32
- data/lib/selenium/webdriver/ie/options.rb +10 -33
- data/lib/selenium/webdriver/ie/service.rb +5 -9
- data/lib/selenium/webdriver/remote.rb +16 -10
- data/lib/selenium/webdriver/remote/bridge.rb +34 -42
- data/lib/selenium/webdriver/remote/capabilities.rb +22 -6
- data/lib/selenium/webdriver/remote/driver.rb +6 -12
- data/lib/selenium/webdriver/remote/http/default.rb +9 -4
- data/lib/selenium/webdriver/remote/http/persistent.rb +5 -6
- data/lib/selenium/webdriver/safari.rb +9 -8
- data/lib/selenium/webdriver/safari/bridge.rb +4 -4
- data/lib/selenium/webdriver/safari/driver.rb +3 -29
- data/lib/selenium/webdriver/safari/options.rb +18 -19
- data/lib/selenium/webdriver/safari/service.rb +0 -4
- data/lib/selenium/webdriver/support.rb +1 -0
- data/lib/selenium/webdriver/support/cdp_client_generator.rb +77 -0
- data/lib/selenium/webdriver/support/color.rb +2 -2
- data/lib/selenium/webdriver/support/event_firing_bridge.rb +1 -1
- data/lib/selenium/webdriver/support/relative_locator.rb +51 -0
- data/lib/selenium/webdriver/version.rb +1 -1
- data/selenium-webdriver.gemspec +5 -4
- metadata +81 -42
- data/lib/selenium/webdriver/common/bridge_helper.rb +0 -82
- data/lib/selenium/webdriver/common/keyboard.rb +0 -70
- data/lib/selenium/webdriver/common/mouse.rb +0 -89
- data/lib/selenium/webdriver/common/touch_action_builder.rb +0 -78
- data/lib/selenium/webdriver/common/touch_screen.rb +0 -123
- data/lib/selenium/webdriver/common/w3c_action_builder.rb +0 -212
- data/lib/selenium/webdriver/edge/bridge.rb +0 -76
- data/lib/selenium/webdriver/edge/driver.rb +0 -70
- data/lib/selenium/webdriver/firefox/binary.rb +0 -110
- data/lib/selenium/webdriver/firefox/extension/prefs.json +0 -69
- data/lib/selenium/webdriver/firefox/extension/webdriver.xpi +0 -0
- data/lib/selenium/webdriver/firefox/launcher.rb +0 -111
- data/lib/selenium/webdriver/firefox/legacy/driver.rb +0 -83
- data/lib/selenium/webdriver/firefox/marionette/bridge.rb +0 -49
- data/lib/selenium/webdriver/firefox/marionette/driver.rb +0 -90
- data/lib/selenium/webdriver/firefox/native/linux/amd64/x_ignore_nofocus.so +0 -0
- data/lib/selenium/webdriver/firefox/native/linux/x86/x_ignore_nofocus.so +0 -0
- data/lib/selenium/webdriver/remote/oss/bridge.rb +0 -594
- data/lib/selenium/webdriver/remote/oss/commands.rb +0 -223
- data/lib/selenium/webdriver/remote/w3c/bridge.rb +0 -605
- data/lib/selenium/webdriver/remote/w3c/capabilities.rb +0 -310
- data/lib/selenium/webdriver/remote/w3c/commands.rb +0 -157
@@ -0,0 +1,157 @@
|
|
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 overlay
|
25
|
+
@overlay ||= Overlay.new(self)
|
26
|
+
end
|
27
|
+
|
28
|
+
class Overlay
|
29
|
+
EVENTS = {
|
30
|
+
inspect_node_requested: 'inspectNodeRequested',
|
31
|
+
node_highlight_requested: 'nodeHighlightRequested',
|
32
|
+
screenshot_requested: 'screenshotRequested',
|
33
|
+
inspect_mode_canceled: 'inspectModeCanceled',
|
34
|
+
}
|
35
|
+
|
36
|
+
def initialize(devtools)
|
37
|
+
@devtools = devtools
|
38
|
+
end
|
39
|
+
|
40
|
+
def on(event, &block)
|
41
|
+
event = EVENTS[event] if event.is_a?(Symbol)
|
42
|
+
@devtools.callbacks["Overlay.#{event}"] << block
|
43
|
+
end
|
44
|
+
|
45
|
+
def disable
|
46
|
+
@devtools.send_cmd('Overlay.disable')
|
47
|
+
end
|
48
|
+
|
49
|
+
def enable
|
50
|
+
@devtools.send_cmd('Overlay.enable')
|
51
|
+
end
|
52
|
+
|
53
|
+
def get_highlight_object_for_test(node_id:, include_distance: nil, include_style: nil, color_format: nil)
|
54
|
+
@devtools.send_cmd('Overlay.getHighlightObjectForTest',
|
55
|
+
nodeId: node_id,
|
56
|
+
includeDistance: include_distance,
|
57
|
+
includeStyle: include_style,
|
58
|
+
colorFormat: color_format)
|
59
|
+
end
|
60
|
+
|
61
|
+
def hide_highlight
|
62
|
+
@devtools.send_cmd('Overlay.hideHighlight')
|
63
|
+
end
|
64
|
+
|
65
|
+
def highlight_frame(frame_id:, content_color: nil, content_outline_color: nil)
|
66
|
+
@devtools.send_cmd('Overlay.highlightFrame',
|
67
|
+
frameId: frame_id,
|
68
|
+
contentColor: content_color,
|
69
|
+
contentOutlineColor: content_outline_color)
|
70
|
+
end
|
71
|
+
|
72
|
+
def highlight_node(highlight_config:, node_id: nil, backend_node_id: nil, object_id: nil, selector: nil)
|
73
|
+
@devtools.send_cmd('Overlay.highlightNode',
|
74
|
+
highlightConfig: highlight_config,
|
75
|
+
nodeId: node_id,
|
76
|
+
backendNodeId: backend_node_id,
|
77
|
+
objectId: object_id,
|
78
|
+
selector: selector)
|
79
|
+
end
|
80
|
+
|
81
|
+
def highlight_quad(quad:, color: nil, outline_color: nil)
|
82
|
+
@devtools.send_cmd('Overlay.highlightQuad',
|
83
|
+
quad: quad,
|
84
|
+
color: color,
|
85
|
+
outlineColor: outline_color)
|
86
|
+
end
|
87
|
+
|
88
|
+
def highlight_rect(x:, y:, width:, height:, color: nil, outline_color: nil)
|
89
|
+
@devtools.send_cmd('Overlay.highlightRect',
|
90
|
+
x: x,
|
91
|
+
y: y,
|
92
|
+
width: width,
|
93
|
+
height: height,
|
94
|
+
color: color,
|
95
|
+
outlineColor: outline_color)
|
96
|
+
end
|
97
|
+
|
98
|
+
def set_inspect_mode(mode:, highlight_config: nil)
|
99
|
+
@devtools.send_cmd('Overlay.setInspectMode',
|
100
|
+
mode: mode,
|
101
|
+
highlightConfig: highlight_config)
|
102
|
+
end
|
103
|
+
|
104
|
+
def set_show_ad_highlights(show:)
|
105
|
+
@devtools.send_cmd('Overlay.setShowAdHighlights',
|
106
|
+
show: show)
|
107
|
+
end
|
108
|
+
|
109
|
+
def set_paused_in_debugger_message(message: nil)
|
110
|
+
@devtools.send_cmd('Overlay.setPausedInDebuggerMessage',
|
111
|
+
message: message)
|
112
|
+
end
|
113
|
+
|
114
|
+
def set_show_debug_borders(show:)
|
115
|
+
@devtools.send_cmd('Overlay.setShowDebugBorders',
|
116
|
+
show: show)
|
117
|
+
end
|
118
|
+
|
119
|
+
def set_show_fpscounter(show:)
|
120
|
+
@devtools.send_cmd('Overlay.setShowFPSCounter',
|
121
|
+
show: show)
|
122
|
+
end
|
123
|
+
|
124
|
+
def set_show_paint_rects(result:)
|
125
|
+
@devtools.send_cmd('Overlay.setShowPaintRects',
|
126
|
+
result: result)
|
127
|
+
end
|
128
|
+
|
129
|
+
def set_show_layout_shift_regions(result:)
|
130
|
+
@devtools.send_cmd('Overlay.setShowLayoutShiftRegions',
|
131
|
+
result: result)
|
132
|
+
end
|
133
|
+
|
134
|
+
def set_show_scroll_bottleneck_rects(show:)
|
135
|
+
@devtools.send_cmd('Overlay.setShowScrollBottleneckRects',
|
136
|
+
show: show)
|
137
|
+
end
|
138
|
+
|
139
|
+
def set_show_hit_test_borders(show:)
|
140
|
+
@devtools.send_cmd('Overlay.setShowHitTestBorders',
|
141
|
+
show: show)
|
142
|
+
end
|
143
|
+
|
144
|
+
def set_show_viewport_size_on_resize(show:)
|
145
|
+
@devtools.send_cmd('Overlay.setShowViewportSizeOnResize',
|
146
|
+
show: show)
|
147
|
+
end
|
148
|
+
|
149
|
+
def set_show_hinge(hinge_config: nil)
|
150
|
+
@devtools.send_cmd('Overlay.setShowHinge',
|
151
|
+
hingeConfig: hinge_config)
|
152
|
+
end
|
153
|
+
|
154
|
+
end # Overlay
|
155
|
+
end # DevTools
|
156
|
+
end # WebDriver
|
157
|
+
end # Selenium
|
@@ -0,0 +1,374 @@
|
|
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 page
|
25
|
+
@page ||= Page.new(self)
|
26
|
+
end
|
27
|
+
|
28
|
+
class Page
|
29
|
+
EVENTS = {
|
30
|
+
dom_content_event_fired: 'domContentEventFired',
|
31
|
+
file_chooser_opened: 'fileChooserOpened',
|
32
|
+
frame_attached: 'frameAttached',
|
33
|
+
frame_cleared_scheduled_navigation: 'frameClearedScheduledNavigation',
|
34
|
+
frame_detached: 'frameDetached',
|
35
|
+
frame_navigated: 'frameNavigated',
|
36
|
+
frame_resized: 'frameResized',
|
37
|
+
frame_requested_navigation: 'frameRequestedNavigation',
|
38
|
+
frame_scheduled_navigation: 'frameScheduledNavigation',
|
39
|
+
frame_started_loading: 'frameStartedLoading',
|
40
|
+
frame_stopped_loading: 'frameStoppedLoading',
|
41
|
+
download_will_begin: 'downloadWillBegin',
|
42
|
+
download_progress: 'downloadProgress',
|
43
|
+
interstitial_hidden: 'interstitialHidden',
|
44
|
+
interstitial_shown: 'interstitialShown',
|
45
|
+
javascript_dialog_closed: 'javascriptDialogClosed',
|
46
|
+
javascript_dialog_opening: 'javascriptDialogOpening',
|
47
|
+
lifecycle_event: 'lifecycleEvent',
|
48
|
+
load_event_fired: 'loadEventFired',
|
49
|
+
navigated_within_document: 'navigatedWithinDocument',
|
50
|
+
screencast_frame: 'screencastFrame',
|
51
|
+
screencast_visibility_changed: 'screencastVisibilityChanged',
|
52
|
+
window_open: 'windowOpen',
|
53
|
+
compilation_cache_produced: 'compilationCacheProduced',
|
54
|
+
}
|
55
|
+
|
56
|
+
def initialize(devtools)
|
57
|
+
@devtools = devtools
|
58
|
+
end
|
59
|
+
|
60
|
+
def on(event, &block)
|
61
|
+
event = EVENTS[event] if event.is_a?(Symbol)
|
62
|
+
@devtools.callbacks["Page.#{event}"] << block
|
63
|
+
end
|
64
|
+
|
65
|
+
def add_script_to_evaluate_on_load(script_source:)
|
66
|
+
@devtools.send_cmd('Page.addScriptToEvaluateOnLoad',
|
67
|
+
scriptSource: script_source)
|
68
|
+
end
|
69
|
+
|
70
|
+
def add_script_to_evaluate_on_new_document(source:, world_name: nil)
|
71
|
+
@devtools.send_cmd('Page.addScriptToEvaluateOnNewDocument',
|
72
|
+
source: source,
|
73
|
+
worldName: world_name)
|
74
|
+
end
|
75
|
+
|
76
|
+
def bring_to_front
|
77
|
+
@devtools.send_cmd('Page.bringToFront')
|
78
|
+
end
|
79
|
+
|
80
|
+
def capture_screenshot(format: nil, quality: nil, clip: nil, from_surface: nil)
|
81
|
+
@devtools.send_cmd('Page.captureScreenshot',
|
82
|
+
format: format,
|
83
|
+
quality: quality,
|
84
|
+
clip: clip,
|
85
|
+
fromSurface: from_surface)
|
86
|
+
end
|
87
|
+
|
88
|
+
def capture_snapshot(format: nil)
|
89
|
+
@devtools.send_cmd('Page.captureSnapshot',
|
90
|
+
format: format)
|
91
|
+
end
|
92
|
+
|
93
|
+
def clear_device_metrics_override
|
94
|
+
@devtools.send_cmd('Page.clearDeviceMetricsOverride')
|
95
|
+
end
|
96
|
+
|
97
|
+
def clear_device_orientation_override
|
98
|
+
@devtools.send_cmd('Page.clearDeviceOrientationOverride')
|
99
|
+
end
|
100
|
+
|
101
|
+
def clear_geolocation_override
|
102
|
+
@devtools.send_cmd('Page.clearGeolocationOverride')
|
103
|
+
end
|
104
|
+
|
105
|
+
def create_isolated_world(frame_id:, world_name: nil, grant_univeral_access: nil)
|
106
|
+
@devtools.send_cmd('Page.createIsolatedWorld',
|
107
|
+
frameId: frame_id,
|
108
|
+
worldName: world_name,
|
109
|
+
grantUniveralAccess: grant_univeral_access)
|
110
|
+
end
|
111
|
+
|
112
|
+
def delete_cookie(cookie_name:, url:)
|
113
|
+
@devtools.send_cmd('Page.deleteCookie',
|
114
|
+
cookieName: cookie_name,
|
115
|
+
url: url)
|
116
|
+
end
|
117
|
+
|
118
|
+
def disable
|
119
|
+
@devtools.send_cmd('Page.disable')
|
120
|
+
end
|
121
|
+
|
122
|
+
def enable
|
123
|
+
@devtools.send_cmd('Page.enable')
|
124
|
+
end
|
125
|
+
|
126
|
+
def get_app_manifest
|
127
|
+
@devtools.send_cmd('Page.getAppManifest')
|
128
|
+
end
|
129
|
+
|
130
|
+
def get_installability_errors
|
131
|
+
@devtools.send_cmd('Page.getInstallabilityErrors')
|
132
|
+
end
|
133
|
+
|
134
|
+
def get_manifest_icons
|
135
|
+
@devtools.send_cmd('Page.getManifestIcons')
|
136
|
+
end
|
137
|
+
|
138
|
+
def get_cookies
|
139
|
+
@devtools.send_cmd('Page.getCookies')
|
140
|
+
end
|
141
|
+
|
142
|
+
def get_frame_tree
|
143
|
+
@devtools.send_cmd('Page.getFrameTree')
|
144
|
+
end
|
145
|
+
|
146
|
+
def get_layout_metrics
|
147
|
+
@devtools.send_cmd('Page.getLayoutMetrics')
|
148
|
+
end
|
149
|
+
|
150
|
+
def get_navigation_history
|
151
|
+
@devtools.send_cmd('Page.getNavigationHistory')
|
152
|
+
end
|
153
|
+
|
154
|
+
def reset_navigation_history
|
155
|
+
@devtools.send_cmd('Page.resetNavigationHistory')
|
156
|
+
end
|
157
|
+
|
158
|
+
def get_resource_content(frame_id:, url:)
|
159
|
+
@devtools.send_cmd('Page.getResourceContent',
|
160
|
+
frameId: frame_id,
|
161
|
+
url: url)
|
162
|
+
end
|
163
|
+
|
164
|
+
def get_resource_tree
|
165
|
+
@devtools.send_cmd('Page.getResourceTree')
|
166
|
+
end
|
167
|
+
|
168
|
+
def handle_java_script_dialog(accept:, prompt_text: nil)
|
169
|
+
@devtools.send_cmd('Page.handleJavaScriptDialog',
|
170
|
+
accept: accept,
|
171
|
+
promptText: prompt_text)
|
172
|
+
end
|
173
|
+
|
174
|
+
def navigate(url:, referrer: nil, transition_type: nil, frame_id: nil, referrer_policy: nil)
|
175
|
+
@devtools.send_cmd('Page.navigate',
|
176
|
+
url: url,
|
177
|
+
referrer: referrer,
|
178
|
+
transitionType: transition_type,
|
179
|
+
frameId: frame_id,
|
180
|
+
referrerPolicy: referrer_policy)
|
181
|
+
end
|
182
|
+
|
183
|
+
def navigate_to_history_entry(entry_id:)
|
184
|
+
@devtools.send_cmd('Page.navigateToHistoryEntry',
|
185
|
+
entryId: entry_id)
|
186
|
+
end
|
187
|
+
|
188
|
+
def print_to_pdf(landscape: nil, display_header_footer: nil, print_background: nil, scale: nil, paper_width: nil, paper_height: nil, margin_top: nil, margin_bottom: nil, margin_left: nil, margin_right: nil, page_ranges: nil, ignore_invalid_page_ranges: nil, header_template: nil, footer_template: nil, prefer_csspage_size: nil, transfer_mode: nil)
|
189
|
+
@devtools.send_cmd('Page.printToPDF',
|
190
|
+
landscape: landscape,
|
191
|
+
displayHeaderFooter: display_header_footer,
|
192
|
+
printBackground: print_background,
|
193
|
+
scale: scale,
|
194
|
+
paperWidth: paper_width,
|
195
|
+
paperHeight: paper_height,
|
196
|
+
marginTop: margin_top,
|
197
|
+
marginBottom: margin_bottom,
|
198
|
+
marginLeft: margin_left,
|
199
|
+
marginRight: margin_right,
|
200
|
+
pageRanges: page_ranges,
|
201
|
+
ignoreInvalidPageRanges: ignore_invalid_page_ranges,
|
202
|
+
headerTemplate: header_template,
|
203
|
+
footerTemplate: footer_template,
|
204
|
+
preferCSSPageSize: prefer_csspage_size,
|
205
|
+
transferMode: transfer_mode)
|
206
|
+
end
|
207
|
+
|
208
|
+
def reload(ignore_cache: nil, script_to_evaluate_on_load: nil)
|
209
|
+
@devtools.send_cmd('Page.reload',
|
210
|
+
ignoreCache: ignore_cache,
|
211
|
+
scriptToEvaluateOnLoad: script_to_evaluate_on_load)
|
212
|
+
end
|
213
|
+
|
214
|
+
def remove_script_to_evaluate_on_load(identifier:)
|
215
|
+
@devtools.send_cmd('Page.removeScriptToEvaluateOnLoad',
|
216
|
+
identifier: identifier)
|
217
|
+
end
|
218
|
+
|
219
|
+
def remove_script_to_evaluate_on_new_document(identifier:)
|
220
|
+
@devtools.send_cmd('Page.removeScriptToEvaluateOnNewDocument',
|
221
|
+
identifier: identifier)
|
222
|
+
end
|
223
|
+
|
224
|
+
def screencast_frame_ack(session_id:)
|
225
|
+
@devtools.send_cmd('Page.screencastFrameAck',
|
226
|
+
sessionId: session_id)
|
227
|
+
end
|
228
|
+
|
229
|
+
def search_in_resource(frame_id:, url:, query:, case_sensitive: nil, is_regex: nil)
|
230
|
+
@devtools.send_cmd('Page.searchInResource',
|
231
|
+
frameId: frame_id,
|
232
|
+
url: url,
|
233
|
+
query: query,
|
234
|
+
caseSensitive: case_sensitive,
|
235
|
+
isRegex: is_regex)
|
236
|
+
end
|
237
|
+
|
238
|
+
def set_ad_blocking_enabled(enabled:)
|
239
|
+
@devtools.send_cmd('Page.setAdBlockingEnabled',
|
240
|
+
enabled: enabled)
|
241
|
+
end
|
242
|
+
|
243
|
+
def set_bypass_csp(enabled:)
|
244
|
+
@devtools.send_cmd('Page.setBypassCSP',
|
245
|
+
enabled: enabled)
|
246
|
+
end
|
247
|
+
|
248
|
+
def set_device_metrics_override(width:, height:, device_scale_factor:, mobile:, scale: nil, screen_width: nil, screen_height: nil, position_x: nil, position_y: nil, dont_set_visible_size: nil, screen_orientation: nil, viewport: nil)
|
249
|
+
@devtools.send_cmd('Page.setDeviceMetricsOverride',
|
250
|
+
width: width,
|
251
|
+
height: height,
|
252
|
+
deviceScaleFactor: device_scale_factor,
|
253
|
+
mobile: mobile,
|
254
|
+
scale: scale,
|
255
|
+
screenWidth: screen_width,
|
256
|
+
screenHeight: screen_height,
|
257
|
+
positionX: position_x,
|
258
|
+
positionY: position_y,
|
259
|
+
dontSetVisibleSize: dont_set_visible_size,
|
260
|
+
screenOrientation: screen_orientation,
|
261
|
+
viewport: viewport)
|
262
|
+
end
|
263
|
+
|
264
|
+
def set_device_orientation_override(alpha:, beta:, gamma:)
|
265
|
+
@devtools.send_cmd('Page.setDeviceOrientationOverride',
|
266
|
+
alpha: alpha,
|
267
|
+
beta: beta,
|
268
|
+
gamma: gamma)
|
269
|
+
end
|
270
|
+
|
271
|
+
def set_font_families(font_families:)
|
272
|
+
@devtools.send_cmd('Page.setFontFamilies',
|
273
|
+
fontFamilies: font_families)
|
274
|
+
end
|
275
|
+
|
276
|
+
def set_font_sizes(font_sizes:)
|
277
|
+
@devtools.send_cmd('Page.setFontSizes',
|
278
|
+
fontSizes: font_sizes)
|
279
|
+
end
|
280
|
+
|
281
|
+
def set_document_content(frame_id:, html:)
|
282
|
+
@devtools.send_cmd('Page.setDocumentContent',
|
283
|
+
frameId: frame_id,
|
284
|
+
html: html)
|
285
|
+
end
|
286
|
+
|
287
|
+
def set_download_behavior(behavior:, download_path: nil)
|
288
|
+
@devtools.send_cmd('Page.setDownloadBehavior',
|
289
|
+
behavior: behavior,
|
290
|
+
downloadPath: download_path)
|
291
|
+
end
|
292
|
+
|
293
|
+
def set_geolocation_override(latitude: nil, longitude: nil, accuracy: nil)
|
294
|
+
@devtools.send_cmd('Page.setGeolocationOverride',
|
295
|
+
latitude: latitude,
|
296
|
+
longitude: longitude,
|
297
|
+
accuracy: accuracy)
|
298
|
+
end
|
299
|
+
|
300
|
+
def set_lifecycle_events_enabled(enabled:)
|
301
|
+
@devtools.send_cmd('Page.setLifecycleEventsEnabled',
|
302
|
+
enabled: enabled)
|
303
|
+
end
|
304
|
+
|
305
|
+
def set_touch_emulation_enabled(enabled:, configuration: nil)
|
306
|
+
@devtools.send_cmd('Page.setTouchEmulationEnabled',
|
307
|
+
enabled: enabled,
|
308
|
+
configuration: configuration)
|
309
|
+
end
|
310
|
+
|
311
|
+
def start_screencast(format: nil, quality: nil, max_width: nil, max_height: nil, every_nth_frame: nil)
|
312
|
+
@devtools.send_cmd('Page.startScreencast',
|
313
|
+
format: format,
|
314
|
+
quality: quality,
|
315
|
+
maxWidth: max_width,
|
316
|
+
maxHeight: max_height,
|
317
|
+
everyNthFrame: every_nth_frame)
|
318
|
+
end
|
319
|
+
|
320
|
+
def stop_loading
|
321
|
+
@devtools.send_cmd('Page.stopLoading')
|
322
|
+
end
|
323
|
+
|
324
|
+
def crash
|
325
|
+
@devtools.send_cmd('Page.crash')
|
326
|
+
end
|
327
|
+
|
328
|
+
def close
|
329
|
+
@devtools.send_cmd('Page.close')
|
330
|
+
end
|
331
|
+
|
332
|
+
def set_web_lifecycle_state(state:)
|
333
|
+
@devtools.send_cmd('Page.setWebLifecycleState',
|
334
|
+
state: state)
|
335
|
+
end
|
336
|
+
|
337
|
+
def stop_screencast
|
338
|
+
@devtools.send_cmd('Page.stopScreencast')
|
339
|
+
end
|
340
|
+
|
341
|
+
def set_produce_compilation_cache(enabled:)
|
342
|
+
@devtools.send_cmd('Page.setProduceCompilationCache',
|
343
|
+
enabled: enabled)
|
344
|
+
end
|
345
|
+
|
346
|
+
def add_compilation_cache(url:, data:)
|
347
|
+
@devtools.send_cmd('Page.addCompilationCache',
|
348
|
+
url: url,
|
349
|
+
data: data)
|
350
|
+
end
|
351
|
+
|
352
|
+
def clear_compilation_cache
|
353
|
+
@devtools.send_cmd('Page.clearCompilationCache')
|
354
|
+
end
|
355
|
+
|
356
|
+
def generate_test_report(message:, group: nil)
|
357
|
+
@devtools.send_cmd('Page.generateTestReport',
|
358
|
+
message: message,
|
359
|
+
group: group)
|
360
|
+
end
|
361
|
+
|
362
|
+
def wait_for_debugger
|
363
|
+
@devtools.send_cmd('Page.waitForDebugger')
|
364
|
+
end
|
365
|
+
|
366
|
+
def set_intercept_file_chooser_dialog(enabled:)
|
367
|
+
@devtools.send_cmd('Page.setInterceptFileChooserDialog',
|
368
|
+
enabled: enabled)
|
369
|
+
end
|
370
|
+
|
371
|
+
end # Page
|
372
|
+
end # DevTools
|
373
|
+
end # WebDriver
|
374
|
+
end # Selenium
|