Sha256: e1fd049c56fe98c6307420a61fa6f3ad008bd2db62e033012e2ce1f0c91b4a6f

Contents?: true

Size: 931 Bytes

Versions: 114

Compression:

Stored size: 931 Bytes

Contents

module HtmlSelectorsHelpers
  # Maps a name to a selector. Used primarily by the
  #
  #   When /^(.+) within (.+)$/ do |step, scope|
  #
  # step definitions in web_steps.rb
  #
  def selector_for(locator)
    case locator

    when "the page"
      "html > body"

    # Add more mappings here.
    # Here is an example that pulls values out of the Regexp:
    #
    #  when /^the (notice|error|info) flash$/
    #    ".flash.#{$1}"

    # You can also return an array to use a different selector
    # type, like:
    #
    #  when /the header/
    #    [:xpath, "//header"]

    # This allows you to provide a quoted selector as the scope
    # for "within" steps as was previously the default for the
    # web steps:
    when /^"(.+)"$/
      $1

    else
      raise "Can't find mapping from \"#{locator}\" to a selector.\n" +
        "Now, go and add a mapping in #{__FILE__}"
    end
  end
end

World(HtmlSelectorsHelpers)

Version data entries

114 entries across 114 versions & 20 rubygems

Version Path
affectiva-surveyor-1.5.0.pre.disco.2 features/support/selectors.rb
acts_as_multipart_form-0.0.16 spec/dummy/features/support/selectors.rb
trackable_tasks-0.1.3 spec/dummy/features/support/selectors.rb
trackable_tasks-0.1.2 spec/dummy/features/support/selectors.rb
hssc_surveyor-1.4.3.pre features/support/selectors.rb
hssc_surveyor-1.4.2.pre features/support/selectors.rb
hssc_surveyor-1.4.1.pre features/support/selectors.rb
surveyor-1.4.0 features/support/selectors.rb
data_active-0.0.7 features/support/selectors.rb
data_active-0.0.6 features/support/selectors.rb
data_active-0.0.5 features/support/selectors.rb
surveyor-1.3.0 features/support/selectors.rb
socialite-0.1.0.pre features/support/selectors.rb
surveyor-1.2.0 features/support/selectors.rb
surveyor-1.1.0 features/support/selectors.rb
surveyor-1.0.1 features/support/selectors.rb
jax-3.0.0.rc2 features/support/selectors.rb
jax-2.0.12 features/support/selectors.rb
surveyor-1.0.0 features/support/selectors.rb
trackable_tasks-0.1.1 spec/dummy/features/support/selectors.rb