webdrone 1.4.2 → 1.4.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2ef41efa4e2586dc9e615ba6ae7e3b361bc3e59d
4
- data.tar.gz: 934f79a2e9cc2f6e2029db09e0e3ec43e2db22d7
3
+ metadata.gz: fbb8e653bb70e462f36353ab600f8a800c0d3932
4
+ data.tar.gz: ecf51f3fd51fd71b90ed9357c73ddaedc5ae6db2
5
5
  SHA512:
6
- metadata.gz: a1f3a4073527cfd7fe2ac7391f6f8ca5072812d7a51a01ca6612a9f9ab394dfe50aa593982a3863a77943d36c20a416e0126823d0ee58b6a081302346ef7ef98
7
- data.tar.gz: 6a0989b1b2c02ff71f5c5527e40b5d31ef937bafad17ca3261e24757f5465e4fba66de3e319a39e0d6296828473287aed240758e76a7167d8ff29b374f2346e9
6
+ metadata.gz: 2219c382cb0a2febb2f2d07b9b4117cb085ffb848274cf29944b89ad64256c2442839f083084bd48d383490362820ca01c090eb17767d1d8af1b7957f78be695
7
+ data.tar.gz: 34103ebb553db7079d483e3db152e9b5357684b98e0b143e10009dc1e12e92ce3608ff5d10210267b7703279351c58630232340872941273dfdacb2cf014fb6c
data/CHANGELOG.md CHANGED
@@ -2,7 +2,29 @@
2
2
 
3
3
  New features are summarized here.
4
4
 
5
- ## v.1.4.2 - 2016-06-27
5
+
6
+
7
+ ## v1.4.4 - 2016-06-27
8
+ ### Added
9
+ - New parameter `shot` in `a0.form.mark`, to work the same way as `a0.mark` commands. Before:
10
+ ```ruby
11
+ a0.form.mark 'something'
12
+ a0.shot.screen 'something' # => screenshot-XXX-something.png
13
+ ```
14
+
15
+ Now you can do the same in one line:
16
+ ```ruby
17
+ a0.form.mark 'something', shot: true # => screenshot-XXX-something.png
18
+ ```
19
+
20
+ To change the name of the screenshot, pass a String instead of true:
21
+ ```ruby
22
+ a0.form.mark 'something', shot: 'value' # => screenshot-XXX-value.png
23
+ ```
24
+
25
+
26
+
27
+ ## v1.4.2 - 2016-06-27
6
28
  ### Fixed
7
29
  - Bug in `remote_selenium`, renamed to `remote_url`.
8
30
 
@@ -71,6 +93,7 @@ end
71
93
  ```
72
94
 
73
95
  The excel will contain the following updated data:
96
+
74
97
  |User|alternative_email|wants_email?|
75
98
  |----|-----------------|------------|
76
99
  |fry | | |
@@ -44,6 +44,14 @@ module Webdrone
44
44
  end
45
45
  binding.local_variable_set(v, n)
46
46
  puts "Webdrone: overriding #{v} from '#{o}' to '#{n}'."
47
+ elsif v == :mark_times
48
+ n = ENV[env].to_i
49
+ puts "Webdrone: setting mark times to #{n}"
50
+ self.mark.default_times = n
51
+ elsif v == :mark_sleep
52
+ n = ENV[env].to_f
53
+ puts "Webdrone: setting mark sleep to #{n}"
54
+ self.mark.default_sleep = n
47
55
  else
48
56
  puts "Webdrone: ignoring unknown parameter #{env}."
49
57
  end
data/lib/webdrone/form.rb CHANGED
@@ -114,8 +114,8 @@ module Webdrone
114
114
  Webdrone.report_error(@a0, exception)
115
115
  end
116
116
 
117
- def mark(key, n: 1, visible: true, color: '#af1616', times: 3, sleep: 0.05)
118
- @a0.mark.mark_item self.find_item(key, n: n, visible: visible), color: color, times: times, sleep: sleep
117
+ def mark(key, n: 1, visible: true, color: '#af1616', times: nil, sleep: nil, shot: nil)
118
+ @a0.mark.mark_item self.find_item(key, n: n, visible: visible), color: color, times: times, sleep: sleep, shot: shot
119
119
  rescue => exception
120
120
  Webdrone.report_error(@a0, exception)
121
121
  end
data/lib/webdrone/mark.rb CHANGED
@@ -6,13 +6,15 @@ module Webdrone
6
6
  end
7
7
 
8
8
  class Mark
9
- attr_accessor :a0
9
+ attr_accessor :a0, :default_times, :default_sleep
10
10
 
11
11
  def initialize(a0)
12
12
  @a0 = a0
13
+ @default_times = 3
14
+ @default_sleep = 0.05
13
15
  end
14
16
 
15
- def mark(text, n: 1, all: false, visible: true, color: '#af1616', times: 3, sleep: 0.05, shot: nil)
17
+ def mark(text, n: 1, all: false, visible: true, color: '#af1616', times: nil, sleep: nil, shot: nil)
16
18
  item = @a0.find.send __callee__, text, n: n, all: all, visible: visible
17
19
  mark_item item, color: color, times: times, sleep: sleep, shot: shot, text: text
18
20
  rescue => exception
@@ -27,7 +29,9 @@ module Webdrone
27
29
  alias_method :option, :mark
28
30
  alias_method :xpath, :mark
29
31
 
30
- def mark_item(item, color: '#af1616', times: 3, sleep: 0.05, shot: nil, text: nil)
32
+ def mark_item(item, color: '#af1616', times: nil, sleep: nil, shot: nil, text: nil)
33
+ times ||= @default_times
34
+ sleep ||= @default_sleep
31
35
  times.times do
32
36
  mark_item_border item, 'white'
33
37
  sleep sleep
@@ -1,3 +1,3 @@
1
1
  module Webdrone
2
- VERSION = "1.4.2"
2
+ VERSION = "1.4.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: webdrone
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.2
4
+ version: 1.4.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aldrin Martoq