Class: Lebowski::Foundation::FrameApplication

Inherits:
Application show all
Defined in:
lib/lebowski/foundation/application.rb

Overview

Used to represent a SproutCore application that is contained within an IFrame.

Constant Summary

Constants included from Lebowski::Foundation

SC_BRANCH_CLOSED, SC_BRANCH_OPEN, SC_BUTTON1_STATUS, SC_BUTTON2_STATUS, SC_BUTTON3_STATUS, SC_LEAF_NODE, SC_MIXED_STATE, SC_PICKER_FIXED, SC_PICKER_MENU, SC_PICKER_POINTER, SC_T_ARRAY, SC_T_BOOL, SC_T_CLASS, SC_T_ERROR, SC_T_FUNCTION, SC_T_HASH, SC_T_NULL, SC_T_NUMBER, SC_T_OBJECT, SC_T_STRING, SC_T_UNDEFINED

Constants included from Mixins::WaitActions

Mixins::WaitActions::DEFAULT_TIMEOUT

Instance Attribute Summary collapse

Attributes inherited from Application

#app_context_manager, #parent_app

Attributes inherited from ProxyObject

#driver, #name, #parent, #rel_path

Instance Method Summary collapse

Methods inherited from Application

#abs_path, #acquire_application_context, #bundle_loaded?, #define_root_object, #do_aquire_application_context, #exec_driver_in_context, #exec_in_context, #has_current_application_context?, #key_pane, #main_pane, #responding_panes, #root_object

Methods included from Mixins::KeyCheck

#key_down?, #key_up?

Methods inherited from ProxyObject

#==, #[], #abs_path, #abs_path_with, #define, #define_proxy, #init_ext, #method_missing, #none?, #object?, #proxy, #represent_as, #sc_all_classes, #sc_class, #sc_guid, #sc_kind_of?, #sc_path_defined?, #sc_type_of, #unravel_relative_path

Methods included from Mixins::DefinePathsSupport

#define_path, #define_paths_for, #defined_path, #defined_paths, #path_defined?, #root_defined_path_part, #root_defined_path_part=

Methods included from Mixins::WaitActions

#wait_until

Constructor Details

#initialize(params) ⇒ FrameApplication

Returns a new instance of FrameApplication.



195
196
197
198
199
200
201
202
203
# File 'lib/lebowski/foundation/application.rb', line 195

def initialize(params)
  super(params)
  
  if params[:parent_app].nil?
    raise ArugmentError.new "parent_app can not be nil"
  end
  
  @locator = params[:locator]
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Lebowski::Foundation::ProxyObject

Instance Attribute Details

#locatorObject (readonly)

Returns the value of attribute locator.



193
194
195
# File 'lib/lebowski/foundation/application.rb', line 193

def locator
  @locator
end

Instance Method Details

#do_acquire_application_contextObject



205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
# File 'lib/lebowski/foundation/application.rb', line 205

def do_acquire_application_context()
  parents = []
  current_parent = self.parent_app
  while not current_parent.nil? do
    parents << current_parent
    current_parent = current_parent.parent_app
  end
  
  parents = parents.reverse
  
  parents.each do |parent|
    if parent.kind_of? FrameApplication
      @driver.select_frame parent.locator
    else
      parent.do_acquire_application_context
    end
  end
  
  @driver.select_frame(locator)
end