Class: Lebowski::Foundation::OpenedWindowApplication

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

Overview

Used to represent a SproutCore application that is contained within a web browser window that was opened by another window

Constant Summary

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 WindowApplication

#maximize, #move_to, #resize_to

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

- (OpenedWindowApplication) initialize(params)

A new instance of OpenedWindowApplication



152
153
154
155
156
157
158
159
160
161
# File 'lib/lebowski/foundation/application.rb', line 152

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

Dynamic Method Handling

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

Instance Attribute Details

- (Object) locator_type (readonly)

Returns the value of attribute locator_type



150
151
152
# File 'lib/lebowski/foundation/application.rb', line 150

def locator_type
  @locator_type
end

- (Object) locator_value (readonly)

Returns the value of attribute locator_value



150
151
152
# File 'lib/lebowski/foundation/application.rb', line 150

def locator_value
  @locator_value
end

Instance Method Details

- (Object) close

Closes the opened window if it is currently open



173
174
175
176
177
178
179
# File 'lib/lebowski/foundation/application.rb', line 173

def close()
  return if (not is_opened?)
  driver.sc_close_opened_window locator_type, locator_value
  if has_current_application_context?
    parent_app.reset_application_context
  end
end

- (Object) do_acquire_application_context



181
182
183
# File 'lib/lebowski/foundation/application.rb', line 181

def do_acquire_application_context()
  @driver.sc_select_window(locator_type, locator_value)
end

- (Boolean) is_opened?

Used to check if this window is open

Returns:

  • (Boolean)


166
167
168
# File 'lib/lebowski/foundation/application.rb', line 166

def is_opened?()
  return @driver.is_sc_opened_window?(locator_type, locator_value)
end