# frozen_string_literal: true # Licensed to the Software Freedom Conservancy (SFC) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The SFC licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. # This file is automatically generated. Any changes will be lost! module Selenium module DevTools module V96 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 def on(event, &block) event = EVENTS[event] if event.is_a?(Symbol) @devtools.callbacks["DOM.#{event}"] << block end def collect_class_names_from_subtree(node_id:) @devtools.send_cmd('DOM.collectClassNamesFromSubtree', nodeId: node_id) 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 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 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 disable @devtools.send_cmd('DOM.disable') end def discard_search_results(search_id:) @devtools.send_cmd('DOM.discardSearchResults', searchId: search_id) end def enable @devtools.send_cmd('DOM.enable') 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_attributes(node_id:) @devtools.send_cmd('DOM.getAttributes', nodeId: node_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_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_document(depth: nil, pierce: nil) @devtools.send_cmd('DOM.getDocument', depth: depth, pierce: pierce) end def get_flattened_document(depth: nil, pierce: nil) @devtools.send_cmd('DOM.getFlattenedDocument', 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_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_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_relayout_boundary(node_id:) @devtools.send_cmd('DOM.getRelayoutBoundary', nodeId: node_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 hide_highlight @devtools.send_cmd('DOM.hideHighlight') end def highlight_node @devtools.send_cmd('DOM.highlightNode') end def highlight_rect @devtools.send_cmd('DOM.highlightRect') end def mark_undoable_state @devtools.send_cmd('DOM.markUndoableState') 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 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_node_by_path_to_frontend(path:) @devtools.send_cmd('DOM.pushNodeByPathToFrontend', path: path) 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(node_id:, selector:) @devtools.send_cmd('DOM.querySelector', nodeId: node_id, selector: selector) end def query_selector_all(node_id:, selector:) @devtools.send_cmd('DOM.querySelectorAll', nodeId: node_id, selector: selector) end def redo @devtools.send_cmd('DOM.redo') end def remove_attribute(node_id:, name:) @devtools.send_cmd('DOM.removeAttribute', nodeId: node_id, name: name) end def remove_node(node_id:) @devtools.send_cmd('DOM.removeNode', nodeId: node_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 request_node(object_id:) @devtools.send_cmd('DOM.requestNode', objectId: object_id) 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_attribute_value(node_id:, name:, value:) @devtools.send_cmd('DOM.setAttributeValue', nodeId: node_id, name: name, value: value) 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_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_node_stack_traces_enabled(enable:) @devtools.send_cmd('DOM.setNodeStackTracesEnabled', enable: enable) end def get_node_stack_traces(node_id:) @devtools.send_cmd('DOM.getNodeStackTraces', nodeId: node_id) end def get_file_info(object_id:) @devtools.send_cmd('DOM.getFileInfo', objectId: object_id) end def set_inspected_node(node_id:) @devtools.send_cmd('DOM.setInspectedNode', nodeId: node_id) end def set_node_name(node_id:, name:) @devtools.send_cmd('DOM.setNodeName', nodeId: node_id, name: name) end def set_node_value(node_id:, value:) @devtools.send_cmd('DOM.setNodeValue', nodeId: node_id, value: value) end def set_outer_html(node_id:, outer_html:) @devtools.send_cmd('DOM.setOuterHTML', nodeId: node_id, outerHTML: outer_html) end def undo @devtools.send_cmd('DOM.undo') end def get_frame_owner(frame_id:) @devtools.send_cmd('DOM.getFrameOwner', frameId: frame_id) end def get_container_for_node(node_id:, container_name: nil) @devtools.send_cmd('DOM.getContainerForNode', nodeId: node_id, containerName: container_name) end def get_querying_descendants_for_container(node_id:) @devtools.send_cmd('DOM.getQueryingDescendantsForContainer', nodeId: node_id) end end # DOM end # V96 end # DevTools end # Selenium