Class: Webdrone::Mark

Inherits:
Object
  • Object
show all
Defined in:
lib/webdrone/mark.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(a0) ⇒ Mark

Returns a new instance of Mark.



11
12
13
# File 'lib/webdrone/mark.rb', line 11

def initialize(a0)
  @a0 = a0
end

Instance Attribute Details

#a0Object

Returns the value of attribute a0.



9
10
11
# File 'lib/webdrone/mark.rb', line 9

def a0
  @a0
end

Instance Method Details

#button(text, color: 'red', n: 1, all: false, visible: true) ⇒ Object



33
34
35
36
37
# File 'lib/webdrone/mark.rb', line 33

def button(text, color: 'red', n: 1, all: false, visible: true)
  flash @a0.find.button(text, n: n, all: all, visible: visible), color: color
rescue => exception
  Webdrone.report_error(@a0, exception, Kernel.caller_locations)
end

#css(text, color: 'red', n: 1, all: false, visible: true) ⇒ Object



21
22
23
24
25
# File 'lib/webdrone/mark.rb', line 21

def css(text, color: 'red', n: 1, all: false, visible: true)
  flash @a0.find.css(text, n: n, all: all, visible: visible), color: color
rescue => exception
  Webdrone.report_error(@a0, exception, Kernel.caller_locations)
end

#flash(item, color: 'red') ⇒ Object



57
58
59
60
61
62
63
64
65
66
67
# File 'lib/webdrone/mark.rb', line 57

def flash(item, color: 'red')
  3.times do
    border item, 'white'
    sleep 0.1
    border item, 'blue'
    sleep 0.1
    border item, color
    sleep 0.1
  end
  item
end

#id(text, color: 'red') ⇒ Object



15
16
17
18
19
# File 'lib/webdrone/mark.rb', line 15

def id(text, color: 'red')
  flash @a0.find.id(text), color: color
rescue => exception
  Webdrone.report_error(@a0, exception, Kernel.caller_locations)
end


27
28
29
30
31
# File 'lib/webdrone/mark.rb', line 27

def link(text, color: 'red', n: 1, all: false, visible: true)
  flash @a0.find.link(text, n: n, all: all, visible: visible), color: color
rescue => exception
  Webdrone.report_error(@a0, exception, Kernel.caller_locations)
end

#on(text, color: 'red', n: 1, all: false, visible: true) ⇒ Object



39
40
41
42
43
# File 'lib/webdrone/mark.rb', line 39

def on(text, color: 'red', n: 1, all: false, visible: true)
  flash @a0.find.on(text, n: n, all: all, visible: visible), color: color
rescue => exception
  Webdrone.report_error(@a0, exception, Kernel.caller_locations)
end

#option(text, color: 'red', n: 1, all: false, visible: true) ⇒ Object



45
46
47
48
49
# File 'lib/webdrone/mark.rb', line 45

def option(text, color: 'red', n: 1, all: false, visible: true)
  flash @a0.find.option(text, n: n, all: all, visible: visible), color: color
rescue => exception
  Webdrone.report_error(@a0, exception, Kernel.caller_locations)
end

#xpath(text, color: 'red', n: 1, all: false, visible: true) ⇒ Object



51
52
53
54
55
# File 'lib/webdrone/mark.rb', line 51

def xpath(text, color: 'red', n: 1, all: false, visible: true)
  flash @a0.find.xpath(text, n: n, all: all, visible: visible), color: color
rescue => exception
  Webdrone.report_error(@a0, exception, Kernel.caller_locations)
end