Sha256: 980160d8f53022e3f8c645f50dba3e54e89c1c27a57dc2eb15bc34d95b52e6fe

Contents?: true

Size: 1.15 KB

Versions: 18

Compression:

Stored size: 1.15 KB

Contents

module TrueAutomation
  ##
  #
  # TrueAutomation::Helpers class provides helper method to use
  # TrueAutomation.IO Smart Locators instead of Selenium or Capybara locators.
  #
  # To record an element for the first time use ta(ta_name, initial_locator) syntax.
  #
  #  *ta_name*         is TrueAutomation Element name. We recommend to use
  #                    namespaced syntax. E.g. _pageName:widgetName:elementName_
  #  *initial_locator* is Selenium/Capybara locator to use to find element
  #                    for the first time. If you change initial locator in your
  #                    code, TrueAutomation element record will be rewritten
  #                    during next test run.
  # For example:
  #
  #  find(:xpath, ta('true:automation:name', '//initialXpathLocator'))
  #  find(:css, ta('true:automation:name', '.initialCSSSelector'))
  #  click(ta('true:automation:name', 'Login'))
  #
  class Helpers

    ##
    #
    # @return [String] TrueAutomation.IO locator
    #
    def self.ta(name, locator = '')
      if !locator.empty?
        "#{locator}__ta__#{name}__ta__"
      else
        "__taonly__#{name}__taonly__"
      end
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
true_automation-0.6.1 lib/true_automation/helpers.rb
true_automation-0.6.0 lib/true_automation/helpers.rb
true_automation-0.5.9 lib/true_automation/helpers.rb
true_automation-0.5.6 lib/true_automation/helpers.rb
true_automation-0.5.5 lib/true_automation/helpers.rb
true_automation-0.5.4 lib/true_automation/helpers.rb
true_automation-0.4.0 lib/true_automation/helpers.rb
true_automation-0.3.31 lib/true_automation/helpers.rb
true_automation-0.3.22 lib/true_automation/helpers.rb
true_automation-0.3.18 lib/true_automation/helpers.rb
true_automation-0.3.16 lib/true_automation/helpers.rb
true_automation-0.3.14 lib/true_automation/helpers.rb
true_automation-0.3.13 lib/true_automation/helpers.rb
true_automation-0.3.10 lib/true_automation/helpers.rb
true_automation-0.3.9 lib/true_automation/helpers.rb
true_automation-0.3.6 lib/true_automation/helpers.rb
true_automation-0.3.5 lib/true_automation/helpers.rb
true_automation-0.3.4 lib/true_automation/helpers.rb