Class: OperaWatir::QuickTab

Inherits:
QuickButton show all
Defined in:
lib/operawatir/quickwidgets/quick_tab.rb

Constant Summary

Constants inherited from QuickWidget

OperaWatir::QuickWidget::ConditionTimeout

Instance Method Summary collapse

Methods inherited from QuickButton

#change_page_with_click, #close_toolbar_with_click, #close_window_with_click, #default?, #expand_with_click, #toggle_with_click, #value, #wait_for_enabled, #wait_for_visible

Methods included from ClickableItem

#close_menu_with_click, #load_page_with_click, #open_menu_with_click, #open_window_with_click

Methods inherited from QuickWidget

#click_with_condition, #double_click_with_condition, #enabled?, #exist?, #focus_with_click, #focus_with_hover, #has_ui_string?, #height, #middle_click_with_condition, #name, #open_menu_with_rightclick, #open_window_with_hover, #parent_name, #position, #quick_tabs, #quick_widgets, #right_click_with_condition, #text, #to_s, #type, #value, #verify_includes_text, #verify_text, #visible?, #widget_info_string, #width

Methods included from DesktopContainer

#quick_addressfield, #quick_button, #quick_checkbox, #quick_dialogtab, #quick_dropdown, #quick_dropdownitem, #quick_editfield, #quick_find, #quick_griditem, #quick_gridlayout, #quick_label, #quick_menu, #quick_menuitem, #quick_radiobutton, #quick_searchfield, #quick_tab, #quick_thumbnail, #quick_toolbar, #quick_treeitem, #quick_treeview, #quick_window

Instance Method Details

#activate_tab_with_clickint

Clicks the tab button, and waits for the tab to be shown / switches to the page

Parameters:

  • win_name (String)

    name of the window that will be opened (Pass a blank string for any window)

Returns:

  • (int)

    Window ID of the window activated, 0 if the window is already the active one, or if no window is active

Raises:



58
59
60
61
62
# File 'lib/operawatir/quickwidgets/quick_tab.rb', line 58

def activate_tab_with_click
  wait_start
  click
  wait_for_window_activated("Document Window")
end

#close_window_with_doubleclickint

Double clicks the tab and waits for it to be closed

Returns:

  • (int)

    Window ID of the window that was closed



69
70
71
72
73
# File 'lib/operawatir/quickwidgets/quick_tab.rb', line 69

def close_window_with_doubleclick
  wait_start
  click(:left, 2)
  wait_for_window_close("Document Window")
end

#group_with_drag(tab_target) ⇒ int

Drag and drop this tab on another tab to add it to its tab group

Parameters:

  • tab (QuickTab)

    (group) button to drop this tab on

Returns:

  • (int)

    the number of tabs in this tab group, or 1 if this is not a tab group button, in which case it represents only 1 tab, itself

Raises:



33
34
35
36
37
38
39
40
41
42
43
# File 'lib/operawatir/quickwidgets/quick_tab.rb', line 33

def group_with_drag(tab_target)
  raise(Exceptions::UnknownObjectException) unless tab_target.type == :tabbutton

  # Drop on the edge of a tab to make the grouping work
  drag_and_drop_on(tab_target, :edge)

  sleep(0.1)

  #Get the  number of tabs in the group
  element(true).value
end

#move_with_drag(tab_target) ⇒ Object

Drag and drop this tab on tab tab_target

Parameters:

  • tab (QuickTab)

    button to drop this tab on

Raises:



17
18
19
20
21
22
# File 'lib/operawatir/quickwidgets/quick_tab.rb', line 17

def move_with_drag(tab_target)
  raise(Exceptions::UnknownObjectException) unless tab_target.type == :tabbutton
  drag_and_drop_on(tab_target, :center)

  sleep(0.1)
end