Sha256: 1e0e294f47437e2c8bdbc6a62ab966abebe930eb567a1b0d0ede795b08ebb505

Contents?: true

Size: 728 Bytes

Versions: 17

Compression:

Stored size: 728 Bytes

Contents

module Webdrone
  class Browser
    def clic
      @clic ||= Clic.new self
    end
  end

  class Clic
    attr_accessor :a0

    def initialize(a0)
      @a0 = a0
    end

    def clic(text, n: 1, all: false, visible: true)
      item = @a0.find.send __callee__, text, n: n, all: all, visible: visible
      if item.is_a? Array
        item.each(&:click)
      else
        item.click
      end
    rescue => exception
      Webdrone.report_error(@a0, exception)
    end

    alias_method :id,     :clic
    alias_method :css,    :clic
    alias_method :link,   :clic
    alias_method :button, :clic
    alias_method :on,     :clic
    alias_method :option, :clic
    alias_method :xpath,  :clic

    protected :clic
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
webdrone-1.5.0 lib/webdrone/clic.rb
webdrone-1.4.8 lib/webdrone/clic.rb
webdrone-1.4.6 lib/webdrone/clic.rb
webdrone-1.4.4 lib/webdrone/clic.rb
webdrone-1.4.2 lib/webdrone/clic.rb
webdrone-1.4.0 lib/webdrone/clic.rb
webdrone-1.3.6 lib/webdrone/clic.rb
webdrone-1.3.4 lib/webdrone/clic.rb
webdrone-1.3.2 lib/webdrone/clic.rb
webdrone-1.3.0 lib/webdrone/clic.rb
webdrone-1.2.2 lib/webdrone/clic.rb
webdrone-1.2.0 lib/webdrone/clic.rb
webdrone-1.1.4 lib/webdrone/clic.rb
webdrone-1.1.2 lib/webdrone/clic.rb
webdrone-1.1.0 lib/webdrone/clic.rb
webdrone-1.0.8 lib/webdrone/clic.rb
webdrone-1.0.6 lib/webdrone/clic.rb