Module: Lebowski::Runtime::SproutCoreExtensions
- Includes:
- Lebowski
- Included in:
- SproutCoreDriver
- Defined in:
- lib/lebowski/runtime/sprout_core_extensions.rb
Constant Summary collapse
- HTTP_HEADERS =
{ 'Content-Type' => 'application/x-www-form-urlencoded; charset=utf-8' }
- REMOTE_CONTROL_COMMAND_TIMEOUT =
/^timed out after/i
Instance Method Summary collapse
-
#__sc_test_computing_property_path(key, path) ⇒ Object
Selenium User Extensions Testing/Debugging Calls.
- #__sc_test_object_array_lookup(key, path, lookup) ⇒ Object
- #__sc_test_sending_encoded_array(key, array) ⇒ Object
- #__sc_test_sending_encoded_hash(key, hash) ⇒ Object
- #get_css_selector_count(selector) ⇒ Object
- #get_element_child_nodes_count(selector, index) ⇒ Object
- #get_element_tag_name(selector, index) ⇒ Object
- #get_sc_collection_view_content_disclosure_state(scpath, index) ⇒ Object
-
#get_sc_collection_view_content_group_indexes(scpath) ⇒ Object
SC Collection View Selenium Calls.
- #get_sc_collection_view_content_is_group(scpath, index) ⇒ Object
- #get_sc_collection_view_content_is_selected(scpath, index) ⇒ Object
- #get_sc_collection_view_content_now_showing_indexes(scpath) ⇒ Object
- #get_sc_collection_view_content_outline_level(scpath, index) ⇒ Object
- #get_sc_collection_view_content_selected_indexes(scpath) ⇒ Object
- #get_sc_core_query(scpath, selector) ⇒ Object
- #get_sc_core_query_element_attribute(handle, elemIndex, attribute) ⇒ Object
- #get_sc_core_query_element_classes(handle, elemIndex) ⇒ Object
- #get_sc_core_query_element_html(handle, elemIndex) ⇒ Object
- #get_sc_core_query_element_tag(handle, elemIndex) ⇒ Object
- #get_sc_core_query_element_text(handle, elemIndex) ⇒ Object
- #get_sc_core_query_size(handle) ⇒ Object
- #get_sc_element_height(type, *params) ⇒ Object
- #get_sc_element_width(type, *params) ⇒ Object
- #get_sc_element_window_position(type, *params) ⇒ Lebowski::Coords
-
#get_sc_guid(scpath) ⇒ Object
SC Object Foundation Selenium Calls.
- #get_sc_localized_string(str) ⇒ Object
- #get_sc_object_array_index_lookup(scpath, lookup_params) ⇒ Object
- #get_sc_object_class_name(scpath) ⇒ Object
- #get_sc_object_class_names(scpath) ⇒ Object
- #get_sc_path_boolean_array_value(scpath) ⇒ Object
- #get_sc_path_boolean_value(scpath) ⇒ Object
- #get_sc_path_number_array_value(scpath) ⇒ Object
- #get_sc_path_number_value(scpath) ⇒ Object
- #get_sc_path_string_array_value(scpath) ⇒ Object
-
#get_sc_path_string_value(scpath) ⇒ Object
SC Object Property Selenium Calls.
- #get_sc_property_array_value(scpath, property) ⇒ Object
- #get_sc_property_boolean_array_value(scpath, property) ⇒ Object
- #get_sc_property_boolean_value(scpath, property) ⇒ Object
- #get_sc_property_number_array_value(scpath, property) ⇒ Object
- #get_sc_property_number_value(scpath, property) ⇒ Object
- #get_sc_property_string_array_value(scpath, property) ⇒ Object
- #get_sc_property_string_value(scpath, property) ⇒ Object
- #get_sc_property_value(scpath, property) ⇒ Object
- #get_sc_scrollable_parent_view_layer_id(path) ⇒ Object
- #get_sc_selection_set_indexes(scpath) ⇒ Object
- #get_sc_type_of(scpath) ⇒ Object
- #get_sc_type_of_array_content(scpath) ⇒ Object
- #get_sc_view_child_view_count(scpath) ⇒ Object
- #get_sc_view_frame(scpath) ⇒ Lebowski::Rect
-
#get_sc_view_layer(scpath) ⇒ Object
SC View Object Foundation Selenium Calls.
- #initialize_sc_selenium_extension(timeout) ⇒ Object
- #is_sc_bundle_loaded(bundle) ⇒ Object
- #is_sc_object_kind_of_class(scpath, klass) ⇒ Object
- #is_sc_opened_window?(locator_type, locator_value) ⇒ Boolean
- #key_down?(key) ⇒ Boolean
- #key_up?(key) ⇒ Boolean
- #open_sc_application(app_root_path, timeout = nil) ⇒ Object
- #range_delete_content(*params) ⇒ Object
- #range_insert_content(*params) ⇒ Object
- #sc_basic_click(type, *params) ⇒ Object
- #sc_click(type, *params) ⇒ Object
- #sc_close_opened_window(locator_type, locator_value) ⇒ Object
-
#sc_core_query_done(handle) ⇒ Object
SC Core Query Selenium Calls.
-
#sc_disable_all_autoscrolling ⇒ Object
Disables all autoscrolling when performing a drag and drop operation within a SproutCore Application.
- #sc_double_click(type, *params) ⇒ Object
-
#sc_enable_all_autoscrolling ⇒ Object
Used to enable all autoscrolling.
- #sc_enable_mouse_move_event ⇒ Object
- #sc_focus(type, *params) ⇒ Object
- #sc_key_down(type, key, *params) ⇒ Object
- #sc_key_up(type, key, *params) ⇒ Object
- #sc_mouse_down(type, *params) ⇒ Object
- #sc_mouse_down_at(type, x, y, *params) ⇒ Object
- #sc_mouse_move(type, *params) ⇒ Object (also: #sc_mouse_enter, #sc_mouse_exit)
- #sc_mouse_move_at(type, x, y, *params) ⇒ Object
- #sc_mouse_up(type, *params) ⇒ Object
- #sc_mouse_up_at(type, x, y, *params) ⇒ Object
- #sc_mouse_wheel_delta_x(type, delta, *params) ⇒ Object
- #sc_mouse_wheel_delta_y(type, delta, *params) ⇒ Object
- #sc_right_click(type, *params) ⇒ Object
- #sc_right_mouse_down(type, *params) ⇒ Object
- #sc_right_mouse_down_at(type, x, y, *params) ⇒ Object
- #sc_right_mouse_up(type, *params) ⇒ Object
- #sc_right_mouse_up_at(type, x, y, *params) ⇒ Object
- #sc_select(type, optionLocator, *params) ⇒ Object
- #sc_select_main_window ⇒ Object
- #sc_select_window(locator_type, locator_value) ⇒ Object
-
#sc_type(type, text, *params) ⇒ Object
SC View Object Event Selenium Calls.
- #sc_type_key(type, key, *params) ⇒ Object
- #sc_view_scroll_to_visible(scpath) ⇒ Object
- #sc_wait_until(root_scpath, join, conditions, timeout = nil) ⇒ Object
- #sc_window_maximize ⇒ Object
- #sc_window_move_to(x, y) ⇒ Object
- #sc_window_resize_to(width, height) ⇒ Object
- #select_range(*params) ⇒ Object
-
#set_application_name(name) ⇒ Object
SC Application Setup Selenium Calls.
- #update_sc_application_context(app_name, timeout = nil) ⇒ Object
Instance Method Details
#__sc_test_computing_property_path(key, path) ⇒ Object
Selenium User Extensions Testing/Debugging Calls
541 542 543 |
# File 'lib/lebowski/runtime/sprout_core_extensions.rb', line 541 def __sc_test_computing_property_path(key, path) __remote_control_command("scTestComputePropertyPath", [key.to_s, path,]) end |
#__sc_test_object_array_lookup(key, path, lookup) ⇒ Object
555 556 557 558 559 560 561 562 |
# File 'lib/lebowski/runtime/sprout_core_extensions.rb', line 555 def __sc_test_object_array_lookup(key, path, lookup) params = ObjectEncoder.encode_hash({ :key => key.to_s, :path => path, :lookup => lookup, }) __remote_control_command("scTestObjectArrayLookup", [params,]) end |
#__sc_test_sending_encoded_array(key, array) ⇒ Object
550 551 552 553 |
# File 'lib/lebowski/runtime/sprout_core_extensions.rb', line 550 def __sc_test_sending_encoded_array(key, array) str = ObjectEncoder.encode_array(array) __remote_control_command("scTestDecodingEncodedArray", [key.to_s, str,]) end |
#__sc_test_sending_encoded_hash(key, hash) ⇒ Object
545 546 547 548 |
# File 'lib/lebowski/runtime/sprout_core_extensions.rb', line 545 def __sc_test_sending_encoded_hash(key, hash) str = ObjectEncoder.encode_hash(hash) __remote_control_command("scTestDecodingEncodedHash", [key.to_s, str,]) end |
#get_css_selector_count(selector) ⇒ Object
475 476 477 |
# File 'lib/lebowski/runtime/sprout_core_extensions.rb', line 475 def get_css_selector_count(selector) return __number_command("getCssSelectorCount", [selector, ]) end |
#get_element_child_nodes_count(selector, index) ⇒ Object
531 532 533 |
# File 'lib/lebowski/runtime/sprout_core_extensions.rb', line 531 def get_element_child_nodes_count(selector, index) return __number_command("getElementChildNodesCount", [selector, index]) end |
#get_element_tag_name(selector, index) ⇒ Object
527 528 529 |
# File 'lib/lebowski/runtime/sprout_core_extensions.rb', line 527 def get_element_tag_name(selector, index) return __string_command("getElementTagName", [selector, index,]) end |
#get_sc_collection_view_content_disclosure_state(scpath, index) ⇒ Object
370 371 372 |
# File 'lib/lebowski/runtime/sprout_core_extensions.rb', line 370 def get_sc_collection_view_content_disclosure_state(scpath, index) return __number_command("getScCollectionViewContentDisclosureState", [scpath, index,]) end |
#get_sc_collection_view_content_group_indexes(scpath) ⇒ Object
SC Collection View Selenium Calls
350 351 352 |
# File 'lib/lebowski/runtime/sprout_core_extensions.rb', line 350 def get_sc_collection_view_content_group_indexes(scpath) return __number_array_command("getScCollectionViewContentGroupIndexes", [scpath,]) end |
#get_sc_collection_view_content_is_group(scpath, index) ⇒ Object
366 367 368 |
# File 'lib/lebowski/runtime/sprout_core_extensions.rb', line 366 def get_sc_collection_view_content_is_group(scpath, index) return __boolean_command("getScCollectionViewContentIsGroup", [scpath, index,]) end |
#get_sc_collection_view_content_is_selected(scpath, index) ⇒ Object
362 363 364 |
# File 'lib/lebowski/runtime/sprout_core_extensions.rb', line 362 def get_sc_collection_view_content_is_selected(scpath, index) return __boolean_command("getScCollectionViewContentIsSelected", [scpath, index,]) end |
#get_sc_collection_view_content_now_showing_indexes(scpath) ⇒ Object
358 359 360 |
# File 'lib/lebowski/runtime/sprout_core_extensions.rb', line 358 def get_sc_collection_view_content_now_showing_indexes(scpath) return __number_array_command("getScCollectionViewContentNowShowingIndexes", [scpath,]) end |
#get_sc_collection_view_content_outline_level(scpath, index) ⇒ Object
374 375 376 |
# File 'lib/lebowski/runtime/sprout_core_extensions.rb', line 374 def get_sc_collection_view_content_outline_level(scpath, index) return __number_command("getScCollectionViewContentOutlineLevel", [scpath, index,]) end |
#get_sc_collection_view_content_selected_indexes(scpath) ⇒ Object
354 355 356 |
# File 'lib/lebowski/runtime/sprout_core_extensions.rb', line 354 def get_sc_collection_view_content_selected_indexes(scpath) return __number_array_command("getScCollectionViewContentSelectedIndexes", [scpath,]) end |
#get_sc_core_query(scpath, selector) ⇒ Object
320 321 322 |
# File 'lib/lebowski/runtime/sprout_core_extensions.rb', line 320 def get_sc_core_query(scpath, selector) return __number_command("getScCoreQuery", [scpath, selector]) end |
#get_sc_core_query_element_attribute(handle, elemIndex, attribute) ⇒ Object
336 337 338 |
# File 'lib/lebowski/runtime/sprout_core_extensions.rb', line 336 def get_sc_core_query_element_attribute(handle, elemIndex, attribute) return __string_command("getScCoreQueryElementAttribute", [handle, "#{elemIndex}:#{attribute}",]) end |
#get_sc_core_query_element_classes(handle, elemIndex) ⇒ Object
328 329 330 |
# File 'lib/lebowski/runtime/sprout_core_extensions.rb', line 328 def get_sc_core_query_element_classes(handle, elemIndex) return __string_command("getScCoreQueryElementClasses", [handle, elemIndex,]) end |
#get_sc_core_query_element_html(handle, elemIndex) ⇒ Object
332 333 334 |
# File 'lib/lebowski/runtime/sprout_core_extensions.rb', line 332 def get_sc_core_query_element_html(handle, elemIndex) return __string_command("getScCoreQueryElementHTML", [handle, elemIndex,]) end |
#get_sc_core_query_element_tag(handle, elemIndex) ⇒ Object
344 345 346 |
# File 'lib/lebowski/runtime/sprout_core_extensions.rb', line 344 def get_sc_core_query_element_tag(handle, elemIndex) return __string_command("getScCoreQueryElementTag", [handle, elemIndex,]) end |
#get_sc_core_query_element_text(handle, elemIndex) ⇒ Object
340 341 342 |
# File 'lib/lebowski/runtime/sprout_core_extensions.rb', line 340 def get_sc_core_query_element_text(handle, elemIndex) return __string_command("getScCoreQueryElementText", [handle, elemIndex,]) end |
#get_sc_core_query_size(handle) ⇒ Object
324 325 326 |
# File 'lib/lebowski/runtime/sprout_core_extensions.rb', line 324 def get_sc_core_query_size(handle) return __number_command("getScCoreQuerySize", [handle,]) end |
#get_sc_element_height(type, *params) ⇒ Object
148 149 150 |
# File 'lib/lebowski/runtime/sprout_core_extensions.rb', line 148 def get_sc_element_height(type, *params) return get_element_height(__locator(type, *params)) end |
#get_sc_element_width(type, *params) ⇒ Object
144 145 146 |
# File 'lib/lebowski/runtime/sprout_core_extensions.rb', line 144 def get_sc_element_width(type, *params) return get_element_width(__locator(type, *params)) end |
#get_sc_element_window_position(type, *params) ⇒ Lebowski::Coords
138 139 140 141 142 |
# File 'lib/lebowski/runtime/sprout_core_extensions.rb', line 138 def get_sc_element_window_position(type, *params) value = __number_array_command("getScElementWindowPosition", [__locator(type, *params)]) return nil if value.nil? return Coords.new(value[0], value[1]) end |
#get_sc_guid(scpath) ⇒ Object
SC Object Foundation Selenium Calls
36 37 38 |
# File 'lib/lebowski/runtime/sprout_core_extensions.rb', line 36 def get_sc_guid(scpath) return __string_command("getScGuid", [scpath]) end |
#get_sc_localized_string(str) ⇒ Object
412 413 414 415 416 417 418 419 420 421 422 423 424 |
# File 'lib/lebowski/runtime/sprout_core_extensions.rb', line 412 def get_sc_localized_string(str) if @localized_string_cache.nil? @localized_string_cache = {} end if @localized_string_cache.has_key?(str) return @localized_string_cache[str] else val = __string_command("getScLocalizedString", [str, ]) @localized_string_cache[str] = val return val end end |
#get_sc_object_array_index_lookup(scpath, lookup_params) ⇒ Object
403 404 405 406 |
# File 'lib/lebowski/runtime/sprout_core_extensions.rb', line 403 def get_sc_object_array_index_lookup(scpath, lookup_params) encoded_params = ObjectEncoder.encode_hash(lookup_params) return __number_array_command("getScObjectArrayIndexLookup", [scpath, encoded_params]) end |
#get_sc_object_class_name(scpath) ⇒ Object
40 41 42 |
# File 'lib/lebowski/runtime/sprout_core_extensions.rb', line 40 def get_sc_object_class_name(scpath) return __string_command("getScObjectClassName", [scpath]) end |
#get_sc_object_class_names(scpath) ⇒ Object
56 57 58 |
# File 'lib/lebowski/runtime/sprout_core_extensions.rb', line 56 def get_sc_object_class_names(scpath) return __string_array_command("getScObjectClassNames", [scpath]) end |
#get_sc_path_boolean_array_value(scpath) ⇒ Object
82 83 84 |
# File 'lib/lebowski/runtime/sprout_core_extensions.rb', line 82 def get_sc_path_boolean_array_value(scpath) return __boolean_array_command("getScPropertyValue", [scpath]) end |
#get_sc_path_boolean_value(scpath) ⇒ Object
70 71 72 |
# File 'lib/lebowski/runtime/sprout_core_extensions.rb', line 70 def get_sc_path_boolean_value(scpath) return __boolean_command("getScPropertyValue", [scpath]) end |
#get_sc_path_number_array_value(scpath) ⇒ Object
78 79 80 |
# File 'lib/lebowski/runtime/sprout_core_extensions.rb', line 78 def get_sc_path_number_array_value(scpath) return __number_array_command("getScPropertyValue", [scpath]) end |
#get_sc_path_number_value(scpath) ⇒ Object
66 67 68 |
# File 'lib/lebowski/runtime/sprout_core_extensions.rb', line 66 def get_sc_path_number_value(scpath) return __number_command("getScPropertyValue", [scpath]) end |
#get_sc_path_string_array_value(scpath) ⇒ Object
74 75 76 |
# File 'lib/lebowski/runtime/sprout_core_extensions.rb', line 74 def get_sc_path_string_array_value(scpath) return __string_array_command("getScPropertyValue", [scpath]) end |
#get_sc_path_string_value(scpath) ⇒ Object
SC Object Property Selenium Calls
62 63 64 |
# File 'lib/lebowski/runtime/sprout_core_extensions.rb', line 62 def get_sc_path_string_value(scpath) return __string_command("getScPropertyValue", [scpath]) end |
#get_sc_property_array_value(scpath, property) ⇒ Object
105 106 107 |
# File 'lib/lebowski/runtime/sprout_core_extensions.rb', line 105 def get_sc_property_array_value(scpath, property) return get_sc_property_string_array_value(scpath, property) end |
#get_sc_property_boolean_array_value(scpath, property) ⇒ Object
119 120 121 122 |
# File 'lib/lebowski/runtime/sprout_core_extensions.rb', line 119 def get_sc_property_boolean_array_value(scpath, property) full_path = "#{scpath}.#{property}" return __boolean_array_command("getScPropertyValue", [full_path,]) end |
#get_sc_property_boolean_value(scpath, property) ⇒ Object
95 96 97 98 |
# File 'lib/lebowski/runtime/sprout_core_extensions.rb', line 95 def get_sc_property_boolean_value(scpath, property) full_path = "#{scpath}.#{property}" return __boolean_command("getScPropertyValue", [full_path,]) end |
#get_sc_property_number_array_value(scpath, property) ⇒ Object
114 115 116 117 |
# File 'lib/lebowski/runtime/sprout_core_extensions.rb', line 114 def get_sc_property_number_array_value(scpath, property) full_path = "#{scpath}.#{property}" return __number_array_command("getScPropertyValue", [full_path,]) end |
#get_sc_property_number_value(scpath, property) ⇒ Object
100 101 102 103 |
# File 'lib/lebowski/runtime/sprout_core_extensions.rb', line 100 def get_sc_property_number_value(scpath, property) full_path = "#{scpath}.#{property}" return __number_command("getScPropertyValue", [full_path,]) end |
#get_sc_property_string_array_value(scpath, property) ⇒ Object
109 110 111 112 |
# File 'lib/lebowski/runtime/sprout_core_extensions.rb', line 109 def get_sc_property_string_array_value(scpath, property) full_path = "#{scpath}.#{property}" return __string_array_command("getScPropertyValue", [full_path,]) end |
#get_sc_property_string_value(scpath, property) ⇒ Object
90 91 92 93 |
# File 'lib/lebowski/runtime/sprout_core_extensions.rb', line 90 def get_sc_property_string_value(scpath, property) full_path = "#{scpath}.#{property}" return __string_command("getScPropertyValue", [full_path,]) end |
#get_sc_property_value(scpath, property) ⇒ Object
86 87 88 |
# File 'lib/lebowski/runtime/sprout_core_extensions.rb', line 86 def get_sc_property_value(scpath, property) return get_sc_property_string_value(scpath, property) end |
#get_sc_scrollable_parent_view_layer_id(path) ⇒ Object
535 536 537 |
# File 'lib/lebowski/runtime/sprout_core_extensions.rb', line 535 def get_sc_scrollable_parent_view_layer_id(path) return __string_command("getScScrollableParentViewLayerId", [path]) end |
#get_sc_selection_set_indexes(scpath) ⇒ Object
408 409 410 |
# File 'lib/lebowski/runtime/sprout_core_extensions.rb', line 408 def get_sc_selection_set_indexes(scpath) return __number_array_command("getScSelectSetIndexes", [scpath, ]) end |
#get_sc_type_of(scpath) ⇒ Object
48 49 50 |
# File 'lib/lebowski/runtime/sprout_core_extensions.rb', line 48 def get_sc_type_of(scpath) return __string_command("getScTypeOf", [scpath]) end |
#get_sc_type_of_array_content(scpath) ⇒ Object
52 53 54 |
# File 'lib/lebowski/runtime/sprout_core_extensions.rb', line 52 def get_sc_type_of_array_content(scpath) return __string_command("getScTypeOfArrayContent", [scpath]) end |
#get_sc_view_child_view_count(scpath) ⇒ Object
152 153 154 155 |
# File 'lib/lebowski/runtime/sprout_core_extensions.rb', line 152 def get_sc_view_child_view_count(scpath) full_path = "#{scpath}.childViews.length" return __number_command("getScPropertyValue", [full_path, ]) end |
#get_sc_view_frame(scpath) ⇒ Lebowski::Rect
131 132 133 134 135 |
# File 'lib/lebowski/runtime/sprout_core_extensions.rb', line 131 def get_sc_view_frame(scpath) value = __number_array_command("getScViewFrame", [scpath]) return nil if value.nil? return Rect.new(value[0], value[1], value[2], value[3]) end |
#get_sc_view_layer(scpath) ⇒ Object
SC View Object Foundation Selenium Calls
126 127 128 |
# File 'lib/lebowski/runtime/sprout_core_extensions.rb', line 126 def get_sc_view_layer(scpath) return string_command("getScViewLayer", [scpath, ]) end |
#initialize_sc_selenium_extension(timeout) ⇒ Object
22 23 24 |
# File 'lib/lebowski/runtime/sprout_core_extensions.rb', line 22 def initialize_sc_selenium_extension(timeout) __remote_control_command("initializeScSeleniumExtension", [timeout,]) end |
#is_sc_bundle_loaded(bundle) ⇒ Object
399 400 401 |
# File 'lib/lebowski/runtime/sprout_core_extensions.rb', line 399 def is_sc_bundle_loaded(bundle) return __boolean_command("isScBundleLoaded", [bundle]) end |
#is_sc_object_kind_of_class(scpath, klass) ⇒ Object
44 45 46 |
# File 'lib/lebowski/runtime/sprout_core_extensions.rb', line 44 def is_sc_object_kind_of_class(scpath, klass) return __boolean_command("isScObjectKindOfClass", [scpath, klass]) end |
#is_sc_opened_window?(locator_type, locator_value) ⇒ Boolean
453 454 455 456 457 458 459 460 461 462 |
# File 'lib/lebowski/runtime/sprout_core_extensions.rb', line 453 def is_sc_opened_window?(locator_type, locator_value) hash = { :locatorType => locator_type, :locatorValue => locator_value } encoded_hash = ObjectEncoder.encode_hash(hash) return __boolean_command("isScOpenedWindow", [encoded_hash]) end |
#key_down?(key) ⇒ Boolean
281 282 283 |
# File 'lib/lebowski/runtime/sprout_core_extensions.rb', line 281 def key_down?(key) return __key_pressed?(key) end |
#key_up?(key) ⇒ Boolean
285 286 287 |
# File 'lib/lebowski/runtime/sprout_core_extensions.rb', line 285 def key_up?(key) return (not __key_pressed?(key)) end |
#open_sc_application(app_root_path, timeout = nil) ⇒ Object
26 27 28 |
# File 'lib/lebowski/runtime/sprout_core_extensions.rb', line 26 def open_sc_application(app_root_path, timeout=nil) __remote_control_command("openScApplication", [app_root_path, timeout]) end |
#range_delete_content(*params) ⇒ Object
495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 |
# File 'lib/lebowski/runtime/sprout_core_extensions.rb', line 495 def range_delete_content(*params) hash = nil if params.length == 0 raise ArgumentError.new "no parameters were supplied" end if params[0].kind_of? Hash hash = params[0] end encoded_hash = ObjectEncoder.encode_hash(hash) __remote_control_command("rangeDeleteContent", [encoded_hash]) end |
#range_insert_content(*params) ⇒ Object
511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 |
# File 'lib/lebowski/runtime/sprout_core_extensions.rb', line 511 def range_insert_content(*params) hash = nil if params.length == 0 raise ArgumentError.new "no parameters were supplied" end if params[0].kind_of? Hash hash = params[0] end encoded_hash = ObjectEncoder.encode_hash(hash) __remote_control_command("rangeInsertContent", [encoded_hash]) end |
#sc_basic_click(type, *params) ⇒ Object
215 216 217 |
# File 'lib/lebowski/runtime/sprout_core_extensions.rb', line 215 def sc_basic_click(type, *params) __remote_control_command("click", [__locator(type, *params), ]) end |
#sc_click(type, *params) ⇒ Object
219 220 221 |
# File 'lib/lebowski/runtime/sprout_core_extensions.rb', line 219 def sc_click(type, *params) __remote_control_command("scClick", [__locator(type, *params), ]) end |
#sc_close_opened_window(locator_type, locator_value) ⇒ Object
464 465 466 467 468 469 470 471 472 473 |
# File 'lib/lebowski/runtime/sprout_core_extensions.rb', line 464 def sc_close_opened_window(locator_type, locator_value) hash = { :locatorType => locator_type, :locatorValue => locator_value } encoded_hash = ObjectEncoder.encode_hash(hash) return __boolean_command("scCloseOpenedWindow", [encoded_hash]) end |
#sc_core_query_done(handle) ⇒ Object
SC Core Query Selenium Calls
316 317 318 |
# File 'lib/lebowski/runtime/sprout_core_extensions.rb', line 316 def sc_core_query_done(handle) __remote_control_command("scCoreQueryDone", [handle,]) end |
#sc_disable_all_autoscrolling ⇒ Object
Disables all autoscrolling when performing a drag and drop operation within a SproutCore Application. Call this when you don’t want autoscrolling to interfere with some user action.
386 387 388 |
# File 'lib/lebowski/runtime/sprout_core_extensions.rb', line 386 def sc_disable_all_autoscrolling __remote_control_command("scDisableAllAutoscrolling") end |
#sc_double_click(type, *params) ⇒ Object
227 228 229 |
# File 'lib/lebowski/runtime/sprout_core_extensions.rb', line 227 def sc_double_click(type, *params) __remote_control_command("scDoubleClick", [__locator(type, *params), ]) end |
#sc_enable_all_autoscrolling ⇒ Object
Used to enable all autoscrolling. Call this after you have completed a user action that you did not want autoscrolling to intefere with.
395 396 397 |
# File 'lib/lebowski/runtime/sprout_core_extensions.rb', line 395 def sc_enable_all_autoscrolling __remote_control_command("scEnableAllAutoscrolling") end |
#sc_enable_mouse_move_event ⇒ Object
239 240 241 |
# File 'lib/lebowski/runtime/sprout_core_extensions.rb', line 239 def sc_enable_mouse_move_event() __remote_control_command("scEnableMouseMoveEvent", []) end |
#sc_focus(type, *params) ⇒ Object
243 244 245 |
# File 'lib/lebowski/runtime/sprout_core_extensions.rb', line 243 def sc_focus(type, *params) __remote_control_command("focus", [__locator(type, *params), ]) end |
#sc_key_down(type, key, *params) ⇒ Object
247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 |
# File 'lib/lebowski/runtime/sprout_core_extensions.rb', line 247 def sc_key_down(type, key, *params) if key == :meta_key elsif key == :alt_key alt_key_down elsif key == :ctrl_key control_key_down elsif key == :shift_key shift_key_down elsif key.kind_of? Symbol __remote_control_command("scFunctionKeyDown", [__locator(type, *params), key.to_s]) else __remote_control_command("scKeyDown", [__locator(type, *params), key]) end __register_key_as_down(key) end |
#sc_key_up(type, key, *params) ⇒ Object
264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 |
# File 'lib/lebowski/runtime/sprout_core_extensions.rb', line 264 def sc_key_up(type, key, *params) if key == :meta_key elsif key == :alt_key alt_key_up elsif key == :ctrl_key control_key_up elsif key == :shift_key shift_key_up elsif key.kind_of? Symbol __remote_control_command("scFunctionKeyUp", [__locator(type, *params), key.to_s]) else __remote_control_command("scKeyUp", [__locator(type, *params), key]) end __register_key_as_up(key) end |
#sc_mouse_down(type, *params) ⇒ Object
174 175 176 |
# File 'lib/lebowski/runtime/sprout_core_extensions.rb', line 174 def sc_mouse_down(type, *params) __remote_control_command("scMouseDown", [__locator(type, *params)]) end |
#sc_mouse_down_at(type, x, y, *params) ⇒ Object
195 196 197 198 |
# File 'lib/lebowski/runtime/sprout_core_extensions.rb', line 195 def sc_mouse_down_at(type, x, y, *params) encoded_params = ObjectEncoder.encode_hash({ :x => x, :y => y }) __remote_control_command("scMouseDownAt", [__locator(type, *params), encoded_params]) end |
#sc_mouse_move(type, *params) ⇒ Object Also known as: sc_mouse_enter, sc_mouse_exit
167 168 169 |
# File 'lib/lebowski/runtime/sprout_core_extensions.rb', line 167 def sc_mouse_move(type, *params) __remote_control_command("mouseMove", [__locator(type, *params),]) end |
#sc_mouse_move_at(type, x, y, *params) ⇒ Object
190 191 192 193 |
# File 'lib/lebowski/runtime/sprout_core_extensions.rb', line 190 def sc_mouse_move_at(type, x, y, *params) encoded_params = ObjectEncoder.encode_hash({ :x => x, :y => y }) __remote_control_command("scMouseMoveAt", [__locator(type, *params), encoded_params]) end |
#sc_mouse_up(type, *params) ⇒ Object
178 179 180 |
# File 'lib/lebowski/runtime/sprout_core_extensions.rb', line 178 def sc_mouse_up(type, *params) __remote_control_command("scMouseUp", [__locator(type, *params)]) end |
#sc_mouse_up_at(type, x, y, *params) ⇒ Object
200 201 202 203 |
# File 'lib/lebowski/runtime/sprout_core_extensions.rb', line 200 def sc_mouse_up_at(type, x, y, *params) encoded_params = ObjectEncoder.encode_hash({ :x => x, :y => y }) __remote_control_command("scMouseUpAt", [__locator(type, *params), encoded_params]) end |
#sc_mouse_wheel_delta_x(type, delta, *params) ⇒ Object
231 232 233 |
# File 'lib/lebowski/runtime/sprout_core_extensions.rb', line 231 def sc_mouse_wheel_delta_x(type, delta, *params) __remote_control_command("scMouseWheelDeltaX", [__locator(type, *params), delta]) end |
#sc_mouse_wheel_delta_y(type, delta, *params) ⇒ Object
235 236 237 |
# File 'lib/lebowski/runtime/sprout_core_extensions.rb', line 235 def sc_mouse_wheel_delta_y(type, delta, *params) __remote_control_command("scMouseWheelDeltaY", [__locator(type, *params), delta]) end |
#sc_right_click(type, *params) ⇒ Object
223 224 225 |
# File 'lib/lebowski/runtime/sprout_core_extensions.rb', line 223 def sc_right_click(type, *params) __remote_control_command("scRightClick", [__locator(type, *params), ]) end |
#sc_right_mouse_down(type, *params) ⇒ Object
182 183 184 |
# File 'lib/lebowski/runtime/sprout_core_extensions.rb', line 182 def sc_right_mouse_down(type, *params) __remote_control_command("scMouseDownRight", [__locator(type, *params)]) end |
#sc_right_mouse_down_at(type, x, y, *params) ⇒ Object
205 206 207 208 |
# File 'lib/lebowski/runtime/sprout_core_extensions.rb', line 205 def sc_right_mouse_down_at(type, x, y, *params) encoded_params = ObjectEncoder.encode_hash({ :x => x, :y => y }) __remote_control_command("scMouseDownRightAt", [__locator(type, *params), encoded_params]) end |
#sc_right_mouse_up(type, *params) ⇒ Object
186 187 188 |
# File 'lib/lebowski/runtime/sprout_core_extensions.rb', line 186 def sc_right_mouse_up(type, *params) __remote_control_command("scMouseUpRight", [__locator(type, *params)]) end |
#sc_right_mouse_up_at(type, x, y, *params) ⇒ Object
210 211 212 213 |
# File 'lib/lebowski/runtime/sprout_core_extensions.rb', line 210 def sc_right_mouse_up_at(type, x, y, *params) encoded_params = ObjectEncoder.encode_hash({ :x => x, :y => y }) __remote_control_command("scMouseUpRightAt", [__locator(type, *params), encoded_params]) end |
#sc_select(type, optionLocator, *params) ⇒ Object
163 164 165 |
# File 'lib/lebowski/runtime/sprout_core_extensions.rb', line 163 def sc_select(type, optionLocator, *params) __remote_control_command("select", [__locator(type, *params), optionLocator, ]) end |
#sc_select_main_window ⇒ Object
438 439 440 |
# File 'lib/lebowski/runtime/sprout_core_extensions.rb', line 438 def sc_select_main_window() sc_select_window('top', '') end |
#sc_select_window(locator_type, locator_value) ⇒ Object
442 443 444 445 446 447 448 449 450 451 |
# File 'lib/lebowski/runtime/sprout_core_extensions.rb', line 442 def sc_select_window(locator_type, locator_value) hash = { :locatorType => locator_type, :locatorValue => locator_value } encoded_hash = ObjectEncoder.encode_hash(hash) __remote_control_command("scSelectWindow", [encoded_hash]) end |
#sc_type(type, text, *params) ⇒ Object
SC View Object Event Selenium Calls
159 160 161 |
# File 'lib/lebowski/runtime/sprout_core_extensions.rb', line 159 def sc_type(type, text, *params) __remote_control_command("type", [__locator(type, *params), text, ]) end |
#sc_type_key(type, key, *params) ⇒ Object
289 290 291 292 293 294 295 |
# File 'lib/lebowski/runtime/sprout_core_extensions.rb', line 289 def sc_type_key(type, key, *params) if key.kind_of? Symbol __remote_control_command("scTypeFunctionKey", [__locator(type, *params), key.to_s, ]) else __remote_control_command("scTypeKey", [__locator(type, *params), key, ]) end end |
#sc_view_scroll_to_visible(scpath) ⇒ Object
297 298 299 |
# File 'lib/lebowski/runtime/sprout_core_extensions.rb', line 297 def sc_view_scroll_to_visible(scpath) __remote_control_command("scViewScrollToVisible", [scpath]) end |
#sc_wait_until(root_scpath, join, conditions, timeout = nil) ⇒ Object
301 302 303 304 305 306 307 308 309 310 311 312 |
# File 'lib/lebowski/runtime/sprout_core_extensions.rb', line 301 def sc_wait_until(root_scpath, join, conditions, timeout=nil) params = { :rootPath => root_scpath, :join => join, :conditions => conditions, :timeout => timeout } encoded_params = ObjectEncoder.encode_hash(params) __remote_control_command("scWaitUntil", [encoded_params]) end |
#sc_window_maximize ⇒ Object
434 435 436 |
# File 'lib/lebowski/runtime/sprout_core_extensions.rb', line 434 def sc_window_maximize() __remote_control_command("scWindowMaximize") end |
#sc_window_move_to(x, y) ⇒ Object
426 427 428 |
# File 'lib/lebowski/runtime/sprout_core_extensions.rb', line 426 def sc_window_move_to(x, y) __remote_control_command("scWindowMoveTo", [x, y]) end |
#sc_window_resize_to(width, height) ⇒ Object
430 431 432 |
# File 'lib/lebowski/runtime/sprout_core_extensions.rb', line 430 def sc_window_resize_to(width, height) __remote_control_command("scWindowResizeTo", [width, height]) end |
#select_range(*params) ⇒ Object
479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 |
# File 'lib/lebowski/runtime/sprout_core_extensions.rb', line 479 def select_range(*params) hash = nil if params.length == 0 raise ArgumentError.new "no parameters were supplied" end if params[0].kind_of? Hash hash = params[0] end encoded_hash = ObjectEncoder.encode_hash(hash) __remote_control_command("selectRange", [encoded_hash]) end |
#set_application_name(name) ⇒ Object
SC Application Setup Selenium Calls
18 19 20 |
# File 'lib/lebowski/runtime/sprout_core_extensions.rb', line 18 def set_application_name(name) __remote_control_command("setScApplicationName", [name,]) end |
#update_sc_application_context(app_name, timeout = nil) ⇒ Object
30 31 32 |
# File 'lib/lebowski/runtime/sprout_core_extensions.rb', line 30 def update_sc_application_context(app_name, timeout=nil) __remote_control_command("updateScApplicationContext", [app_name, timeout]) end |