Class: JQueryUIWidgets::Tabs

Inherits:
PageObject::Elements::UnorderedList
  • Object
show all
Defined in:
lib/jqueryui_widgets/tabs.rb

Overview

Class that wraps the JQueryUI Tabs, allowing the user to interact with tabbed items.

NOTE: The Tabs Widget code will be kept as basic as possible for the time being, since the Widget itself is fully customizable, we cannot allow for all of the possible functionality. This will allow for users to customize the gem to suit their own needs for the widget.

Instance Method Summary collapse

Instance Method Details

#labelsObject

Labels method will return all of the link elements of the tabs, and return them for use.



46
47
48
# File 'lib/jqueryui_widgets/tabs.rb', line 46

def labels
  link_elements(:class => 'ui-tabs-anchor').map(&:text)
end

#select(label) ⇒ Object

Select method allows you to find the link element of the tab you want to use, then clicks it.

Examples:

select('Nunc tincidunt')
will click on the 'Nunc tincidunt'
tab, selecting it.

Parameters:

  • of (Label)

    the item you want to find.



28
29
30
# File 'lib/jqueryui_widgets/tabs.rb', line 28

def select(label)
  link_element(:text => label).click
end

#selectedObject

Selected method will check the list item, and the link_element of that list item, take the text, and return it.



37
38
39
# File 'lib/jqueryui_widgets/tabs.rb', line 37

def selected
  list_item_element(:class => 'ui-tabs-active').link_element.text
end