Module: Bermuda::XPath
Instance Method Summary collapse
- #accordion_content(title = nil, options = {}) ⇒ Object
- #accordion_header(title = nil, options = {}) ⇒ Object
- #autocompletion(text = nil) ⇒ Object
- #dialog(title = nil) ⇒ Object
- #progressbar(options = {}) ⇒ Object
- #tab_content(title = nil, options = {}) ⇒ Object
- #tab_header(title = nil, options = {}) ⇒ Object
Instance Method Details
#accordion_content(title = nil, options = {}) ⇒ Object
36 37 38 |
# File 'lib/bermuda/xpath.rb', line 36 def accordion_content(title = nil, = {}) accordion_header(title, ).next_sibling end |
#accordion_header(title = nil, options = {}) ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/bermuda/xpath.rb', line 23 def accordion_header(title = nil, = {}) xpath = descendant[attr(:class).includes('ui-accordion-header')] if .key?(:active) state = attr(:class).includes('ui-state-active') state = ~state unless [:active] xpath = xpath[state] end xpath = xpath[descendant(:a).text.is title] if title xpath end |
#autocompletion(text = nil) ⇒ Object
40 41 42 43 44 45 |
# File 'lib/bermuda/xpath.rb', line 40 def autocompletion(text = nil) xpath = descendant[attr(:class).includes('ui-autocomplete')] xpath = xpath.descendant[attr(:class).includes('ui-menu-item')] xpath = xpath[descendant(:a).text.is text] if text xpath end |
#dialog(title = nil) ⇒ Object
47 48 49 50 51 |
# File 'lib/bermuda/xpath.rb', line 47 def dialog(title = nil) xpath = descendant[attr(:class).includes('ui-dialog')] xpath = xpath[descendant[attr(:class).includes('ui-dialog-title')].text.is title] if title xpath end |
#progressbar(options = {}) ⇒ Object
53 54 55 56 57 |
# File 'lib/bermuda/xpath.rb', line 53 def ( = {}) xpath = descendant[attr(:class).includes('ui-progressbar')] xpath = xpath[attr(:'aria-valuenow') == [:value]] if [:value] xpath end |
#tab_content(title = nil, options = {}) ⇒ Object
72 73 74 |
# File 'lib/bermuda/xpath.rb', line 72 def tab_content(title = nil, = {}) descendant[Expression::Literal.new("concat('#', @id)") == anywhere(tab_header(title, )).descendant(:a).attr(:href)] end |
#tab_header(title = nil, options = {}) ⇒ Object
59 60 61 62 63 64 65 66 67 68 69 70 |
# File 'lib/bermuda/xpath.rb', line 59 def tab_header(title = nil, = {}) xpath = descendant[attr(:class).includes('ui-tabs-nav')].child if .key?(:active) state = attr(:class).includes('ui-state-active') state = ~state unless [:active] xpath = xpath[state] end xpath = xpath[descendant(:a).text.is title] if title xpath end |