Class: Nobbie::Wx::ElementPathBuilder
- Inherits:
-
Object
- Object
- Nobbie::Wx::ElementPathBuilder
- Defined in:
- lib/nobbie/wx/impl/element/element_path_builder.rb
Instance Method Summary collapse
-
#find_component ⇒ Object
Finds the component specified in the path.
-
#initialize(name) ⇒ ElementPathBuilder
constructor
A new instance of ElementPathBuilder.
- #to_s ⇒ Object
Constructor Details
#initialize(name) ⇒ ElementPathBuilder
Returns a new instance of ElementPathBuilder.
11 12 13 |
# File 'lib/nobbie/wx/impl/element/element_path_builder.rb', line 11 def initialize(name) @name = name end |
Instance Method Details
#find_component ⇒ Object
Finds the component specified in the path. This implementation is about as dumb as its gets, but does handle named components and menus.
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/nobbie/wx/impl/element/element_path_builder.rb', line 17 def find_component #todo: make me properly navigate component tree #todo: I should blow up if multiple windows with the same name are found .... #todo: shouldn''t need to pass AUT.gtw here ... nil should search all component = Window.find_window_by_name(@name, APPLICATION_UNDER_TEST.get_top_window) return component unless component.nil? = APPLICATION_UNDER_TEST.get_top_window. unless .nil? component = .(.(@name)) end #todo: pull this up ... Kernel.raise(ComponentNotFoundException, "cannot find component with name: #{to_s}") if component.nil? component end |
#to_s ⇒ Object
36 37 38 |
# File 'lib/nobbie/wx/impl/element/element_path_builder.rb', line 36 def to_s "'#{@name}'" end |