Class: Dommy::Interaction::Debug
- Inherits:
-
Object
- Object
- Dommy::Interaction::Debug
- Defined in:
- lib/dommy/interaction/debug.rb
Overview
A read-only debugging view over a DOM scope (a document or any element),
built on DomSummary. Dommy::Rack::Session and Dommy::Browser expose it
as #debug (scoped to the current within), but it wraps a plain node so
it works on any document too — e.g. Dommy::Interaction::Debug.new(dom)
in a request/view spec.
browser.debug.dom_summary # readable forms/links/buttons/fields
browser.debug. # structured [{label:, type:, selector:}]
Instance Method Summary collapse
- #aria_snapshot ⇒ Object
-
#aria_tree ⇒ Object
The accessibility tree / Playwright-compatible ARIA snapshot of the current scope.
- #buttons ⇒ Object
-
#dom_summary ⇒ Object
A readable, sectioned summary of the visible controls.
- #fields ⇒ Object
- #forms ⇒ Object
-
#initialize(scope) ⇒ Debug
constructor
A new instance of Debug.
- #links ⇒ Object
-
#visible_text ⇒ Object
The scope's collapsed visible text content.
Constructor Details
#initialize(scope) ⇒ Debug
Returns a new instance of Debug.
14 15 16 |
# File 'lib/dommy/interaction/debug.rb', line 14 def initialize(scope) @scope = scope end |
Instance Method Details
#aria_snapshot ⇒ Object
32 |
# File 'lib/dommy/interaction/debug.rb', line 32 def aria_snapshot = Internal::AriaSnapshot.serialize(aria_tree) |
#aria_tree ⇒ Object
The accessibility tree / Playwright-compatible ARIA snapshot of the current scope.
31 |
# File 'lib/dommy/interaction/debug.rb', line 31 def aria_tree = Internal::AccessibilityTree.build(@scope) |
#buttons ⇒ Object
23 |
# File 'lib/dommy/interaction/debug.rb', line 23 def = DomSummary.(@scope) |
#dom_summary ⇒ Object
A readable, sectioned summary of the visible controls.
19 |
# File 'lib/dommy/interaction/debug.rb', line 19 def dom_summary = DomSummary.to_text(@scope) |
#fields ⇒ Object
24 |
# File 'lib/dommy/interaction/debug.rb', line 24 def fields = DomSummary.fields(@scope) |
#forms ⇒ Object
21 |
# File 'lib/dommy/interaction/debug.rb', line 21 def forms = DomSummary.forms(@scope) |
#links ⇒ Object
22 |
# File 'lib/dommy/interaction/debug.rb', line 22 def links = DomSummary.links(@scope) |
#visible_text ⇒ Object
The scope's collapsed visible text content.
27 |
# File 'lib/dommy/interaction/debug.rb', line 27 def visible_text = DomSummary.text(@scope) |