Sha256: 4103a8bb0aaea222618bbae53677e902a72fea665ac9071d5d31f0ce899f8730
Contents?: true
Size: 1.16 KB
Versions: 1
Compression:
Stored size: 1.16 KB
Contents
require_relative 'find' require_relative 'click' require_relative 'match' require_relative 'exceptions' module Prickle module Capybara class Element require 'capybara/dsl' include ::Capybara::DSL def initialize type="*", identifier @identifier = identifier @type = type self end def handle_exception &block begin block.call rescue Exception => e raise ElementNotFound, Error.new(@type, @identifier, @text, e).message if e.class.to_s == "Capybara::ElementNotFound" raise end end def identifier return @identifier.each_pair.to_a.map do |key, value| "@#{key}='#{value}'" end.join ' and ' end def find_element_by xpath wait_until(Prickle::Capybara.wait_time) do find(:xpath, xpath).visible? end unless Prickle::Capybara.wait_time.nil? find(:xpath, xpath) end def type_of element Prickle::TAGS[element.to_sym] || element end include Prickle::Actions::Find include Prickle::Actions::Match include Prickle::Actions::Click end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
prickle-0.0.2 | lib/prickle/capybara/element.rb |