Module: SeleniumRecord::Theme
- Included in:
- Base
- Defined in:
- lib/selenium_record/theme.rb
Overview
Helpers specific for the bootstrap theme
Instance Method Summary collapse
-
#dropdown_menu_xpath(text) ⇒ Object
Returns xpath for the select option that matches the text.
-
#dropdown_xpath(text) ⇒ Object
Returns xpath for the dropdown button that matches the text.
- #find_headline(text) ⇒ Object
- #modal_header_xpath(key) ⇒ Object
- #section_xpath(text) ⇒ Object
- #select_option_xpath(id, text) ⇒ Object
-
#select_xpath(id) ⇒ Object
Returns xpath for select decorated with chosen.jquery.js.
Instance Method Details
#dropdown_menu_xpath(text) ⇒ Object
Returns xpath for the select option that matches the text
31 32 33 |
# File 'lib/selenium_record/theme.rb', line 31 def (text) ".//ul[@class='dropdown-menu']/li[contains(.,'#{text}')]/a" end |
#dropdown_xpath(text) ⇒ Object
Returns xpath for the dropdown button that matches the text
25 26 27 |
# File 'lib/selenium_record/theme.rb', line 25 def dropdown_xpath(text) ".//button[contains(.,'#{text}')]" end |
#find_headline(text) ⇒ Object
8 9 10 11 |
# File 'lib/selenium_record/theme.rb', line 8 def find_headline(text) xpath = "//div[contains(@class,'headline')]//div[contains(.,'#{text}')]" find(:xpath, xpath) end |
#modal_header_xpath(key) ⇒ Object
4 5 6 |
# File 'lib/selenium_record/theme.rb', line 4 def modal_header_xpath(key) "//div[@class='modal-header']/h3[text()='#{trans(key)}')]" end |
#section_xpath(text) ⇒ Object
35 36 37 38 |
# File 'lib/selenium_record/theme.rb', line 35 def section_xpath(text) ".//section//div[@class='panel-header'] /h3[@class='suspended area-name']/strong/a[contains(.,'#{text}')]" end |
#select_option_xpath(id, text) ⇒ Object
19 20 21 |
# File 'lib/selenium_record/theme.rb', line 19 def select_option_xpath(id, text) ".//div[@id='#{id}_chosen']//li[text()='#{text}']" end |
#select_xpath(id) ⇒ Object
Returns xpath for select decorated with chosen.jquery.js
15 16 17 |
# File 'lib/selenium_record/theme.rb', line 15 def select_xpath(id) ".//div[@id='#{id}_chosen']/a" end |