Sha256: 333becfbd85ebf0c179fce0779ebd7154a486b76460f624e42b6a23a8cde64aa

Contents?: true

Size: 1.25 KB

Versions: 37

Compression:

Stored size: 1.25 KB

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'

    when 'the main form'
      'form.formtastic'

    when 'the main content'
      '#content'

    when 'the dialog popup'
      '.content-entry-popup'

    when 'the list of entries'
      'li.input.relationship'

    when 'the role'
      '.role'

    when 'the submit button'
      'form.formtastic #local-actions-bottom-bar input[type=submit]'

    # 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

37 entries across 37 versions & 2 rubygems

Version Path
locomotivecms-3.0.0.rc3 features/support/selectors.rb
locomotivecms-3.0.0.rc2 features/support/selectors.rb
locomotivecms-3.0.0.rc1 features/support/selectors.rb
locomotivecms-3.0.0.pre.beta.1 features/support/selectors.rb
locomotivecms-3.0.0.pre.alpha.3 features/support/selectors.rb
locomotive_cms-2.5.7 features/support/selectors.rb
locomotivecms-3.0.0.pre.alpha.2 features/support/selectors.rb
locomotivecms-3.0.0.pre.alpha features/support/selectors.rb
locomotive_cms-2.5.6 features/support/selectors.rb
locomotive_cms-2.5.6.rc2 features/support/selectors.rb
locomotive_cms-2.5.6.rc1 features/support/selectors.rb
locomotive_cms-2.5.5 features/support/selectors.rb
locomotive_cms-2.5.4 features/support/selectors.rb
locomotive_cms-2.5.3 features/support/selectors.rb
locomotive_cms-2.5.2 features/support/selectors.rb
locomotive_cms-2.5.1 features/support/selectors.rb
locomotive_cms-2.5.0 features/support/selectors.rb
locomotive_cms-2.5.0.rc3 features/support/selectors.rb
locomotive_cms-2.5.0.rc2 features/support/selectors.rb
locomotive_cms-2.5.0.rc1 features/support/selectors.rb