lib/selenium/devtools/v88/dom.rb in selenium-devtools-0.0.1.alpha vs lib/selenium/devtools/v88/dom.rb in selenium-devtools-0.0.2.alpha
- old
+ new
@@ -17,313 +17,305 @@
# specific language governing permissions and limitations
# under the License.
# This file is automatically generated. Any changes will be lost!
module Selenium
- module WebDriver
- class DevTools
- def dom
- @dom ||= V88::DOM.new(self)
+ module DevTools
+ class DOM
+ EVENTS = {
+ attribute_modified: 'attributeModified',
+ attribute_removed: 'attributeRemoved',
+ character_data_modified: 'characterDataModified',
+ child_node_count_updated: 'childNodeCountUpdated',
+ child_node_inserted: 'childNodeInserted',
+ child_node_removed: 'childNodeRemoved',
+ distributed_nodes_updated: 'distributedNodesUpdated',
+ document_updated: 'documentUpdated',
+ inline_style_invalidated: 'inlineStyleInvalidated',
+ pseudo_element_added: 'pseudoElementAdded',
+ pseudo_element_removed: 'pseudoElementRemoved',
+ set_child_nodes: 'setChildNodes',
+ shadow_root_popped: 'shadowRootPopped',
+ shadow_root_pushed: 'shadowRootPushed',
+ }.freeze
+
+ def initialize(devtools)
+ @devtools = devtools
end
- module V88
- class DOM
- EVENTS = {
- attribute_modified: 'attributeModified',
- attribute_removed: 'attributeRemoved',
- character_data_modified: 'characterDataModified',
- child_node_count_updated: 'childNodeCountUpdated',
- child_node_inserted: 'childNodeInserted',
- child_node_removed: 'childNodeRemoved',
- distributed_nodes_updated: 'distributedNodesUpdated',
- document_updated: 'documentUpdated',
- inline_style_invalidated: 'inlineStyleInvalidated',
- pseudo_element_added: 'pseudoElementAdded',
- pseudo_element_removed: 'pseudoElementRemoved',
- set_child_nodes: 'setChildNodes',
- shadow_root_popped: 'shadowRootPopped',
- shadow_root_pushed: 'shadowRootPushed',
- }.freeze
+ def on(event, &block)
+ event = EVENTS[event] if event.is_a?(Symbol)
+ @devtools.callbacks["DOM.#{event}"] << block
+ end
- def initialize(devtools)
- @devtools = devtools
- end
+ def collect_class_names_from_subtree(node_id:)
+ @devtools.send_cmd('DOM.collectClassNamesFromSubtree',
+ nodeId: node_id)
+ end
- def on(event, &block)
- event = EVENTS[event] if event.is_a?(Symbol)
- @devtools.callbacks["DOM.#{event}"] << block
- end
+ def copy_to(node_id:, target_node_id:, insert_before_node_id: nil)
+ @devtools.send_cmd('DOM.copyTo',
+ nodeId: node_id,
+ targetNodeId: target_node_id,
+ insertBeforeNodeId: insert_before_node_id)
+ end
- def collect_class_names_from_subtree(node_id:)
- @devtools.send_cmd('DOM.collectClassNamesFromSubtree',
- nodeId: node_id)
- end
+ def describe_node(node_id: nil, backend_node_id: nil, object_id: nil, depth: nil, pierce: nil)
+ @devtools.send_cmd('DOM.describeNode',
+ nodeId: node_id,
+ backendNodeId: backend_node_id,
+ objectId: object_id,
+ depth: depth,
+ pierce: pierce)
+ end
- def copy_to(node_id:, target_node_id:, insert_before_node_id: nil)
- @devtools.send_cmd('DOM.copyTo',
- nodeId: node_id,
- targetNodeId: target_node_id,
- insertBeforeNodeId: insert_before_node_id)
- end
+ def scroll_into_view_if_needed(node_id: nil, backend_node_id: nil, object_id: nil, rect: nil)
+ @devtools.send_cmd('DOM.scrollIntoViewIfNeeded',
+ nodeId: node_id,
+ backendNodeId: backend_node_id,
+ objectId: object_id,
+ rect: rect)
+ end
- def describe_node(node_id: nil, backend_node_id: nil, object_id: nil, depth: nil, pierce: nil)
- @devtools.send_cmd('DOM.describeNode',
- nodeId: node_id,
- backendNodeId: backend_node_id,
- objectId: object_id,
- depth: depth,
- pierce: pierce)
- end
+ def disable
+ @devtools.send_cmd('DOM.disable')
+ end
- def scroll_into_view_if_needed(node_id: nil, backend_node_id: nil, object_id: nil, rect: nil)
- @devtools.send_cmd('DOM.scrollIntoViewIfNeeded',
- nodeId: node_id,
- backendNodeId: backend_node_id,
- objectId: object_id,
- rect: rect)
- end
+ def discard_search_results(search_id:)
+ @devtools.send_cmd('DOM.discardSearchResults',
+ searchId: search_id)
+ end
- def disable
- @devtools.send_cmd('DOM.disable')
- end
+ def enable
+ @devtools.send_cmd('DOM.enable')
+ end
- def discard_search_results(search_id:)
- @devtools.send_cmd('DOM.discardSearchResults',
- searchId: search_id)
- end
+ def focus(node_id: nil, backend_node_id: nil, object_id: nil)
+ @devtools.send_cmd('DOM.focus',
+ nodeId: node_id,
+ backendNodeId: backend_node_id,
+ objectId: object_id)
+ end
- def enable
- @devtools.send_cmd('DOM.enable')
- end
+ def get_attributes(node_id:)
+ @devtools.send_cmd('DOM.getAttributes',
+ nodeId: node_id)
+ end
- def focus(node_id: nil, backend_node_id: nil, object_id: nil)
- @devtools.send_cmd('DOM.focus',
- nodeId: node_id,
- backendNodeId: backend_node_id,
- objectId: object_id)
- end
+ def get_box_model(node_id: nil, backend_node_id: nil, object_id: nil)
+ @devtools.send_cmd('DOM.getBoxModel',
+ nodeId: node_id,
+ backendNodeId: backend_node_id,
+ objectId: object_id)
+ end
- def get_attributes(node_id:)
- @devtools.send_cmd('DOM.getAttributes',
- nodeId: node_id)
- end
+ def get_content_quads(node_id: nil, backend_node_id: nil, object_id: nil)
+ @devtools.send_cmd('DOM.getContentQuads',
+ nodeId: node_id,
+ backendNodeId: backend_node_id,
+ objectId: object_id)
+ end
- def get_box_model(node_id: nil, backend_node_id: nil, object_id: nil)
- @devtools.send_cmd('DOM.getBoxModel',
- nodeId: node_id,
- backendNodeId: backend_node_id,
- objectId: object_id)
- end
+ def get_document(depth: nil, pierce: nil)
+ @devtools.send_cmd('DOM.getDocument',
+ depth: depth,
+ pierce: pierce)
+ end
- def get_content_quads(node_id: nil, backend_node_id: nil, object_id: nil)
- @devtools.send_cmd('DOM.getContentQuads',
- nodeId: node_id,
- backendNodeId: backend_node_id,
- objectId: object_id)
- end
+ def get_flattened_document(depth: nil, pierce: nil)
+ @devtools.send_cmd('DOM.getFlattenedDocument',
+ depth: depth,
+ pierce: pierce)
+ end
- def get_document(depth: nil, pierce: nil)
- @devtools.send_cmd('DOM.getDocument',
- depth: depth,
- pierce: pierce)
- end
+ def get_nodes_for_subtree_by_style(node_id:, computed_styles:, pierce: nil)
+ @devtools.send_cmd('DOM.getNodesForSubtreeByStyle',
+ nodeId: node_id,
+ computedStyles: computed_styles,
+ pierce: pierce)
+ end
- def get_flattened_document(depth: nil, pierce: nil)
- @devtools.send_cmd('DOM.getFlattenedDocument',
- depth: depth,
- pierce: pierce)
- end
+ def get_node_for_location(x:, y:, include_user_agent_shadow_dom: nil, ignore_pointer_events_none: nil)
+ @devtools.send_cmd('DOM.getNodeForLocation',
+ x: x,
+ y: y,
+ includeUserAgentShadowDOM: include_user_agent_shadow_dom,
+ ignorePointerEventsNone: ignore_pointer_events_none)
+ end
- def get_nodes_for_subtree_by_style(node_id:, computed_styles:, pierce: nil)
- @devtools.send_cmd('DOM.getNodesForSubtreeByStyle',
- nodeId: node_id,
- computedStyles: computed_styles,
- pierce: pierce)
- end
+ def get_outer_html(node_id: nil, backend_node_id: nil, object_id: nil)
+ @devtools.send_cmd('DOM.getOuterHTML',
+ nodeId: node_id,
+ backendNodeId: backend_node_id,
+ objectId: object_id)
+ end
- def get_node_for_location(x:, y:, include_user_agent_shadow_dom: nil, ignore_pointer_events_none: nil)
- @devtools.send_cmd('DOM.getNodeForLocation',
- x: x,
- y: y,
- includeUserAgentShadowDOM: include_user_agent_shadow_dom,
- ignorePointerEventsNone: ignore_pointer_events_none)
- end
+ def get_relayout_boundary(node_id:)
+ @devtools.send_cmd('DOM.getRelayoutBoundary',
+ nodeId: node_id)
+ end
- def get_outer_html(node_id: nil, backend_node_id: nil, object_id: nil)
- @devtools.send_cmd('DOM.getOuterHTML',
- nodeId: node_id,
- backendNodeId: backend_node_id,
- objectId: object_id)
- end
+ def get_search_results(search_id:, from_index:, to_index:)
+ @devtools.send_cmd('DOM.getSearchResults',
+ searchId: search_id,
+ fromIndex: from_index,
+ toIndex: to_index)
+ end
- def get_relayout_boundary(node_id:)
- @devtools.send_cmd('DOM.getRelayoutBoundary',
- nodeId: node_id)
- end
+ def hide_highlight
+ @devtools.send_cmd('DOM.hideHighlight')
+ end
- def get_search_results(search_id:, from_index:, to_index:)
- @devtools.send_cmd('DOM.getSearchResults',
- searchId: search_id,
- fromIndex: from_index,
- toIndex: to_index)
- end
+ def highlight_node
+ @devtools.send_cmd('DOM.highlightNode')
+ end
- def hide_highlight
- @devtools.send_cmd('DOM.hideHighlight')
- end
+ def highlight_rect
+ @devtools.send_cmd('DOM.highlightRect')
+ end
- def highlight_node
- @devtools.send_cmd('DOM.highlightNode')
- end
+ def mark_undoable_state
+ @devtools.send_cmd('DOM.markUndoableState')
+ end
- def highlight_rect
- @devtools.send_cmd('DOM.highlightRect')
- end
+ def move_to(node_id:, target_node_id:, insert_before_node_id: nil)
+ @devtools.send_cmd('DOM.moveTo',
+ nodeId: node_id,
+ targetNodeId: target_node_id,
+ insertBeforeNodeId: insert_before_node_id)
+ end
- def mark_undoable_state
- @devtools.send_cmd('DOM.markUndoableState')
- end
+ def perform_search(query:, include_user_agent_shadow_dom: nil)
+ @devtools.send_cmd('DOM.performSearch',
+ query: query,
+ includeUserAgentShadowDOM: include_user_agent_shadow_dom)
+ end
- def move_to(node_id:, target_node_id:, insert_before_node_id: nil)
- @devtools.send_cmd('DOM.moveTo',
- nodeId: node_id,
- targetNodeId: target_node_id,
- insertBeforeNodeId: insert_before_node_id)
- end
+ def push_node_by_path_to_frontend(path:)
+ @devtools.send_cmd('DOM.pushNodeByPathToFrontend',
+ path: path)
+ end
- def perform_search(query:, include_user_agent_shadow_dom: nil)
- @devtools.send_cmd('DOM.performSearch',
- query: query,
- includeUserAgentShadowDOM: include_user_agent_shadow_dom)
- end
+ def push_nodes_by_backend_ids_to_frontend(backend_node_ids:)
+ @devtools.send_cmd('DOM.pushNodesByBackendIdsToFrontend',
+ backendNodeIds: backend_node_ids)
+ end
- def push_node_by_path_to_frontend(path:)
- @devtools.send_cmd('DOM.pushNodeByPathToFrontend',
- path: path)
- end
+ def query_selector(node_id:, selector:)
+ @devtools.send_cmd('DOM.querySelector',
+ nodeId: node_id,
+ selector: selector)
+ end
- def push_nodes_by_backend_ids_to_frontend(backend_node_ids:)
- @devtools.send_cmd('DOM.pushNodesByBackendIdsToFrontend',
- backendNodeIds: backend_node_ids)
- end
+ def query_selector_all(node_id:, selector:)
+ @devtools.send_cmd('DOM.querySelectorAll',
+ nodeId: node_id,
+ selector: selector)
+ end
- def query_selector(node_id:, selector:)
- @devtools.send_cmd('DOM.querySelector',
- nodeId: node_id,
- selector: selector)
- end
+ def redo
+ @devtools.send_cmd('DOM.redo')
+ end
- def query_selector_all(node_id:, selector:)
- @devtools.send_cmd('DOM.querySelectorAll',
- nodeId: node_id,
- selector: selector)
- end
+ def remove_attribute(node_id:, name:)
+ @devtools.send_cmd('DOM.removeAttribute',
+ nodeId: node_id,
+ name: name)
+ end
- def redo
- @devtools.send_cmd('DOM.redo')
- end
+ def remove_node(node_id:)
+ @devtools.send_cmd('DOM.removeNode',
+ nodeId: node_id)
+ end
- def remove_attribute(node_id:, name:)
- @devtools.send_cmd('DOM.removeAttribute',
- nodeId: node_id,
- name: name)
- end
+ def request_child_nodes(node_id:, depth: nil, pierce: nil)
+ @devtools.send_cmd('DOM.requestChildNodes',
+ nodeId: node_id,
+ depth: depth,
+ pierce: pierce)
+ end
- def remove_node(node_id:)
- @devtools.send_cmd('DOM.removeNode',
- nodeId: node_id)
- end
+ def request_node(object_id:)
+ @devtools.send_cmd('DOM.requestNode',
+ objectId: object_id)
+ end
- def request_child_nodes(node_id:, depth: nil, pierce: nil)
- @devtools.send_cmd('DOM.requestChildNodes',
- nodeId: node_id,
- depth: depth,
- pierce: pierce)
- end
+ def resolve_node(node_id: nil, backend_node_id: nil, object_group: nil, execution_context_id: nil)
+ @devtools.send_cmd('DOM.resolveNode',
+ nodeId: node_id,
+ backendNodeId: backend_node_id,
+ objectGroup: object_group,
+ executionContextId: execution_context_id)
+ end
- def request_node(object_id:)
- @devtools.send_cmd('DOM.requestNode',
- objectId: object_id)
- end
+ def set_attribute_value(node_id:, name:, value:)
+ @devtools.send_cmd('DOM.setAttributeValue',
+ nodeId: node_id,
+ name: name,
+ value: value)
+ end
- def resolve_node(node_id: nil, backend_node_id: nil, object_group: nil, execution_context_id: nil)
- @devtools.send_cmd('DOM.resolveNode',
- nodeId: node_id,
- backendNodeId: backend_node_id,
- objectGroup: object_group,
- executionContextId: execution_context_id)
- end
+ def set_attributes_as_text(node_id:, text:, name: nil)
+ @devtools.send_cmd('DOM.setAttributesAsText',
+ nodeId: node_id,
+ text: text,
+ name: name)
+ end
- def set_attribute_value(node_id:, name:, value:)
- @devtools.send_cmd('DOM.setAttributeValue',
- nodeId: node_id,
- name: name,
- value: value)
- end
+ def set_file_input_files(files:, node_id: nil, backend_node_id: nil, object_id: nil)
+ @devtools.send_cmd('DOM.setFileInputFiles',
+ files: files,
+ nodeId: node_id,
+ backendNodeId: backend_node_id,
+ objectId: object_id)
+ end
- def set_attributes_as_text(node_id:, text:, name: nil)
- @devtools.send_cmd('DOM.setAttributesAsText',
- nodeId: node_id,
- text: text,
- name: name)
- end
+ def set_node_stack_traces_enabled(enable:)
+ @devtools.send_cmd('DOM.setNodeStackTracesEnabled',
+ enable: enable)
+ end
- def set_file_input_files(files:, node_id: nil, backend_node_id: nil, object_id: nil)
- @devtools.send_cmd('DOM.setFileInputFiles',
- files: files,
- nodeId: node_id,
- backendNodeId: backend_node_id,
- objectId: object_id)
- end
+ def get_node_stack_traces(node_id:)
+ @devtools.send_cmd('DOM.getNodeStackTraces',
+ nodeId: node_id)
+ end
- def set_node_stack_traces_enabled(enable:)
- @devtools.send_cmd('DOM.setNodeStackTracesEnabled',
- enable: enable)
- end
+ def get_file_info(object_id:)
+ @devtools.send_cmd('DOM.getFileInfo',
+ objectId: object_id)
+ end
- def get_node_stack_traces(node_id:)
- @devtools.send_cmd('DOM.getNodeStackTraces',
- nodeId: node_id)
- end
+ def set_inspected_node(node_id:)
+ @devtools.send_cmd('DOM.setInspectedNode',
+ nodeId: node_id)
+ end
- def get_file_info(object_id:)
- @devtools.send_cmd('DOM.getFileInfo',
- objectId: object_id)
- end
+ def set_node_name(node_id:, name:)
+ @devtools.send_cmd('DOM.setNodeName',
+ nodeId: node_id,
+ name: name)
+ end
- def set_inspected_node(node_id:)
- @devtools.send_cmd('DOM.setInspectedNode',
- nodeId: node_id)
- end
+ def set_node_value(node_id:, value:)
+ @devtools.send_cmd('DOM.setNodeValue',
+ nodeId: node_id,
+ value: value)
+ end
- def set_node_name(node_id:, name:)
- @devtools.send_cmd('DOM.setNodeName',
- nodeId: node_id,
- name: name)
- end
+ def set_outer_html(node_id:, outer_html:)
+ @devtools.send_cmd('DOM.setOuterHTML',
+ nodeId: node_id,
+ outerHTML: outer_html)
+ end
- def set_node_value(node_id:, value:)
- @devtools.send_cmd('DOM.setNodeValue',
- nodeId: node_id,
- value: value)
- end
+ def undo
+ @devtools.send_cmd('DOM.undo')
+ end
- def set_outer_html(node_id:, outer_html:)
- @devtools.send_cmd('DOM.setOuterHTML',
- nodeId: node_id,
- outerHTML: outer_html)
- end
+ def get_frame_owner(frame_id:)
+ @devtools.send_cmd('DOM.getFrameOwner',
+ frameId: frame_id)
+ end
- def undo
- @devtools.send_cmd('DOM.undo')
- end
-
- def get_frame_owner(frame_id:)
- @devtools.send_cmd('DOM.getFrameOwner',
- frameId: frame_id)
- end
-
- end # V88
- end # DOM
- end # DevTools
- end # WebDriver
+ end # DOM
+ end # DevTools
end # Selenium
\ No newline at end of file