Module: AtspiAccessiblePatches
- Defined in:
- lib/gnome_app_driver.rb
Overview
Utility monkey-patches for the Atspi::Accessible class
Instance Method Summary collapse
- #each_child ⇒ Object
-
#find_role(role_name, regex = //) ⇒ Object
Find an element with the given role and label regex.
- #inspect_recursive(level = 0, maxlevel = 5) ⇒ Object
Instance Method Details
#each_child ⇒ Object
15 16 17 18 19 20 |
# File 'lib/gnome_app_driver.rb', line 15 def each_child child_count.times do |i| child = get_child_at_index i yield child if child end end |
#find_role(role_name, regex = //) ⇒ Object
Find an element with the given role and label regex
23 24 25 26 27 28 29 30 31 32 |
# File 'lib/gnome_app_driver.rb', line 23 def find_role(role_name, regex = //) role = Atspi::Role.new role_name return self if role == self.role && name =~ regex each_child do |child| result = child.find_role role_name, regex return result if result end nil end |
#inspect_recursive(level = 0, maxlevel = 5) ⇒ Object
34 35 36 37 38 39 |
# File 'lib/gnome_app_driver.rb', line 34 def inspect_recursive(level = 0, maxlevel = 5) puts "#{" " * level} > name: #{name}; role: #{role}" each_child do |child| child.inspect_recursive(level + 1) unless level >= maxlevel end end |