Class: TestCentricity::ScreenSection
- Inherits:
-
BaseScreenSectionObject
- Object
- BaseScreenSectionObject
- TestCentricity::ScreenSection
- Includes:
- Test::Unit::Assertions
- Defined in:
- lib/testcentricity_apps/app_core/screen_section.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#context ⇒ Object
readonly
Returns the value of attribute context.
-
#list_index ⇒ Object
Returns the value of attribute list_index.
-
#locator ⇒ Object
Returns the value of attribute locator.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#parent ⇒ Object
Returns the value of attribute parent.
-
#parent_list ⇒ Object
Returns the value of attribute parent_list.
Class Method Summary collapse
-
.button(element_name, locator) ⇒ Object
Declare and instantiate a single button UI Element for this screen section object.
-
.buttons(element_hash) ⇒ Object
Declare and instantiate a collection of buttons for this screen section object.
-
.checkbox(element_name, locator) ⇒ Object
Declare and instantiate a single checkbox UI Element for this screen section object.
-
.checkboxes(element_hash) ⇒ Object
Declare and instantiate a collection of checkboxes for this screen section object.
- .define_section_element(element_name, obj, locator) ⇒ Object
-
.element(element_name, locator) ⇒ Object
Declare and instantiate a single generic UI Element for this screen section object.
-
.elements(element_hash) ⇒ Object
Declare and instantiate a collection of generic UI Elements for this screen section object.
-
.image(element_name, locator) ⇒ Object
Declare and instantiate a single image UI Element for this screen section object.
-
.images(element_hash) ⇒ Object
Declare and instantiate a collection of images for this screen section object.
-
.label(element_name, locator) ⇒ Object
Declare and instantiate a single label UI Element for this screen section object.
-
.labels(element_hash) ⇒ Object
Declare and instantiate a collection of labels for this screen section object.
-
.list(element_name, locator) ⇒ Object
Declare and instantiate a single list UI Element for this screen section object.
-
.lists(element_hash) ⇒ Object
Declare and instantiate a collection of lists for this screen section object.
-
.menu(element_name, locator) ⇒ Object
Declare and instantiate a single menu UI Element for this ScreenSection object.
-
.menus(element_hash) ⇒ Object
Declare and instantiate a collection of menus for this ScreenSection object.
-
.radio(element_name, locator) ⇒ Object
Declare and instantiate a single radio button UI Element for this screen section object.
-
.radios(element_hash) ⇒ Object
Declare and instantiate a collection of radio buttons for this screen section object.
-
.section(section_name, obj, locator = 0) ⇒ Object
Instantiate a single ScreenSection object within this ScreenSection object.
-
.sections(section_hash) ⇒ Object
Declare and instantiate a collection of ScreenSection objects for this ScreenSection object.
-
.selectlist(element_name, locator) ⇒ Object
Declare and instantiate a single selectlist UI Element for this screen section object.
-
.selectlists(element_hash) ⇒ Object
Declare and instantiate a collection of selectlists for this screen section object.
-
.switch(element_name, locator) ⇒ Object
Declare and instantiate a single switch UI Element for this screen section object.
-
.switches(element_hash) ⇒ Object
Declare and instantiate a collection of switches for this screen section object.
-
.table(element_name, locator) ⇒ Object
Declare and instantiate a single table UI Element for this screen section object.
-
.tables(element_hash) ⇒ Object
Declare and instantiate a collection of tables for this screen section object.
-
.textfield(element_name, locator) ⇒ Object
Declare and instantiate a single textfield UI Element for this screen section object.
-
.textfields(element_hash) ⇒ Object
Declare and instantiate a collection of textfields for this screen section object.
Instance Method Summary collapse
-
#click ⇒ Object
Click on a screen Section object.
-
#disabled? ⇒ Boolean
Is screen Section object disabled (not enabled)?.
-
#double_tap ⇒ Object
Double-tap on a screen Section object.
-
#enabled? ⇒ Boolean
Is screen Section object enabled?.
-
#exists? ⇒ Boolean
Does screen Section object exists?.
- #get_item_count ⇒ Object
- #get_list_items ⇒ Object
- #get_locator ⇒ Object
- #get_name ⇒ Object
- #get_object_type ⇒ Object
-
#height ⇒ Integer
Return height of screen Section object.
-
#hidden? ⇒ Boolean
Is screen Section object hidden (not visible)?.
- #identifier ⇒ Object
-
#initialize(name, parent, locator, context) ⇒ ScreenSection
constructor
A new instance of ScreenSection.
-
#long_press(duration = 1) ⇒ Object
Long press on a screen Section object.
-
#scroll_into_view(scroll_mode = :vertical) ⇒ Object
Scroll the screen Section object until it is visible.
-
#send_keys(value) ⇒ Object
Send keystrokes to this section object.
- #set_list_index(list, index = 1) ⇒ Object
- #set_parent(parent) ⇒ Object
-
#tap ⇒ Object
Tap on a screen Section object.
-
#visible? ⇒ Boolean
Is screen Section object visible?.
-
#wait_until_exists(seconds = nil, post_exception = true) ⇒ Object
Wait until the screen Section object exists, or until the specified wait time has expired.
-
#wait_until_gone(seconds = nil, post_exception = true) ⇒ Object
Wait until the screen Section object no longer exists, or until the specified wait time has expired.
-
#wait_until_hidden(seconds = nil, post_exception = true) ⇒ Object
Wait until the screen Section object is hidden, or until the specified wait time has expired.
-
#wait_until_visible(seconds = nil, post_exception = true) ⇒ Object
Wait until the screen Section object is visible, or until the specified wait time has expired.
-
#width ⇒ Integer
Return width of screen Section object.
-
#x_loc ⇒ Integer
Return x coordinate of screen Section object's location.
-
#y_loc ⇒ Integer
Return y coordinate of screen Section object's location.
Methods inherited from BaseScreenSectionObject
#populate_data_fields, #swipe_gesture, trait, #verify_ui_states
Constructor Details
#initialize(name, parent, locator, context) ⇒ ScreenSection
Returns a new instance of ScreenSection.
10 11 12 13 14 15 16 17 |
# File 'lib/testcentricity_apps/app_core/screen_section.rb', line 10 def initialize(name, parent, locator, context) @name = name @parent = parent @locator = locator @context = context @parent_list = nil @list_index = nil end |
Instance Attribute Details
#context ⇒ Object (readonly)
Returns the value of attribute context.
7 8 9 |
# File 'lib/testcentricity_apps/app_core/screen_section.rb', line 7 def context @context end |
#list_index ⇒ Object
Returns the value of attribute list_index.
8 9 10 |
# File 'lib/testcentricity_apps/app_core/screen_section.rb', line 8 def list_index @list_index end |
#locator ⇒ Object
Returns the value of attribute locator.
8 9 10 |
# File 'lib/testcentricity_apps/app_core/screen_section.rb', line 8 def locator @locator end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
7 8 9 |
# File 'lib/testcentricity_apps/app_core/screen_section.rb', line 7 def name @name end |
#parent ⇒ Object
Returns the value of attribute parent.
8 9 10 |
# File 'lib/testcentricity_apps/app_core/screen_section.rb', line 8 def parent @parent end |
#parent_list ⇒ Object
Returns the value of attribute parent_list.
8 9 10 |
# File 'lib/testcentricity_apps/app_core/screen_section.rb', line 8 def parent_list @parent_list end |
Class Method Details
.button(element_name, locator) ⇒ Object
Declare and instantiate a single button UI Element for this screen section object.
123 124 125 |
# File 'lib/testcentricity_apps/app_core/screen_section.rb', line 123 def self.(element_name, locator) define_section_element(element_name, TestCentricity::AppElements::AppButton, locator) end |
.buttons(element_hash) ⇒ Object
Declare and instantiate a collection of buttons for this screen section object.
136 137 138 |
# File 'lib/testcentricity_apps/app_core/screen_section.rb', line 136 def self.(element_hash) element_hash.each_pair { |element_name, locator| (element_name, locator) } end |
.checkbox(element_name, locator) ⇒ Object
Declare and instantiate a single checkbox UI Element for this screen section object.
192 193 194 |
# File 'lib/testcentricity_apps/app_core/screen_section.rb', line 192 def self.checkbox(element_name, locator) define_section_element(element_name, TestCentricity::AppElements::AppCheckBox, locator) end |
.checkboxes(element_hash) ⇒ Object
Declare and instantiate a collection of checkboxes for this screen section object.
203 204 205 |
# File 'lib/testcentricity_apps/app_core/screen_section.rb', line 203 def self.checkboxes(element_hash) element_hash.each_pair { |element_name, locator| checkbox(element_name, locator) } end |
.define_section_element(element_name, obj, locator) ⇒ Object
702 703 704 705 706 707 708 709 710 |
# File 'lib/testcentricity_apps/app_core/screen_section.rb', line 702 def self.define_section_element(element_name, obj, locator) define_method(element_name) do ivar_name = "@#{element_name}" ivar = instance_variable_get(ivar_name) return ivar if ivar instance_variable_set(ivar_name, obj.new(element_name, self, locator, :section)) end end |
.element(element_name, locator) ⇒ Object
Declare and instantiate a single generic UI Element for this screen section object.
- The locator_identifier (a String) is the value or attribute that uniquely and unambiguously identifies the UI element.
100 101 102 |
# File 'lib/testcentricity_apps/app_core/screen_section.rb', line 100 def self.element(element_name, locator) define_section_element(element_name, TestCentricity::AppElements::AppUIElement, locator) end |
.elements(element_hash) ⇒ Object
Declare and instantiate a collection of generic UI Elements for this screen section object.
112 113 114 |
# File 'lib/testcentricity_apps/app_core/screen_section.rb', line 112 def self.elements(element_hash) element_hash.each_pair { |element_name, locator| element(element_name, locator) } end |
.image(element_name, locator) ⇒ Object
Declare and instantiate a single image UI Element for this screen section object.
324 325 326 |
# File 'lib/testcentricity_apps/app_core/screen_section.rb', line 324 def self.image(element_name, locator) define_section_element(element_name, TestCentricity::AppElements::AppImage, locator) end |
.images(element_hash) ⇒ Object
Declare and instantiate a collection of images for this screen section object.
335 336 337 |
# File 'lib/testcentricity_apps/app_core/screen_section.rb', line 335 def self.images(element_hash) element_hash.each_pair { |element_name, locator| image(element_name, locator) } end |
.label(element_name, locator) ⇒ Object
Declare and instantiate a single label UI Element for this screen section object.
236 237 238 |
# File 'lib/testcentricity_apps/app_core/screen_section.rb', line 236 def self.label(element_name, locator) define_section_element(element_name, TestCentricity::AppElements::AppLabel, locator) end |
.labels(element_hash) ⇒ Object
Declare and instantiate a collection of labels for this screen section object.
247 248 249 |
# File 'lib/testcentricity_apps/app_core/screen_section.rb', line 247 def self.labels(element_hash) element_hash.each_pair { |element_name, locator| label(element_name, locator) } end |
.list(element_name, locator) ⇒ Object
Declare and instantiate a single list UI Element for this screen section object.
258 259 260 |
# File 'lib/testcentricity_apps/app_core/screen_section.rb', line 258 def self.list(element_name, locator) define_section_element(element_name, TestCentricity::AppElements::AppList, locator) end |
.lists(element_hash) ⇒ Object
Declare and instantiate a collection of lists for this screen section object.
269 270 271 |
# File 'lib/testcentricity_apps/app_core/screen_section.rb', line 269 def self.lists(element_hash) element_hash.each_pair { |element_name, locator| list(element_name, locator) } end |
.menu(element_name, locator) ⇒ Object
Declare and instantiate a single menu UI Element for this ScreenSection object.
346 347 348 |
# File 'lib/testcentricity_apps/app_core/screen_section.rb', line 346 def self.(element_name, locator) define_section_element(element_name, TestCentricity::AppElements::AppMenu, locator) end |
.menus(element_hash) ⇒ Object
Declare and instantiate a collection of menus for this ScreenSection object.
357 358 359 |
# File 'lib/testcentricity_apps/app_core/screen_section.rb', line 357 def self.(element_hash) element_hash.each_pair { |element_name, locator| (element_name, locator) } end |
.radio(element_name, locator) ⇒ Object
Declare and instantiate a single radio button UI Element for this screen section object.
214 215 216 |
# File 'lib/testcentricity_apps/app_core/screen_section.rb', line 214 def self.radio(element_name, locator) define_section_element(element_name, TestCentricity::AppElements::AppRadio, locator) end |
.radios(element_hash) ⇒ Object
Declare and instantiate a collection of radio buttons for this screen section object.
225 226 227 |
# File 'lib/testcentricity_apps/app_core/screen_section.rb', line 225 def self.radios(element_hash) element_hash.each_pair { |element_name, locator| radio(element_name, locator) } end |
.section(section_name, obj, locator = 0) ⇒ Object
Instantiate a single ScreenSection object within this ScreenSection object.
368 369 370 |
# File 'lib/testcentricity_apps/app_core/screen_section.rb', line 368 def self.section(section_name, obj, locator = 0) define_section_element(section_name, obj, locator) end |
.sections(section_hash) ⇒ Object
Declare and instantiate a collection of ScreenSection objects for this ScreenSection object.
379 380 381 |
# File 'lib/testcentricity_apps/app_core/screen_section.rb', line 379 def self.sections(section_hash) section_hash.each_pair { |section_name, class_name| section(section_name, class_name) } end |
.selectlist(element_name, locator) ⇒ Object
Declare and instantiate a single selectlist UI Element for this screen section object.
280 281 282 |
# File 'lib/testcentricity_apps/app_core/screen_section.rb', line 280 def self.selectlist(element_name, locator) define_section_element(element_name, TestCentricity::AppElements::AppSelectList, locator) end |
.selectlists(element_hash) ⇒ Object
Declare and instantiate a collection of selectlists for this screen section object.
291 292 293 |
# File 'lib/testcentricity_apps/app_core/screen_section.rb', line 291 def self.selectlists(element_hash) element_hash.each_pair { |element_name, locator| selectlist(element_name, locator) } end |
.switch(element_name, locator) ⇒ Object
Declare and instantiate a single switch UI Element for this screen section object.
170 171 172 |
# File 'lib/testcentricity_apps/app_core/screen_section.rb', line 170 def self.switch(element_name, locator) define_section_element(element_name, TestCentricity::AppElements::AppSwitch, locator) end |
.switches(element_hash) ⇒ Object
Declare and instantiate a collection of switches for this screen section object.
181 182 183 |
# File 'lib/testcentricity_apps/app_core/screen_section.rb', line 181 def self.switches(element_hash) element_hash.each_pair { |element_name, locator| switch(element_name, locator) } end |
.table(element_name, locator) ⇒ Object
Declare and instantiate a single table UI Element for this screen section object.
302 303 304 |
# File 'lib/testcentricity_apps/app_core/screen_section.rb', line 302 def self.table(element_name, locator) define_section_element(element_name, TestCentricity::AppElements::AppTable, locator) end |
.tables(element_hash) ⇒ Object
Declare and instantiate a collection of tables for this screen section object.
313 314 315 |
# File 'lib/testcentricity_apps/app_core/screen_section.rb', line 313 def self.tables(element_hash) element_hash.each_pair { |element_name, locator| table(element_name, locator) } end |
.textfield(element_name, locator) ⇒ Object
Declare and instantiate a single textfield UI Element for this screen section object.
148 149 150 |
# File 'lib/testcentricity_apps/app_core/screen_section.rb', line 148 def self.textfield(element_name, locator) define_section_element(element_name, TestCentricity::AppElements::AppTextField, locator) end |
.textfields(element_hash) ⇒ Object
Declare and instantiate a collection of textfields for this screen section object.
159 160 161 |
# File 'lib/testcentricity_apps/app_core/screen_section.rb', line 159 def self.textfields(element_hash) element_hash.each_pair { |element_name, locator| textfield(element_name, locator) } end |
Instance Method Details
#click ⇒ Object
Click on a screen Section object
388 389 390 391 392 |
# File 'lib/testcentricity_apps/app_core/screen_section.rb', line 388 def click section = find_section section_not_found_exception(section) section.click end |
#disabled? ⇒ Boolean
Is screen Section object disabled (not enabled)?
509 510 511 |
# File 'lib/testcentricity_apps/app_core/screen_section.rb', line 509 def disabled? !enabled? end |
#double_tap ⇒ Object
Double-tap on a screen Section object
413 414 415 416 417 418 419 420 421 422 423 |
# File 'lib/testcentricity_apps/app_core/screen_section.rb', line 413 def double_tap section = find_section section_not_found_exception(section) driver.action .click_and_hold(section) .release .pause(duration: 0.2) .click_and_hold(section) .release .perform end |
#enabled? ⇒ Boolean
Is screen Section object enabled?
497 498 499 500 501 |
# File 'lib/testcentricity_apps/app_core/screen_section.rb', line 497 def enabled? section = find_section section_not_found_exception(section) section.enabled? end |
#exists? ⇒ Boolean
Does screen Section object exists?
486 487 488 489 |
# File 'lib/testcentricity_apps/app_core/screen_section.rb', line 486 def exists? section = find_section section != nil end |
#get_item_count ⇒ Object
56 57 58 59 60 |
# File 'lib/testcentricity_apps/app_core/screen_section.rb', line 56 def get_item_count raise 'No parent list defined' if @parent_list.nil? @parent_list.get_item_count end |
#get_list_items ⇒ Object
62 63 64 65 66 67 68 69 70 71 72 73 74 |
# File 'lib/testcentricity_apps/app_core/screen_section.rb', line 62 def get_list_items items = [] (1..get_item_count).each do |item| set_list_index(nil, item) begin items.push(get_value) rescue scroll_into_view(@parent_list.scroll_mode) items.push(get_value) end end items end |
#get_locator ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/testcentricity_apps/app_core/screen_section.rb', line 19 def get_locator my_locator = if @locator.zero? && defined?(section_locator) section_locator else @locator end locators = [] if @context == :section && !@parent.nil? locators = @parent.get_locator end if @parent_list.nil? locators.push(my_locator) else locators.push(@parent_list.get_locator) if @list_index.nil? locators.push(my_locator) else item_objects = @parent_list.item_refs if item_objects.nil? list_key = my_locator.keys[0] list_value = "#{my_locator.values[0]}[#{@list_index}]" else list_key = :object list_value = item_objects[@list_index - 1] end locators.push( { list_key => list_value } ) end end locators end |
#get_name ⇒ Object
80 81 82 |
# File 'lib/testcentricity_apps/app_core/screen_section.rb', line 80 def get_name @name end |
#get_object_type ⇒ Object
76 77 78 |
# File 'lib/testcentricity_apps/app_core/screen_section.rb', line 76 def get_object_type :section end |
#height ⇒ Integer
Return height of screen Section object.
650 651 652 653 654 |
# File 'lib/testcentricity_apps/app_core/screen_section.rb', line 650 def height section = find_section section_not_found_exception(section) section.size.height end |
#hidden? ⇒ Boolean
Is screen Section object hidden (not visible)?
532 533 534 |
# File 'lib/testcentricity_apps/app_core/screen_section.rb', line 532 def hidden? !visible? end |
#identifier ⇒ Object
536 537 538 539 540 541 542 |
# File 'lib/testcentricity_apps/app_core/screen_section.rb', line 536 def identifier raise 'identifier is not a supported attribute' unless Environ.is_macos? section = find_section section_not_found_exception(section) section.identifier end |
#long_press(duration = 1) ⇒ Object
Long press on a screen Section object
431 432 433 434 435 436 437 438 439 |
# File 'lib/testcentricity_apps/app_core/screen_section.rb', line 431 def long_press(duration = 1) section = find_section section_not_found_exception(section) driver.action .click_and_hold(section) .pause(duration: duration) .release .perform end |
#scroll_into_view(scroll_mode = :vertical) ⇒ Object
Scroll the screen Section object until it is visible. If scroll_mode is not specified, then vertical scrolling will be used.
448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 |
# File 'lib/testcentricity_apps/app_core/screen_section.rb', line 448 def scroll_into_view(scroll_mode = :vertical) return if visible? obj = element object_not_found_exception(obj) driver.action.move_to(obj).perform case scroll_mode when :vertical start_direction = :down end_direction = :up when :horizontal start_direction = :right end_direction = :left else raise "#{scroll_mode} is not a valid selector" end try_count = 8 direction = start_direction while hidden? swipe_gesture(direction, distance = 0.2) try_count -= 1 if try_count.zero? break if direction == end_direction direction = end_direction try_count = 8 end end end |
#send_keys(value) ⇒ Object
Send keystrokes to this section object.
550 551 552 553 554 |
# File 'lib/testcentricity_apps/app_core/screen_section.rb', line 550 def send_keys(value) section = find_section section_not_found_exception(section) section.send_keys(value) end |
#set_list_index(list, index = 1) ⇒ Object
51 52 53 54 |
# File 'lib/testcentricity_apps/app_core/screen_section.rb', line 51 def set_list_index(list, index = 1) @parent_list = list unless list.nil? @list_index = index end |
#set_parent(parent) ⇒ Object
84 85 86 |
# File 'lib/testcentricity_apps/app_core/screen_section.rb', line 84 def set_parent(parent) @parent = parent end |
#tap ⇒ Object
Tap on a screen Section object
399 400 401 402 403 404 405 406 |
# File 'lib/testcentricity_apps/app_core/screen_section.rb', line 399 def tap section = find_section section_not_found_exception(section) driver.action .click_and_hold(section) .release .perform end |
#visible? ⇒ Boolean
Is screen Section object visible?
519 520 521 522 523 524 |
# File 'lib/testcentricity_apps/app_core/screen_section.rb', line 519 def visible? section = find_section return false if section.nil? section.displayed? end |
#wait_until_exists(seconds = nil, post_exception = true) ⇒ Object
Wait until the screen Section object exists, or until the specified wait time has expired. If the wait time is nil, then the wait time will be Environ.default_max_wait_time.
563 564 565 566 567 568 569 570 571 572 573 |
# File 'lib/testcentricity_apps/app_core/screen_section.rb', line 563 def wait_until_exists(seconds = nil, post_exception = true) timeout = seconds.nil? ? Environ.default_max_wait_time : seconds wait = Selenium::WebDriver::Wait.new(timeout: timeout) wait.until { exists? } rescue if post_exception raise "Could not find Section object '#{get_name}' (#{get_locator}) after #{timeout} seconds" unless exists? else exists? end end |
#wait_until_gone(seconds = nil, post_exception = true) ⇒ Object
Wait until the screen Section object no longer exists, or until the specified wait time has expired. If the wait time is nil, then the wait time will be Environ.default_max_wait_time.
582 583 584 585 586 587 588 589 590 591 592 |
# File 'lib/testcentricity_apps/app_core/screen_section.rb', line 582 def wait_until_gone(seconds = nil, post_exception = true) timeout = seconds.nil? ? Environ.default_max_wait_time : seconds wait = Selenium::WebDriver::Wait.new(timeout: timeout) wait.until { !exists? } rescue if post_exception raise "Section object '#{get_name}' (#{get_locator}) remained visible after #{timeout} seconds" if exists? else exists? end end |
#wait_until_hidden(seconds = nil, post_exception = true) ⇒ Object
Wait until the screen Section object is hidden, or until the specified wait time has expired. If the wait time is nil, then the wait time will be Environ.default_max_wait_time.
620 621 622 623 624 625 626 627 628 629 630 |
# File 'lib/testcentricity_apps/app_core/screen_section.rb', line 620 def wait_until_hidden(seconds = nil, post_exception = true) timeout = seconds.nil? ? Environ.default_max_wait_time : seconds wait = Selenium::WebDriver::Wait.new(timeout: timeout) wait.until { hidden? } rescue if post_exception raise "Section object '#{get_name}' (#{get_locator}) remained visible after #{timeout} seconds" if visible? else visible? end end |
#wait_until_visible(seconds = nil, post_exception = true) ⇒ Object
Wait until the screen Section object is visible, or until the specified wait time has expired. If the wait time is nil, then the wait time will be Environ.default_max_wait_time.
601 602 603 604 605 606 607 608 609 610 611 |
# File 'lib/testcentricity_apps/app_core/screen_section.rb', line 601 def wait_until_visible(seconds = nil, post_exception = true) timeout = seconds.nil? ? Environ.default_max_wait_time : seconds wait = Selenium::WebDriver::Wait.new(timeout: timeout) wait.until { visible? } rescue if post_exception raise "Could not find Section object '#{get_name}' (#{get_locator}) after #{timeout} seconds" unless visible? else visible? end end |
#width ⇒ Integer
Return width of screen Section object.
638 639 640 641 642 |
# File 'lib/testcentricity_apps/app_core/screen_section.rb', line 638 def width section = find_section section_not_found_exception(section) section.size.width end |
#x_loc ⇒ Integer
Return x coordinate of screen Section object's location.
662 663 664 665 666 |
# File 'lib/testcentricity_apps/app_core/screen_section.rb', line 662 def x_loc section = find_section section_not_found_exception(section) section.location.x end |
#y_loc ⇒ Integer
Return y coordinate of screen Section object's location.
674 675 676 677 678 |
# File 'lib/testcentricity_apps/app_core/screen_section.rb', line 674 def y_loc section = find_section section_not_found_exception(section) section.location.y end |