Sha256: 7b5d7379d2849fe1a1da944d7e2b42799f3baf653b253c0ed414dc0dd7b71f17

Contents?: true

Size: 686 Bytes

Versions: 2

Compression:

Stored size: 686 Bytes

Contents

module Prickle
  module Capybara
    module Actions

      def click
        find_element.click
      end

      def contains_text? text
        @text = text
        @identifier[:"text()".like] = text
        find_element
      end

      def has_text? text
        @text = text
        @identifier[:"text()"] = text
        find_element
      end

      def exists?
        find_element
      end

      private

      ALIASES = { "find" => :exists? }

      def self.for properties
        element = Element::extract_method_missing properties
        method = ALIASES[element[:method]] || element[:method].to_sym
        [ method, element[:args] ].compact
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
prickle-0.1.0 lib/prickle/capybara/actions.rb
prickle-0.0.6 lib/prickle/capybara/actions.rb