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
jax-3.0.0.rc1 features/support/selectors.rb
casecumber-rails-1.0.2.1 lib/generators/cucumber/install/templates/support/selectors.rb
data_active-0.0.4 features/support/selectors.rb
jax-2.0.11 features/support/selectors.rb
data_active-0.0.3 features/support/selectors.rb
data_active-0.0.2 features/support/selectors.rb
data_active-0.0.1 features/support/selectors.rb
acts_as_multipart_form-0.0.15 spec/dummy/features/support/selectors.rb
editorial_logic-1.4.5 features/support/selectors.rb
acts_as_multipart_form-0.0.14 spec/dummy/features/support/selectors.rb
jax-2.0.10 features/support/selectors.rb
trackable_tasks-0.1.0 spec/dummy/features/support/selectors.rb
acts_as_multipart_form-0.0.13 spec/dummy/features/support/selectors.rb
jax-2.0.9 features/support/selectors.rb
jax-2.0.8 features/support/selectors.rb
trackable_tasks-0.0.13 spec/dummy/features/support/selectors.rb
trackable_tasks-0.0.12 spec/dummy/features/support/selectors.rb
trackable_tasks-0.0.11 spec/dummy/features/support/selectors.rb
trackable_tasks-0.0.10 spec/dummy/features/support/selectors.rb
trackable_tasks-0.0.9 spec/dummy/features/support/selectors.rb