webdrone 1.4.8 → 1.5.0
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 +4 -4
- data/CHANGELOG.md +33 -1
- data/lib/webdrone/logg.rb +33 -1
- data/lib/webdrone/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9a6886483cc7bf3eeef28050d029da3565181361
|
4
|
+
data.tar.gz: b37e7cfefcda6f08fcfb26191b4c4fc8fa197c83
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 878371a3882ce841051ade25fe9f2a9f3191a14cd0257201772a45c0bd9424571547494496a1e6c5c98ca522707af720f1ccc6d51bd51ab567e74f17956ccb3b
|
7
|
+
data.tar.gz: 36cab00a6abba640a62f860433812e281e7ab0d897523c95e8267b89a592c9f8a9fc0a8a44220f10ca8f206855ac7e8fa77bd08862d3ddb9693b4a921f910cf9
|
data/CHANGELOG.md
CHANGED
@@ -3,7 +3,39 @@
|
|
3
3
|
New features are summarized here.
|
4
4
|
|
5
5
|
|
6
|
-
|
6
|
+
|
7
|
+
## v1.5.0 - 2016-08-11
|
8
|
+
### Added
|
9
|
+
- Added platform info for Webdrone (ruby) on a0_webdrone_trace.csv file
|
10
|
+
- Added a0.logg.with_group, that generates a new entry for better error detection in the a0_webdrone_trace.csv file. Sample code:
|
11
|
+
```ruby
|
12
|
+
# if login group fails, the script is ended
|
13
|
+
a0.logg.with_group 'Login', abort_error: true do
|
14
|
+
a0.open.url 'http://example.com'
|
15
|
+
a0.form.set 'user', 'foo'
|
16
|
+
a0.form.set 'pass', 'bar'
|
17
|
+
a0.mark.on 'login', shot: true
|
18
|
+
a0.clic.on 'login'
|
19
|
+
end
|
20
|
+
|
21
|
+
# if operation1 group fails, continue
|
22
|
+
a0.logg.with_group 'Operation 1' do
|
23
|
+
a0.open.url 'http://example.com/operation'
|
24
|
+
a0.mark.on 'operation 1', shot: true
|
25
|
+
a0.clic.on 'something'
|
26
|
+
end
|
27
|
+
|
28
|
+
# if operation2 group fails, continue
|
29
|
+
a0.logg.with_group 'Operation 2' do
|
30
|
+
a0.open.url 'http://example.com/operation'
|
31
|
+
a0.mark.on 'operation 1', shot: true
|
32
|
+
a0.clic.on 'something'
|
33
|
+
end
|
34
|
+
```
|
35
|
+
|
36
|
+
|
37
|
+
|
38
|
+
## v1.4.8 - 2016-08-11
|
7
39
|
### Added
|
8
40
|
- More platform info on a0_webdrone_trace.csv file
|
9
41
|
|
data/lib/webdrone/logg.rb
CHANGED
@@ -48,6 +48,7 @@ module Webdrone
|
|
48
48
|
|
49
49
|
def initialize(a0)
|
50
50
|
@a0 = a0
|
51
|
+
@group_trace_count = []
|
51
52
|
setup_format
|
52
53
|
setup_trace
|
53
54
|
end
|
@@ -58,6 +59,37 @@ module Webdrone
|
|
58
59
|
CSV.open(@path, "a+") do |csv|
|
59
60
|
csv << [ini.strftime('%Y-%m-%d %H:%M:%S.%L %z'), (fin-ini), from, lineno, base, method_name, args, result, exception, screenshot]
|
60
61
|
end
|
62
|
+
@group_trace_count = @group_trace_count.map { |x| x + 1 }
|
63
|
+
end
|
64
|
+
|
65
|
+
def with_group(name, abort_error: false)
|
66
|
+
ini = Time.new
|
67
|
+
caller_location = Kernel.caller_locations[0]
|
68
|
+
cl_path = caller_location.path
|
69
|
+
cl_line = caller_location.lineno
|
70
|
+
result = {}
|
71
|
+
@group_trace_count << 0
|
72
|
+
exception = nil
|
73
|
+
begin
|
74
|
+
yield
|
75
|
+
rescue => e
|
76
|
+
exception = e
|
77
|
+
bindings = Kernel.binding.callers
|
78
|
+
bindings[0..-1].each_with_index do |binding, index|
|
79
|
+
location = { path: binding.eval('__FILE__'), lineno: binding.eval('__LINE__') }
|
80
|
+
if Gem.path.none? { |path| location[:path].include? path }
|
81
|
+
result[:exception] = {}
|
82
|
+
result[:exception][:line] = location[:lineno]
|
83
|
+
result[:exception][:path] = location[:path]
|
84
|
+
break
|
85
|
+
end
|
86
|
+
end
|
87
|
+
end
|
88
|
+
result[:trace_count] = @group_trace_count.pop
|
89
|
+
fin = Time.new
|
90
|
+
trace(ini, fin, cl_path, cl_line, Logs, :with_group, [name, abort_error: abort_error], result, exception, nil)
|
91
|
+
puts "abort_error: #{abort_error} exception: #{exception}"
|
92
|
+
exit if abort_error == true and exception
|
61
93
|
end
|
62
94
|
|
63
95
|
def setup_format
|
@@ -84,7 +116,7 @@ module Webdrone
|
|
84
116
|
browser_version = a0.driver.capabilities[:version]
|
85
117
|
browser_platform = a0.driver.capabilities[:platform]
|
86
118
|
webdrone_version = Webdrone::VERSION
|
87
|
-
webdrone_platform = "#{RUBY_ENGINE}-#{RUBY_VERSION}"
|
119
|
+
webdrone_platform = "#{RUBY_ENGINE}-#{RUBY_VERSION} #{RUBY_PLATFORM}"
|
88
120
|
|
89
121
|
csv << %w.OS ARCH HOSTNAME BROWSER\ NAME BROWSER\ VERSION BROWSER\ PLATFORM WEBDRONE\ VERSION WEBDRONE\ PLATFORM.
|
90
122
|
csv << [os, bits, hostname, browser_name, browser_version, browser_platform, webdrone_version, webdrone_platform]
|
data/lib/webdrone/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: webdrone
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aldrin Martoq
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-08-
|
11
|
+
date: 2016-08-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|