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-2.0.7 features/support/selectors.rb
jax-2.0.6 features/support/selectors.rb
bootstrap_devise_base-0.0.1 features/support/selectors.rb
jax-2.0.5 features/support/selectors.rb
editorial_logic-1.4.4 features/support/selectors.rb
jax-2.0.4 features/support/selectors.rb
jax-2.0.3 features/support/selectors.rb
surveyor-0.21.0 features/support/selectors.rb
trackable_tasks-0.0.4 spec/dummy/features/support/selectors.rb
jax-2.0.2 features/support/selectors.rb
jax-2.0.1 features/support/selectors.rb
jax-2.0.0 features/support/selectors.rb
editorial_logic-1.4.3 features/support/selectors.rb
editorial_logic-1.4.2 features/support/selectors.rb
cloudspace_chat_service-0.0.1 spec/dummy/features/support/selectors.rb
saphira-0.1.1.beta1 test/dummy/features/support/selectors.rb
editorial_logic-1.4.1 features/support/selectors.rb
editorial_logic-1.4.0 features/support/selectors.rb
socialite-0.0.1.beta4 features/support/selectors.rb
socialite-0.0.1.beta2 features/support/selectors.rb