Sha256: 3eb19a5ce98d58ab3597beed75e9b739d55c911af0123a01e6575bcd657b8d3d

Contents?: true

Size: 1.54 KB

Versions: 24

Compression:

Stored size: 1.54 KB

Contents

module RSpectacular
  def self.selectors
    default_selectors
  end

  def self.default_selectors
    {
      /the Facebook application/ => lambda do
        frame_element = find 'html#facebook div#pagelet_app_runner iframe'
        frame_element[:id]
      end,

      /the flash(.*)/ => lambda do |*args|
        flash_type       = args[0][/the flash(.*)/, 1]
        flash_type_class = flash_type.strip
        flash_type_class = flash_type_class.empty? ? '' : ".#{flash_type_class}"

        ".flash#{flash_type_class} p"
      end,

      ###
      # Facebook
      #
      /the Facebook login form/             => 'html#facebook form#login_form',
      /the Facebook page timeline nav bar/  => 'html#facebook #fbTimelineNavTopRow',
      /the Facebook account menu/           => '#navAccountLink',

      ###
      # PayPal
      #
      /the "Pay with PayPal" button/        => 'input[alt="Check out with PayPal"]',

      ###
      # Forms
      #
      /the errors for (.*)/                 => lambda { "#{sf $1}+div.error" },

      ###
      # Windows
      #
      /the most recently opened window/     => lambda { page.driver.browser.window_handles.last },
      /the alert dialog/                    => lambda { page.driver.browser.switch_to.alert },

      ###
      # Date Picker Buttons
      #
      /the date picker button for today/    => '.ui-datepicker-today',

      ###
      # Model Links
      #
      /the (.*) button for/                 => lambda { "##{$1.gsub(/ /, '_')}_#{args[0].class.name.underscore}_#{args[0].id}_link" }
    }
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
rspectacular-0.53.0 lib/rspectacular/selectors/defaults.rb
rspectacular-0.52.0 lib/rspectacular/selectors/defaults.rb
rspectacular-0.51.0 lib/rspectacular/selectors/defaults.rb
rspectacular-0.50.0 lib/rspectacular/selectors/defaults.rb
rspectacular-0.49.0 lib/rspectacular/selectors/defaults.rb
rspectacular-0.48.0 lib/rspectacular/selectors/defaults.rb
rspectacular-0.47.0 lib/rspectacular/selectors/defaults.rb
rspectacular-0.46.0 lib/rspectacular/selectors/defaults.rb
rspectacular-0.45.0 lib/rspectacular/selectors/defaults.rb
rspectacular-0.44.0 lib/rspectacular/selectors/defaults.rb
rspectacular-0.43.0 lib/rspectacular/selectors/defaults.rb
rspectacular-0.42.0 lib/rspectacular/selectors/defaults.rb
rspectacular-0.41.0 lib/rspectacular/selectors/defaults.rb
rspectacular-0.40.0 lib/rspectacular/selectors/defaults.rb
rspectacular-0.39.0 lib/rspectacular/selectors/defaults.rb
rspectacular-0.38.0 lib/rspectacular/selectors/defaults.rb
rspectacular-0.37.0 lib/rspectacular/selectors/defaults.rb
rspectacular-0.36.0 lib/rspectacular/selectors/defaults.rb
rspectacular-0.35.0 lib/rspectacular/selectors/defaults.rb
rspectacular-0.34.0 lib/rspectacular/selectors/defaults.rb