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



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

def button(text, color: 'red', n: 1, all: false, visible: true)
  flash @a0.find.button(text, n: n, all: all, visible: visible), color: color
end

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



19
20
21
# File 'lib/webdrone/mark.rb', line 19

def css(text, color: 'red', n: 1, all: false, visible: true)
  flash @a0.find.css(text, n: n, all: all, visible: visible), color: color
end

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



43
44
45
46
47
48
49
50
51
52
53
# File 'lib/webdrone/mark.rb', line 43

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
# File 'lib/webdrone/mark.rb', line 15

def id(text, color: 'red')
  flash @a0.find.id(text), color: color
end


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

def link(text, color: 'red', n: 1, all: false, visible: true)
  flash @a0.find.link(text, n: n, all: all, visible: visible), color: color
end

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



31
32
33
# File 'lib/webdrone/mark.rb', line 31

def on(text, color: 'red', n: 1, all: false, visible: true)
  flash @a0.find.on(text, n: n, all: all, visible: visible), color: color
end

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



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

def option(text, color: 'red', n: 1, all: false, visible: true)
  flash @a0.find.option(text, n: n, all: all, visible: visible), color: color
end

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



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

def xpath(text, color: 'red', n: 1, all: false, visible: true)
  flash @a0.find.xpath(text, n: n, all: all, visible: visible), color: color
end