Sha256: 783970f2c3cdcf87105e50b27ac6d6546754da514706d818e8735616422a809d

Contents?: true

Size: 1.16 KB

Versions: 5

Compression:

Stored size: 1.16 KB

Contents

module SeleniumRecord
  # Helpers specific for the bootstrap theme
  module Theme
    def modal_header_xpath(key)
      "//div[@class='modal-header']/h3[text()='#{trans(key)}')]"
    end

    def find_headline(text)
      xpath = "//div[contains(@class,'headline')]//div[contains(.,'#{text}')]"
      find(:xpath, xpath)
    end

    # Returns xpath for select decorated with chosen.jquery.js
    # @param [String] id of the select
    def select_xpath(id)
      ".//div[@id='#{id}_chosen']/a"
    end

    def select_option_xpath(id, text)
      ".//div[@id='#{id}_chosen']//li[text()='#{text}']"
    end

    # Returns xpath for the dropdown button that matches the text
    # @param key [String] text of dropdown button
    def dropdown_xpath(text)
      ".//button[contains(.,'#{text}')]"
    end

    # Returns xpath for the select option that matches the text
    # @param key [String] text of select option
    def dropdown_menu_xpath(text)
      ".//ul[@class='dropdown-menu']/li[contains(.,'#{text}')]/a"
    end

    def section_xpath(text)
      ".//section//div[@class='panel-header']
       /h3[@class='suspended area-name']/strong/a[contains(.,'#{text}')]"
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
seleniumrecord-0.0.4 lib/selenium_record/theme.rb
seleniumrecord-0.0.3 lib/selenium_record/theme.rb
seleniumrecord-0.0.2.revision lib/selenium_record/theme.rb
seleniumrecord-0.0.2 lib/selenium_record/theme.rb
seleniumrecord-0.0.1.beta1 lib/selenium_record/theme.rb