Module: SeleniumRecord::Theme

Included in:
Base
Defined in:
lib/selenium_record/theme.rb

Overview

Helpers specific for the bootstrap theme

Instance Method Summary collapse

Instance Method Details

Returns xpath for the select option that matches the text

Parameters:

  • key (String)

    text of select option



31
32
33
# File 'lib/selenium_record/theme.rb', line 31

def dropdown_menu_xpath(text)
  ".//ul[@class='dropdown-menu']/li[contains(.,'#{text}')]/a"
end

Returns xpath for the dropdown button that matches the text

Parameters:

  • key (String)

    text of dropdown button



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


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

Parameters:

  • id (String)

    of the select



15
16
17
# File 'lib/selenium_record/theme.rb', line 15

def select_xpath(id)
  ".//div[@id='#{id}_chosen']/a"
end