Sha256: fe38c323d6aae59c4c5f720ef095df94ef2cc3d4a726d8ea959f2a32af5b74d1
Contents?: true
Size: 1.57 KB
Versions: 5
Compression:
Stored size: 1.57 KB
Contents
module Howitzer module Meta # This class represents element entity within howitzer meta information interface class Element attr_reader :name, :context include Howitzer::Meta::Actions # Creates new meta element with meta information and utility actions # @param name [String] name of the element # @param context [Howitzer::Web::Page] page element belongs to def initialize(name, context) @name = name @context = context end # Finds all instances of element on the page and returns them as array of capybara elements # @param args [Array] arguments for elements described with lambda locators # @param options [Hash] original Capybara options. For details, see `Capybara::Node::Finders#all` # @return [Array] def capybara_elements(*args, **options) if options.present? context.send("#{name}_elements", *args, **options) else context.send("#{name}_elements", *args) end end # Finds element on the page and returns as a capybara element # @param args [Array] arguments for elements described with lambda locators # @param options [Hash] original Capybara options. For details, see `Capybara::Node::Finders#all` # @param wait [Integer] wait time for element search # @return [Capybara::Node::Element, nil] def capybara_element(*args, wait: 0, **options) context.send("#{name}_element", *args, **options.merge(match: :first, wait: wait)) rescue Capybara::ElementNotFound nil end end end end
Version data entries
5 entries across 5 versions & 1 rubygems