Sha256: 66a7b556349cdd1bb8cf5e6f3332ed3565a594f38b53d16f35318d6b554210fa
Contents?: true
Size: 1.34 KB
Versions: 3
Compression:
Stored size: 1.34 KB
Contents
module Webdrone class Browser def mark @mark ||= Mark.new self end end class Mark attr_accessor :a0 def initialize(a0) @a0 = a0 end def mark(text, n: 1, all: false, visible: true, color: '#af1616', times: 3, sleep: 0.05) item = @a0.find.send __callee__, text, n: n, all: all, visible: visible mark_item item, color: color, times: times, sleep: sleep rescue => exception Webdrone.report_error(@a0, exception, Kernel.caller_locations) end alias_method :id, :mark alias_method :css, :mark alias_method :link, :mark alias_method :button, :mark alias_method :on, :mark alias_method :option, :mark alias_method :xpath, :mark def mark_item(item, color: '#af1616', times: 3, sleep: 0.05) times.times do mark_item_border item, 'white' sleep sleep mark_item_border item, 'black' sleep sleep mark_item_border item, color sleep sleep end item end def mark_item_border(item, color) if item.is_a? Array item.each do |item| @a0.exec.script("arguments[0].style.outline = '2px solid #{color}'", item) end else @a0.exec.script("arguments[0].style.outline = '2px solid #{color}'", item) end end protected :mark, :mark_item_border end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
webdrone-1.0.4 | lib/webdrone/mark.rb |
webdrone-1.0.0 | lib/webdrone/mark.rb |
webdrone-0.9.9 | lib/webdrone/mark.rb |