Class: Selenium::DevTools::V131::DOMSnapshot
- Inherits:
-
Object
- Object
- Selenium::DevTools::V131::DOMSnapshot
- Defined in:
- lib/selenium/devtools/v131/dom_snapshot.rb
Instance Method Summary collapse
- #capture_snapshot(computed_styles:, include_paint_order: nil, include_dom_rects: nil, include_blended_background_colors: nil, include_text_color_opacities: nil) ⇒ Object
- #disable ⇒ Object
- #enable ⇒ Object
- #get_snapshot(computed_style_whitelist:, include_event_listeners: nil, include_paint_order: nil, include_user_agent_shadow_tree: nil) ⇒ Object
-
#initialize(devtools) ⇒ DOMSnapshot
constructor
A new instance of DOMSnapshot.
- #on(event, &block) ⇒ Object
Constructor Details
#initialize(devtools) ⇒ DOMSnapshot
Returns a new instance of DOMSnapshot.
26 27 28 |
# File 'lib/selenium/devtools/v131/dom_snapshot.rb', line 26 def initialize(devtools) @devtools = devtools end |
Instance Method Details
#capture_snapshot(computed_styles:, include_paint_order: nil, include_dom_rects: nil, include_blended_background_colors: nil, include_text_color_opacities: nil) ⇒ Object
51 52 53 54 55 56 57 58 |
# File 'lib/selenium/devtools/v131/dom_snapshot.rb', line 51 def capture_snapshot(computed_styles:, include_paint_order: nil, include_dom_rects: nil, include_blended_background_colors: nil, include_text_color_opacities: nil) @devtools.send_cmd('DOMSnapshot.captureSnapshot', computedStyles: computed_styles, includePaintOrder: include_paint_order, includeDOMRects: include_dom_rects, includeBlendedBackgroundColors: include_blended_background_colors, includeTextColorOpacities: include_text_color_opacities) end |
#disable ⇒ Object
35 36 37 |
# File 'lib/selenium/devtools/v131/dom_snapshot.rb', line 35 def disable @devtools.send_cmd('DOMSnapshot.disable') end |
#enable ⇒ Object
39 40 41 |
# File 'lib/selenium/devtools/v131/dom_snapshot.rb', line 39 def enable @devtools.send_cmd('DOMSnapshot.enable') end |
#get_snapshot(computed_style_whitelist:, include_event_listeners: nil, include_paint_order: nil, include_user_agent_shadow_tree: nil) ⇒ Object
43 44 45 46 47 48 49 |
# File 'lib/selenium/devtools/v131/dom_snapshot.rb', line 43 def get_snapshot(computed_style_whitelist:, include_event_listeners: nil, include_paint_order: nil, include_user_agent_shadow_tree: nil) @devtools.send_cmd('DOMSnapshot.getSnapshot', computedStyleWhitelist: computed_style_whitelist, includeEventListeners: include_event_listeners, includePaintOrder: include_paint_order, includeUserAgentShadowTree: include_user_agent_shadow_tree) end |
#on(event, &block) ⇒ Object
30 31 32 33 |
# File 'lib/selenium/devtools/v131/dom_snapshot.rb', line 30 def on(event, &block) event = EVENTS[event] if event.is_a?(Symbol) @devtools.callbacks["DOMSnapshot.#{event}"] << block end |